Hi all,
I’ve been struggling with this a bunch and I cant seem to get any further, hence my first post on this forum:
I’m trying to build motorised smart blinds. At first I followed Everythingsmarthome’s tutorial to a T. I fried my first buck converter due to a mistake in his schematic but figured it should work after adjusting for that error. I replaced everything just in case I damaged any other components, but no matter what I did I couldn’t get it to work. The logs show Homeassistant sending the commands and them being picked up by my D1 mini but I couldn’t get any sign of life from the stepper.
After weeks of fidgeting I figured I’d try the ULN2003 driver the stepper gets shipped with. Eureka I thought: when I click the button on Homeassistant my stepper turns. My joy was short lived however, as I quickly realised it will only turn clockwise, regardless of whether I press the up or down button.
I’ve tried every possible wiring combination on the INT pins but the motor either spins clockwise or not at all.
Here’s my wiring (I’m feeding the 5v stepper with a 12v adapter, is that an issue?):
and my code:
esphome:
name: my_blind
friendly_name: scherm
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
services:
- service: control_blind
variables:
target: int
then:
- stepper.set_target:
id: my_stepper
target: !lambda 'return target;'
- sensor.template.publish:
id: position
state: !lambda 'return target;'
encryption:
key: "MXxubr6AnYyclqvxIaCh/Ilw1Wu7mN3ViMktsVqUFxo="
ota:
password: "95c5b06184b0236dc75bbf850855a05e"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Scherm Fallback Hotspot"
password: "fkI3VDZXGkWm"
cover:
- platform: template
name: "My Blind"
id: my_blind
device_class: blind
open_action:
- stepper.set_target:
id: my_stepper
target: 1000
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).target_position;
close_action:
- stepper.set_target:
id: my_stepper
target: -1000
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).target_position;
stop_action:
- stepper.set_target:
id: my_stepper
target: !lambda return id(my_stepper).current_position;
- sensor.template.publish:
id: position
state: !lambda return id(my_stepper).current_position;
optimistic: true
assumed_state: true
sensor:
- platform: template
name: "My Blind Position"
id: position
stepper:
- platform: uln2003
id: my_stepper
sleep_when_done: true
pin_a: D4
pin_b: D3
pin_c: D2
pin_d: D1
max_speed: 250 steps/s