3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Door Activated LED Lighting using Hall Effect Sensors

Door Activated LED Lighting using Hall Effect Sensors
I've been meaning to make something cool for my dorm room this coming semester and decided that some custom closet lights would look great. In this Instructable, I'll show you how to make some nice-looking LED lights that will turn on automatically using a hall effect sensor and a magnet.

Edit: I've noticed a lot of people are hating on the excessive control used in this project so I just wanted to clarify a few things:

1. This instructable was also meant to be a lite introduction to actual AVR programming for those people who are used to only Arduino programming. I had a bit of trouble finding useful information when I was learning so I figured it would be nice to help out some others. That is why I posted the basic tutorials along with my AVR code.
2. Yes I'm aware I could have simply used a reed switch to switch the LEDs when the door opened and closed. I wanted to leave room open for myself to add different light modes, maybe using more wires and pins to create nice fading effects, possibly a remote control sensor, and maybe even an auto-shutoff routine.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Gather materials

Stuff needed:

The usual tools:
1. Soldering Iron/Solder
2. Electrical tape
3. Protoboard

Parts:
1. Hall Effect Sensor-(one used can be found here: http://www.sparkfun.com/commerce/product_info.php?products_id=9312
2. Attiny85-(any micro can be used, mainly just for quick and easy digital input readings)
3. Led's of any color
4. Cases for the lights,
5. Wire and Wall wart
6. Resistors (1k and 3x33Ohm used in mine)
7. Magnet

Note: A microcontroller isn't necessary for this to work. If you can get the sensor to successfully switch a transistor to saturation, you should be able to skip the whole controller and coding part.
« Previous StepDownload PDFView All StepsNext Step »
27 comments
Aug 8, 2011. 12:02 AMWally_Z says:
Is there a way to modify this circuit to make it when my door is open for 15 seconds, a servo is activated to close it? If so please contact me.
May 7, 2010. 12:52 PMmicobanff says:
 This would look amazing in those Ikea Hopen wardrobes, the ones with the frosted glass door. But maybe on a timer so that it's turned on from a certain time at night until early morning, a very big nightlight. lol
Dec 17, 2009. 12:36 PMEntropy512 says:
One thing that could be an issue:  Since LEDs can have some variance in their forward voltage, it's usually not the best idea to have multiple parallel strings of LEDs (or in this case, parallel single LEDs) that share a single current source or resistor.  Unless the LEDs were specifically binned with identical Vf, the current distribution between the LEDs could be quite uneven, resulting in uneven LED brightness and potentially damage to any LEDs that have significantly lower Vf than the others.
Sep 27, 2009. 6:13 PMdukich5536 says:
oh wow, I think I'll try with a movement detector. Thanks for posting
Sep 15, 2009. 12:14 PMHardCoreHacker says:
from your pictures, it looks like its more for show. I say this because it doesnt look like its really brightening up the closet enough. I may be picky, but thats my opinion.
Sep 17, 2009. 10:30 AMjrdellan says:
is there any video?
Sep 15, 2009. 12:15 PMHardCoreHacker says:
Ive never seen tis before, i have to admit and it would be extremely helpful.
Oct 21, 2009. 6:54 AMm1middleton says:
I actually did make something comparable with a reed switch, and trust me it's bright enough.  Unless you actually enjoy the overhead lighting in a "normal" office of course...
Sep 14, 2009. 2:41 AMgeoper2 says:
nice one thx for sharing there is really a lot that can be done for upgrade but its really useful thx again
Sep 8, 2009. 6:35 PMktalex says:
instead of eating so many icebreakers u could have bought the led thing already made at the 99c store i saw them last week.
Sep 9, 2009. 2:57 AMLance Mt. says:
Pfft, and? Wheres the fun in that? Altough i would take that 99c device and rig up a serious annoy-o-ma tron and slide em around Lets say a 99c sensor + a 99c smoke alarm (more or less its alarm) and rig it up
Sep 9, 2009. 6:03 PMktalex says:
there are 99c sensors dude u gotta tell me were to get that.
Sep 2, 2009. 4:08 AMrevhead says:
oh, and i also wanted to ask if a 555 timer would work. never used an "Attiny85" before so i dont know??
Sep 5, 2009. 12:42 AMrevhead says:
Thanks for all that info. I don’t have any knowledge of programming microcontrollers but do have knowledge with transistors and the such. I have a fairly good schematic which is Brocken up into two sections, an input and an output. they are separated by a relay so that the "week" input can trigger a very small reed relay which will then trigger the output which includes a transistor to keep the LED's for example "on" even when the input disappears. I might give it a try with your concept. It’s confusing but it works, I built a Laser beam alarm system with it and it turned out great, I even posted an instructable on it. Check it out if you are interested. CHEERS!!
Sep 6, 2009. 11:16 PMomnibot says:
I don't see why a halleffekt sensor wouldn't work with a 555 in astable, the switching is fairly on/off.
Sep 4, 2009. 6:29 PMI am Silas. says:
That is AWESOME!
Sep 3, 2009. 5:57 PMmangomango says:
If I was going to do this I would make it so that it turns on when the sensor goes off (say you walk into a room) then it turns off when you pass it again, pretty cool 'ible though
Sep 3, 2009. 9:39 AMjambre says:
Just wanted to say this could be done very easily with a reed switch instead of a hall cell and would use no power when the door is closed. Just put a reed switch instead of the hall cell and have it switch the power line to the LED's. No microcontroller necessary and reed switches are pretty cheap.
Sep 3, 2009. 2:30 PMjambre says:
If you're concerned about the current through the reed switch, you could use it to drive the transistor. If the hall effect sensor is having trouble sourcing the current try hooking it to a FET instead
Sep 3, 2009. 12:11 AMlargejunglecat says:
Couldn't you have simplified this circuit significantly using a reed switch and a relay? You wouldn't need any microcontroller at all.
Sep 2, 2009. 10:35 PMstatic says:
A well done instructable for detailing your approach for acomplishing what you wanted to accomplish. For simply turning the lights on or off a simple magnetic reed switch(NO) should be able handle the current draw of controling theLEDs directly or control a 555 timer curcuit if if a delayed on time is desired. Arduino and other PICs are the rage of the day, used when simpler circuit would do the job. Like when the 555 was the rage of the day, used, when discrete transistor circuit would do the job. The differance being the 555 resulted in smaller less expensive project, and the PICs often result in larger more expensive project.
Sep 2, 2009. 4:04 AMrevhead says:
u could attach a bracket to the top of a door which will wholed the magnet and place the sensor above the door frame, set it out so that when the door is opened, the magnet swings under the sensor, turning on the LED's. i think this is pretty cool, i will give it a try. cheers!
Sep 1, 2009. 9:42 PMalbylovesscience says:
that's convenient having lights turn on when you walk in or out
Sep 1, 2009. 8:36 PMLeonimuZ says:
Cool and cheap!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
8
Followers
1
Author:woody1189