Electronic – 555 timer one-shot 30 second light LED strip, TOTALLY CONFUSED!

555ledled striptimer

I'm working on a personal project and I am at my absolute whits end here. I have a configurable N.O. or N.C. switch (nteinc Magnetic Alarm Reed Switch) so I'm not too concerned with which way I use it.

My goal is as follows:
When the two parts of the switch are separated from each other an LED strip turns on for 30 seconds and then turns off until the switch pieces are brought together again and then pulled apart again at which point it would then turn on for another 30 seconds…repeat indefinitely.

What I've tried:
I've calculated that I'll be using 1Mohm resistor and 22uF capacitor to generate a 24.2 second pulse (which is close enough to 30 for me right now). I've attempted to hook up the following circuits

http://electroschematics.com/wp-content/uploads/2010/11/555-timer-positive-trigger.jpg

http://forum.allaboutcircuits.com/attachments/ne555-power-on-one-shot-png.38684/

and a few more this system won't let me link to
but they do not perform as expected and either only turn on/off the led strip by the switch without the timer or they run indefinitely..

Power Supply: 12v worth of AA batteries
LED Strip: 9-12v (preferably closer to 12v)
LED Strip: 30mA

I'm not entirely sure what I'm missing here but I would greatly appreciate an education as well as reference circuit. I think this has to be very common because it's almost like an intrusion alarm where if the window is opened an alarm sounds for a period of time so I'm not sure why I'm unable to get this to behave the way I want to.

Thanks in advance! You'll be saving my sanity here, I've been at this all day.

Best Answer

This will work for you:

Since you can configure your switch to be either Normally Open or Normally Closed, configure it (S1) so it's normally open, and when you push it closed the 555 will generate a 30 second long pulse which will light the LED for that time, no mtter how long or short the time you keep S1 made.

The 555 needs to see a low-going trigger pulse which stays low for less than the timeout period, and C1 differentiates the low generated when S1 pulls R1 down to ground into the short pulse the 555 wants to see on its trigger input.

R3 and C2 set the timeout period, which is 1.1 R3C2, and with a 20µF cap in there about halfway through the pot should get you the 20 second pulse you want.

C3 is the bypass capacitor for U1, and it's important that it be connected across U1 pins 1 and 8, and as close to the package as possible.

R4 and C4 comprise the POR (Power-On-Reset) circuit for U1 and, by holding the RESET pin momentarily low while the rest of the circuit is coming to life, it forces the 555 to power up in a known state and with the output low.

R5 is the ballast resistor for the LED strip, and drops the 555's output voltage enough to limit the current through the LEDs to about 30mA. That is, unless the LED strip has its own internal ballast, in which case R5 can be eliminated and the strip connected directly across the 555's output and GND/0V.

BTW, here's the LTspice circuit list so you can simulate and play with the circuit if you want to.

enter image description here