In this blog post, I want to share how I managed to control my IKEA blinds that I currently use when I am using the projector. I just tell "Alexa" to turn on my projector and by doing that, the projector turns on and the blind starts opening. Pretty cool right? This project can be used for many things such as normal blind, opening a closing a radiator, etc... Infinite possibilities !!
-Stepper motor nema 17 (any similar motor will work)
-12V charger for powering the motor (You can also use a 9v battery)
-3D printed parts(not necessary)
Setting up Arduino to program ESP8266.
First of all we have to download the latest version of Arduino software.
Install the software and open the Arduino.
Then go to File -> Preferences.
Then we will have to put the next url:
http://arduino.esp8266.com/stable/package_esp8266com_index.json and put it here->
After that close that window and go to Tools>Board>Manage boards.
Once you open the board manager just go to the bottom and install the last one
Once installed we can flash any code to the ESP8266
Wiring everything to match the code GPIO pins that i use in my code. Of course you can change the DIR pins but i recommend using the default one so nothing goes wrong.
-Motor wiring can be wrong. It depends from where you buy however, but it is easy to fix.
-Dead A4988 . There is a testmotor.ino in the code so that u can easily check if everything is working as it should be. I recommend it a lot so that you are totally sure that if if does not work later on, you will be sure that that one is no the problem
-I recommend to put a capacitor on the 9 volt battery so anything get damage, I experience it by my self -.-
Code for the ESP8266. You will only need to open it from your computer and change 4 things
For Alexa integration, We will be using the Alexa WeMos emulator code created by kakopappa from here. https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch
1º Change the WiFI settings
2º Change the name of the device that u will create. Also u can change it from the Alexa app.
3º Change the max position of you protect. To do that go to rollerBlind.h and change the posFullUp value.
4º If you want to change the position of the DIR pins in the ESP8266 you will have to change it here in wemos.ino. This part is important to know that the pin 2 in my code means de D4 in the ESP8266. As you can see in your board there are some numbers on it but those are not the ones that we will use here. For example if you see the second picture : D0 (D zero) will be the GPIO 16 so if we want to use the D0 (D zero) in our code we will have to put 16. In my case the D4 means GPIO 2 and the D3 mean GPIO 0.
The first number means de DIR pin from the pololu and the second one the STEP
After that upload the code to the board. Make sure to select the Nodemcu 1.0 board on the Arduino. I recommend using the serial monitor to see if something goes wrong.
3D printed parts. If you do not have a 3d printer you can try to make it by your self with wood or something like that. In my case i have 2 of then so i designed some parts to fit perfectly with my ikea blind so that i dont have to drill any hole. All the parts are free to download in this link: Google Drive
Open your Alexa app and add the new device. Check everything works and that's all¡¡¡¡¡
Thanks to Aruna Tennakoon for the help ;)
Any question sen me an email to: email@example.com