I recently noticed there are no tutorials using a stepper motor here at RNT. Is that something you might be planning for the future? For home automation projects, these can be quite useful!
The reason I ask is I have an idea to use a 2byj-48 stepper motor to flip a light switch on/off in a “garage automation” project I’m working on. I’ve already 3-d printed the part to attach to the stepper to the switch plate.
Problem is, I’m quite new to most of this coding, especially node-red and that’s where I’d like to be able to control it from but having trouble coming up with a way of doing this.
I’d like to have an esp8266 at each light switch location that would mqtt to a Raspberry pi I’m using as the broker.
I’ve been searching the net including node-red forum but not much around on this.
Just tossing it out there for discussion. 😉
Bob
Hi Bob.
At the moment, we don’t have any tutorials about stepper motors. That’s definitely something that we need to create, but I don’t know when.
If you want to control the stepper motor using node-RED and MQTT, I guess, it should be similar to controlling any other output: publish on a topic that the ESP8266 is subscribed to.
Then, the ESP8266Â should handle what happens when it receives a certain message on a topic.
To control the motor, I think you can use the Arduino Stepper library. You don’t need to install it, as it is installed by default: https://www.arduino.cc/en/reference/stepper However, I haven’t experimented the library, so I’m not sure how well it works with the ESP8266.
I hope this helps.
Regards,
Sara