No Badges

LED Controlled Lamp A step-by-step DIY helping you in automating your home.


Description

Home Automation is a new field that is growing rapidly. You can automate anything in your house and control it remotely. This gives you statistics on usage and gives you access to your house while you are away to control your heater, coffee machine, and the lightning.

In this small project, I will be controlling an LED lamp through WiFi. This will be a small step that will help you learn the basics of home automation. After completing this project, you will be able to just remove your old filament lamps and replace them with LED lamps that can be controlled remotely from anywhere, all while saving energy.

The next step will be a guide that will help you control anything you want in your house. The theme over here is baby steps that will eventually give you the enough qualification to fully automate your home.



Tutorial

In this DIY, we will be controlling an LED lamp using an ESP8266 Node MCU WiFi module. We will program it using the Arduino IDE.
Materials:
1- LED Lamp
2- ESP8266 NODEMCU WiFi Module
3- IRF520 Transistor
4- Step up converter
5- 5V old phone charger
STEP 1:
You have to know how much voltage does your LED Lamp require to operate, so you would get the step up converter that is needed. Mine required somewhere around 55 V. It was a cheap Chinese lamp that had a huge variation in the voltage, but I was able to make it work with the 60 V step up converter.

fig-1

fig-2

fig-7

 

STEP 2:
You should use the phone charger to provide you with the 5V required to operate the NODEMCU. You can directly connect it to the micro USB port on the NODEMCU. At the same time, you need to take the 5V and connect them to the step up converter to provide the LED Lamp with the juice it needs.
“A boost converter (step-up converter) is a DC-to-DC power converter steps up voltage (while stepping down current) from its input (supply) to its output (load).” –Wikipedia
So what happens is that even though you get the voltage you need, you would get a not so little current drop. So before you start, make sure to choose an LED lamp that does not require a high current. I made that mistake, so the brightness of my lamp was not so high.
So back to the actual work.
Open the case of the charger, and make sure not to cut the micro usb cable, but you would still need to make it shorter. Solder a wire to the positive output and another cable to the negative output of the charger. Those cables should go directly to the step up converter.

fig-3fig-4

STEP 3:
Now Solder a wire to the positive output of the converter and another to the negative output. Now you should use the following schematics to connect them with the transistor, the Node MCU and the lamp.

fig-5
fig-6

STEP 4:
You now are almost done with the hardware. We should get into the software.
First of all, you need the Arduino IDE.
You can get it from here: https://www.arduino.cc/en/Main/Software
Connect the NodeMCU to your computer.
Go to File → Preferences

setup-1
Paste the following link into the Additional Boards Manager URLs
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Then go to TOOLS → Boards → Boards Manager
setup-2
Install your version of the Wifi Module.

setup-3
Use the following Code:
(File Wifi LED Code)
This code controls 4 pins on the NodeMCU. I am not an expert in the Wifi coding, so I kept it the way I found it on:
http://internetofthinking.blogspot.in/2015/12/control-electrical-devices-from-user.html
Don’t forget to change the baud rate, that works for your module, and don’t also forget to change the SSID and the PASSWORD for the network that you are using.
Once you upload the code, it will give you an IP address in the serial Monitor screen. Open that IP address while connected to your local WiFi network, and you will be able to see the 4 buttons.

serial-monitor

web-page

Using the following map, you will be able to connect more devices in the future to the same NodeMCU module. But for this application, I used the pin D7, which translates to pin 13 in the Arduino IDE.

nodemcu-pins-map1

STEP 5

You are almost done. This step varies depending on what you want your package to look like. I 3D printed an extension to my LED lamp, because the parts did not fit in the original case.

fig-7

 

This is what my final product looked like. You should just put everything inside the package, and you are done. Just plug it in the lamp socket, and open your IP address to control it.

Smart LED


Estimated Cost:

$30.00
Copyright 2016 IBTECAR. All rights reserved