Automatic Light Controller

by badarsworkshop in Circuits > Arduino

7340 Views, 67 Favorites, 0 Comments

Automatic Light Controller

57a17dbf67400ccea5000005.jpeg
_DSC0040.jpg
_DSC0039.jpg

In this instructable i will show you how to make an automatic light controller. I wont claim this idea as my own since many before me have made things like this but what i felt was that they all showed the prototype and not the implemented forms. If its not implemented as a reliable device in real life, then its of no use.

But first let me explain what this is although its pretty self explanatory but basically its a controller that will control a load using information of the number of people in the room. The number of people are counted using two parallel laser beams and corresponding ldr sensors. The algorithm senses the order of broken beams and counts accordingly. More on that later.

I have shown how this will be implemented in real life. I am currently using this system for my room and have been using it past few day, making improvements along the way. Even now its not perfect but its good enough that i feel confident presenting it to you guys.

If you like my instructable, please vote for me.

Parts List and Tools

_DSC0005.jpg
_DSC0001.jpg
_DSC0022.jpg

Following are the parts used for this project:

  1. 2 Electronic Project Boxes
  2. Relay Module
  3. Arduino Nano
  4. 2 LDR Modules (Custom or off the shelf)
  5. Prototyping Board
  6. Wire
  7. 5V Laser Modules
  8. 5V Power Supply

Some of the tools and supplies you will need

  1. Drill Machine
  2. Soldering Iron
  3. Wire Cutters
  4. Solder Wire
  5. Laptop

My Prototype

_DSC0002.jpg
_DSC0003.jpg
_DSC0004.jpg

My first approach towards this was also to build it on a bread board. I built the entire circuit and used an lcd as well. I used a separate breadboard for laser diodes. Only after testing and tuning my code, i decided to implement it.

Building the Transmitter Side

_DSC0006.jpg
_DSC0007.jpg
_DSC0008.jpg
_DSC0009.jpg

This is very easy because all you have to do is to hook up the two laser diodes. I used some lego technic parts to make an aiming system for each laser beam so that i can adjust it accordingly. You can use lego or any other method you find easy. I just glued the assembly inside one of the project boxes and wire it up. I taped the wire to avoid undue stress on the wires going to the laser module.

Building the Custom LDR Sensor

_DSC0026.jpg
_DSC0023.jpg
_DSC0024.jpg
_DSC0025.jpg
Schmitt555-1.gif

At first i used off the shelf ldr sensors but for some reason my code was having trouble with it. So i decided to build my own. I used a prototyping board and a basic 555 timer IC with minimal components. The circuit is very basic. I built two on the same bread board and connected an LED and a wire with the output of each which is pin 3 on the 555 timer ic.

Building the Reciever Circuit

_DSC0010.jpg
_DSC0011.jpg
_DSC0013.jpg
_DSC0026.JPG
_DSC0027.jpg

The receiver circuit consists of the Arduino Nano. First go ahead and mount the arduino nano on a prototyping board. Then connect the relay to the arduino such that the signal pin is connected to one of the digital pins and power pins are connected to the 5 volt supply rail. Then connect the ldr circuit such that power pins go to the 5 volt supply rain and data pins go to the arduino digital pins. Pin numbers dont matter as they can be changed in the code.

Building the Reciever Side

_DSC0017.jpg
_DSC0028.jpg
_DSC0029.jpg
_DSC0030.jpg

Drill holes in the project box to mount the electronic circuits. The ldr circuit will be mounted such that it faces the lasers. The arduino will be mounted in the center such that you have usb access. Insulate and add the relay module in there. My box was small so it was a tight fit. I couldnt mount the relay module. Insulate the power supply module and put that in there as well. I made the mistake of not having external usb access to the arduino nano so i had to mount everything open and then close it later. You dont make that mistake so that you can mount it while its all closed and program from there.

Installation

_DSC0031.jpg
_DSC0033.jpg
_DSC0034.jpg
_DSC0038.jpg
_DSC0035.jpg

Mount the pair on both side of the door sill just below hand level. Run a wire between the two either from below or above like i did it. This will be to power the transmitter side. Run another wire to your electrical panel where you will wire the relay inline with your light switches.

What i did was add a switch on the power supply of the receiver so that i can turn the system on and off as i want. The lights were wired on the relays normally closed side so that if the system malfunctions i can just turn it off and normal operation will resume.

I aimed the laser diodes and then placed covers on both the sides to make it look more neat.

Code

Sorry i accidentally deleted the code. I will rewrite it soon and post it here asap.

Conclusion

This was a great little project and it really does work. Its so fun when you walk out and lights go out automatically. It does have an issue when two people walk in at the same time or if a person stands in the door way. Still figuring out the solution.

Thanks for viewing my instructable and i hope you liked it. Please comment you suggestions and improvements.

Please vote for me if you liked my ible.