Remote Controlled Light With WiFi Status Checker

by Jeshanthan in Circuits > Remote Control

583 Views, 3 Favorites, 0 Comments

Remote Controlled Light With WiFi Status Checker

20220708_150529.jpg

This instructable is about a remote controlled light, which I made. I've added another feature which is WiFi status checking. I've done this because whenever I sleep on bed I faced two different kinds of problem. The first one is turning off the light bulb after I slept which is a hassle because I always have to get-off the bed in order to turn it off. The second one is I usually like to watch YouTube before I sleep and while I am watching YouTube the WiFi or the phone stops randomly at any time. At this moment I always have to go to the server room in order to check the WiFi connection. In this instructable I solved those two kinds of problem and you can build it by following this instructable.

Supplies

20220707_201253.jpg
20220707_202153.jpg
20220707_203539.jpg
Screenshot_20220707-202833_Google.jpg
Screenshot_20220707-203057_Google.jpg
Screenshot_20220707-203253_Google.jpg

PARTS YOU NEED:

  1. 9x15cm perfboard - 1pcs purchase it right away from here
  2. breadboard - 1pcs purchase it right away from here
  3. male-to-male jumper wire - 3pcs purchase it right away from here
  4. silver coppered wire - 70cm purchase it right away from here
  5. Thick elctrical wire - 4pcs purchase it right away from here
  6. Holder for light bulb ( according to your country) - 1pcs purchase it right away from here
  7. 47k resistor - 1pcs purchase it right away from here
  8. relay 5v - 1pcs purchase it right away from here
  9. 1uf capacitor 16v - 1pcs purchase it right away from here
  10. arduino nano - 1pcs purchase it right away from here
  11. BC557 pnp transistor - 1pcs purchase it right away from here
  12. 230 v to 5v SMPS - 1pcs purchase it right away from here
  13. ESP-01s - 1pcs purchase it right away from here
  14. IR sensor(vs1838b) - 1pcs purchase it right away from here
  15. AMS1117-3.3 - 1pcs purchase it right away from here
  16. diode 1N4007 - 1pcs purchase it right away from here
  17. Any kind of Ir remote ( should have at least 2 buttons) - 1pcs purchase it right away from here


TOOLS YOU NEED:

  1. Multimeter purchase it right away from here
  2. Laptop purchase it right away from here
  3. ESP-01s programmer purchase it right away from here
  4. Wire stripper purchase it right away from here
  5. Hot glue gun purchase it right away from here
  6. Scissors purchase it right away from here
  7. Solder wire purchase it right away from here
  8. Soldering iron purchase it right away from here
  9. USB type-B cable purchase it right away from here


NECESSITIES:

  1. You should have WiFi connection in your house

Software Configuration

solar_light _ Arduino 1.8.19 07_07_2022 08_30_16.png
solar_light _ Arduino 1.8.19 07_07_2022 08_32_01.png
solar_light _ Arduino 1.8.19 07_07_2022 08_37_53.png
solar_light _ Arduino 1.8.19 07_07_2022 08_43_59.png
solar_light _ Arduino 1.8.19 07_07_2022 08_45_05.png
solar_light _ Arduino 1.8.19 07_07_2022 08_47_29.png

First you should have download and install Arduino.

Download link :- "https://www.arduino.cc/en/software".

After installing Arduino ,go to tools and click library manager. It will open a new dialogue box which looks like Figure1.0.

In the search bar type "IRremote" and you'll see this(Figure1.1).

You will see the library "IRremote" and set the version to 2.0.1 (because newer versions are little bit hard to interact with) and click install(Figure1.2).

Then close the dialogue box.

After that go to file and click preferences. Here you can see an empty box named "Additional Boards Manager URLs". paste the link "https://arduino.esp8266.com/stable/package_esp8266com_index.json" in that box and click ok.(Figure1.3)

Then go to Tools and click Boards Manager and in the search bar type ESP (Figure1.4). You can see the board esp8266. Install it by clicking install button.

We've already installed a library called "IRremote". Now we have to download another library called "IRremoteESP8266". Go to library manager and search this "IRremoteESP8266" and install here you don't have to worry about the version.(Figure1.5)

WHOO! WE HAVE SUCCESSFULLY FINISHED THE SOFTWARE CONFIGURATION

Gathering the IR Codes

vs1838b ir receiver - Google Search - Google Chrome 08_07_2022 00_47_26.png
COM6 08_07_2022 01_11_21.png
link - Notepad 08_07_2022 01_11_34.png

Get the bread board , Arduino NANO , IR receiver, jumper wire and connect the first pin of IR receiver to pin 11. The second one goes to gnd. Third one goes to 5v and upload the code ir_code_checker.ino. (which is provided below). Open up the serial monitor set the baud rate to 9600 and press the button on the remote get your codes. You have to get two codes from two different butons. One to turn the light on/off and another one to check the status of the WiFi.

See the images for further details

Programming the Esp-01s

esp programmer - Google Search - Google Chrome 08_07_2022 01_22_36.png
sketch_for_light _ Arduino 1.8.19 08_07_2022 02_07_24.png

Connect your Esp-01s to your ESP programmer and select the board to Generic ESP8266 module and upload the code given below

CONSIDER THIS BEFORE UPLOADING

  • Fill your WiFi name in your_SSID string
  • Fill your WiFi password in your_PASSWORD string
  • Fill the on/off ir code right before the comment //Type your on/off code
  • Fill the WiFi status checking IR code right befor the comment //Type your WiFi status checking code

Explanation of the code are provided next to each line in the code

Build the Circuit

EasyEDA(Standard) - A Simple and Powerful Electronic Circuit Design Tool - Google Chrome 07_07_2022 21_50_23.png

The schematic of the circuit is presented above

NOTE

I didn't add the 47k resistor between transistor base and gpio 0 because it has a resistor inbuilt in esp-01s because I designed the esp-01s myself but the commercial ones don't have that so if you are using a commercial one, you should put that resistor

Soldering

EasyEDA(Standard) - A Simple and Powerful Electronic Circuit Design Tool - Google Chrome 07_07_2022 21_50_23.png
20220708_150529.jpg

Solder all the components according to the schematic

Protection and Mounting

20220708_154503.jpg

Protect the high voltage parts with hot glue and mount it on the wall with the help of hot glue.


WHOLA WE'VE SUCCESSFULLY MADE THE CIRCUIT

Why Am I Using a PNP Transistor

EasyEDA(Standard) - A Simple and Powerful Electronic Circuit Design Tool - Google Chrome 07_07_2022 21_50_23.png

Because whenever gpio0 pulled down to ground it will go to the programming mode. An NPN transistor allows current to flow from base to emitter and emitter should be connected to ground while using an NPN transistor so the gpio0 will get pulled down to 0v so it will go to programming mode. In order to omit this I used a PNP transistor.

What Is the Use of the Diode Here

EasyEDA(Standard) - A Simple and Powerful Electronic Circuit Design Tool - Google Chrome 07_07_2022 21_50_23.png

The diode D1 is here to protect the PNP transistor. Coils have a common behavior which is producing a big voltage spike when we disconnect a dc power source (which is connected beforehand) this would happen in opposite polarity. So the diode is connected across the coil terminals in order suppress that big voltage spike because of this our transistor would be happy.

How the Circuit Works

EasyEDA(Standard) - A Simple and Powerful Electronic Circuit Design Tool - Google Chrome 07_07_2022 21_50_23.png

Firstly, when we input 230v in the input the SMPS will step it down to 5v. Then the ams1117-3.3 regulator will step that down to 3.3v because the ESP needs 3.3v to work. The 5v supply is needed to power the relay. Then the esp-01s will execute our code and it will do nothing until we press any of those 2 buttons that we've programmed earlier. If we press the on/off button, it will turn the light on. If we press the WiFi status checking button, it will switch the state of the light depending on the connectivity to the WiFi.

Test Run

Test run