Greetings everyone.
I would like your help on an issue I am facing with integrating a stepper motor to my home assistant through esphome.
The Idea is to utilize it as a ‘’switchbot’’ component to press a button on an old air conditioner and learn through the prosses.
The issue I am facing is that although I thing I have followed the esphome instructions for the setup I am missing something I cannot think about.
This is the code I have written in the yaml file:
esphome:
name: esp-step-motor
friendly_name: ESP step motor
esp8266:
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "aMSilZzisTYbAiZiOjG8hJYWo03LiZVZH2gyhhLElm0="
ota:
password: "77d955594eb5f5c11f7de45ea3d7fff7"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp-Step-Motor Fallback Hotspot"
password: "asfsdgsjdty"
captive_portal:
stepper:
- platform: uln2003
id: my_stepper_switch
pin_a: GPIO5
pin_b: GPIO4
pin_c: GPIO14
pin_d: GPIO12
max_speed: 250 steps/s
sleep_when_done: true #Puts the stepper to sleep to reduce power consumption and heat
acceleration: inf
deceleration: inf
number:
- platform: template
name: Stepper Control
min_value: -100
max_value: 100
step: 1
set_action:
then:
- stepper.set_target:
id: my_stepper_switch
target: !lambda 'return x;'
button:
- platform: template
name: "Stepper Press"
on_press:
then:
- logger.log: Button Pressed
- stepper.report_position:
id: my_stepper_switch
position: 0
- stepper.set_target:
id: my_stepper_switch
target: 500
I have performed the wiring as following:
I am getting these entities in home assistant:
Unfortunately, the motor is not moving at all.
The only thing I can think of is that may I need to change this part of the code
stepper:
- platform: uln2003
id: my_stepper_switch
pin_a: GPIO5
pin_b: GPIO4
pin_c: GPIO14
pin_d: GPIO12
with the following
stepper:
- platform: uln2003
id: my_stepper_switch
pin_a: d1
pin_b: d2
pin_c: d5
pin_d: d6
Although I did change, I had no luck.
To verify that have an operational stepper motor and uln2003 board, I have connected them to an Arduino uno I have around and tested is successfully with one of the examples. I have also tested the setup with a different nodemcu v2.1 esp8266.
Any help is much appreciated.
Thank you for your time in advance.