28BYJ-48 Stepper Motor and ULN2003 Stepper Motor Driver

I am trying to make the “28BYJ-48 Stepper Motor and ULN2003 Stepper Motor Driver” motor to work with HA.

My configuration

ESPHOME:

api:
  services:
    - service: control_stepper
      variables:
        target: int
      then:
        - logger.log: "Speed updated"
        - stepper.set_target:
            id: left_shade
            target: !lambda 'return target;'

stepper:
  - platform: uln2003
    id: left_shade
    sleep_when_done: true
    pin_a: D1
    pin_b: D2
    pin_c: D3
    pin_d: D4
    max_speed: 50 steps/s
    # Optional:
    acceleration: inf
    deceleration: inf

configuration.yaml


input_number:
  stepper_control:
    name: Stepper Control
    initial: 0
    min: -1000
    max: 1000
    step: 10
    mode: slider

automations./yaml

- alias: Write Stepper Value to ESP1
  trigger:
    platform: state
    entity_id: input_number.stepper_control
  action:
    - service: esphome.first_control_stepper
      data_template:
        target: "{{ trigger.to_state.state | int }}"

I have set the connections and i am using 5v has input for the stepper motor.

I am not able to make it work; i spent close 20 hours on this.
I did not find any article for this related to esphome; home assistant.

Thanks

2 Likes

Above configuration worked fine.
I have a esp name issue which was solved after deleting the esp and recreated.
Thanks

1 Like

Could you gently share your wiring diagram? I’m trying to achieve the same as you did.

1 Like

Would you be so kind as to clarify what you did specifically to make this work? In my case, I am using the stepper motor to pan a camera left and right. I don’t remember what I did to make it work and you are the only one mentioning you got it working. Is it a name in one of the YAML files that was a conflict? Thank you.

I am going nuts trying to get mine to work too. Any luck?

Justin, no I have not and have reviewed the ESPhome website, and as far as I am concerned is jibberish. I did have it working about a year ago but my computer crashed and I lost my backups after which the Pi crashed. I know there is a needed YAML that you must upload to the device in my case an ESP8266 then there is some YAML code that needs to be loaded into the configuration.YAML file. Each time I find someone that has got it working they fail to post the YAML files needed for others to copy and paste.
If you get it working please share the ESPhome YAML file and the YAML code that needs to be inserted into the configuration.YAML file. Happy Hunting.

1 Like

I second this.

I was able to make it work! I think this thread might be useful with the wiring.

1 Like