1

I have an stepper motor, and a stepper driver Uln2003a which is connected to an esp8266.

the esp8266 is powered via usb, and the stepper motor is powered via the driver, which is then powered by an external power source providing it a bit more than 12 volt. When powered on the LED D1 and D2 lights red.

pins - d0,d1,d2,d3 are used for input signal for the drive, the stepper board.

Everything should be connected correctly, but for some reason am I not able to make my stepper motor move? it doesn't react on any of my commands - why?

I suspect that the logic level might have to be 5v instead of 3 v? but i've seen stepper motors been driven by a esp before? so why does this not work? any suggestions?

any ways to debug?

code:

esphome:
  name: steppermotor
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "ssid"
  password: "password"

# Enable logging
logger:

# ESPHome configuration
api:
  services:
    - service: control_stepper
      variables:
        target: int
      then:
        - stepper.set_target:
            id: my_stepper
            target: !lambda 'return target;'


# Example configuration entry
stepper:
  - platform: uln2003
    id: my_stepper
    pin_a: D0
    pin_b: D1
    pin_c: D2
    pin_d: D3
    max_speed: 250 steps/s

    acceleration: inf
    deceleration: inf
  • Do the pins, that you use for controlling the driver, are set correctly? The datasheet says, that it can work with 3.3V logic input voltage. I'm not familiar with that kind of code. Where are the functions defined, that actually control the output pins? – chrisl May 20 at 20:53
  • the code is part of the esphome.io/components/stepper/index.html – Carlton Banks May 20 at 20:59
  • I am pretty sure about the pins... I don't know whether picture would help or? – Carlton Banks May 20 at 21:00
  • 1
    Mhh, I don't think I can help with the code. Haven't seen that before. The pins are just connected straight to the 4 input pins of the driver. Not much to fail there. The LEDs on the driver will light depending on wether there is a HIGH voltage level on that pin. If nothing happens I would think, that either the pins are not set by the code, or your driver is dead. You can test the latter by connecting the 4 phases one by one to 3.3V. If the LEDs light up correctly, the error must be in your code. – chrisl May 20 at 21:15
  • From your code I guess, that you try to control the stepper via an API. How do you call to this API? Do you construct your own call string, or do you have some kind of UI on that site of the project (ESPHome)? – chrisl May 21 at 10:35
0

I hope there must be an inbuilt pull-up resistance for each GPIO registers of ESP.

Test like this and post your observation: 1. Don't connect anything(ULN2003 jumper wires) to your ESP and check the GPIOs you selected whether they are floating or not. If no float in reading then it's fine. 2. Connect the load and test the GPIOs are floating or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.