So hi there, I basically made this project so that I don't have to get out of bed at night to turn off the lights. The project is very simple and I shall try my best to explain how I did everything. Most of the code is from the SinricPro library examples with a few minor changes here and there.
(I am aware there are better ways to automate the lights in my room but I chose this method cause it is super simple and can be done within 2.5 hours. I do plan on making a much better device to automate my room light later on so... that's cool)
REQUIRED COMPONENTS:- ESP8266
- Servo
- Wires
- Soldering station
- And some other basic tools (wire cutter, blade, etc.)
TO GET THE CODE RUNNING ON THE IDE
- Download all the required libraries to the Arduino ide
- The SinricPro library can be downloaded from the library manager
- The esp8266 library must be added as a.ZIP library
- Change the board type for this we have to go to File -> Preferences -> and in the additional boards manager URLs add these two links:
https://dl.espressif.com/dl/package_esp32_index.json
http://arduino.esp8266.com/stable/package_esp8266com_index.json
then go to Tools -> Board manager and choose your specific board
- Then enter the code given below in the ide
- For the api key, secret and device id you will have to create a sinric pro account and create a device (set the device type as switch)
TO GET THE ELECTRONICS WORKING
- The soldering bit is fairly simple, just solder the V and GND of the servo to the esp8266 board's and the third wire of the servo is connected to the D4 pin of the board
MAKE A COOL CASE FOR YOUR ELECTRONICS
- Make a case to house all your electronics and choose a size suitable for your purpose and switch size.
- Your pc may not be able to recognize your board so try updating the drivers (it mostly will be given on the under side of the board from where you can get them from)
- The wifi you are using in of 5GHz frequency, unfortunately the board only works with 2.4GHz
Comments