IoT Light Controller

by NeshS in Circuits > LEDs

255 Views, 0 Favorites, 0 Comments

IoT Light Controller

20210121_193317.jpg
Screenshot_20210121-162657_Blynk.jpg

With LED's getting cheaper, it is being used more and more extensively in various ways. No matter whether you want to set up artificial light system for your plants or for yourself, this project can be adapted for many situations. Learn how to make an app to control light by means of timer or manually.

Supplies

1. Microcontroller (Wemos D1 R1);

2. Relay (3.3V compatible), can be double;

3. Connection wires;

4. 2 pairs of DC Barrel Jack to 2-Pin Terminal Block Adapter (male and female);

5. LEDs and compatible power supply;

6. Blynk App;

7. Arduino IDE.

Wiring

20210121_192744.jpg
20210121_194359.jpg
20210121_194551.jpg
20210121_194244.jpg

In my case, I've used blue, red, warm and cold white 12V LED strips. Red and blue LED strips were connected to relay1, white ones to relay 2.

1. Connect relay pins as shown in a picture: Relay GND to boar GND pin, Vcc to 5V, In1 and In2 to D8 and D9 respectively.

2. Connect positive lane of barrel jack to COM relay pin, negative - directly to LED negative terminal. LED positive terminal goes to NO relay pin.

3. Connect barrel jack to power supply.

Arduino Code

Download file below (open in with an Arduino IDE), upload sketch to a Wemos D1 R1 board.

Blynk Setup

Screenshot_20210121-162735_Blynk.jpg
20210121_193132.jpg

1. If you do not have Blynk App, download it (check out how to do it here).

2. Start a new project, you'll receive Auth Token. Add it to the Arduino code. Do not forget to add ssid and password.

3. From widget box select (check out the picture):

a) Segmented Switch: set Output to pin V0, option 1 - "Timer mode", option 2 - "Manual mode";

b) 2x Buttons: set Output to V2 ("Turn on") and V3 ("Turn off") pins, change both labels to "on" of "off" for "Turn on" and "Turn off" buttons respectively;

c) Time input: set Output to V1 pin, format - HH:mm, allow Start/stop input, do not allow rest of the selections;

d) Real-time clock (pick time zone).

4. Once widgets are set and sketch uploaded to a board, press start.

5. Pick one of the modes. Set up time period that you want your lights to be on and that's it.

Little Challenge!

20210121_193146.jpg
20210121_193215.jpg

Try to change project so you could control relays(different color LEDs) separately. Let me know how it goes!:))