basic timer for led's - Page 1
Forum section: electronics / beginners

author: redline
author_rank: Newbie
timestamp: February 15, 2013, 03:40:24 am
content: So i thought i would come ask the experts.I am after a simple and as cheap as possible 'timed' light circuit.The rundown is I am playing with Kids ride on electric cars running on 6v and 12v (maybe more when she can handle the speed) sealed pb batteries. I would like to play around with adding headlights etc but i know my daughter is going to leave them on so would like a momentary switch that will turn the lights on for a few minutes then turn off again. I have seen the jaycar kits and a number of others similar but they are all designed for much larger projects than this and as such have big relays etc.Coming from an Radio control project background i have a UBEC like this (http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idproduct=30282) which should be useful in giving me a stable 5/6v supply from my main battery. Ideally something with a number of different time settings but if i have to swap components to do that then its not the end of the world.Closest I found was this :http://www.paia.com/KRUKits/K141/K141.pdfWhich seems to have the required function in its 'mode 2' but again is excessively complex and costly for the job.Id love a DIY kit to solder up myself but its looking more likely to find a schematic somewhere and source the components.Any ideas?

author: dr_p
author_rank: Frequent Contributor
timestamp: February 15, 2013, 06:47:44 am
content: http://lmgtfy.com/?q=simple+delay+timer

author: redline
author_rank: Newbie
timestamp: February 15, 2013, 11:02:02 am
content: lol ... it would appear the i was using the wrong wording to get the right googlesthanks

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 15, 2013, 12:04:31 pm
content: If you're new to electronics then this is actually a great excuse to design the circuit yourself as opposed to using something you find on the web. You'll learn more and it will be more rewarding (assuming you can get the circuit to work.)You might start with a 555 timer IC and design your circuit around it. You can achieve the selectable delay by either 1) using a potentiometer in the 555's RC circuit or 2) using a single pole/multi-throw switch to switch in different resistor values for the 555's RC circuit.Your momentary push button switch could control the 555's RESET# and TRIGGER# signals based on the state of the 555's OUTPUT signal. This would allow the switch to toggle the output state when pressed. This part might be a little tricky since you'd likely want to handle key bounce and might need to register the control signals to prevent them from oscillating (this would happen since they control the OUTPUT signal but are also dependent on it.)

author: AndyC_772
author_rank: Super Contributor
timestamp: February 15, 2013, 12:32:02 pm
content: No need for a 555, I have a circuit that can do this in 3 transistors and a few passives. Will post it when I get time.

author: smashedProton
author_rank: Frequent Contributor
timestamp: February 15, 2013, 03:01:59 pm
content: You should use an mcu and a ds1307

author: MikeK
author_rank: Super Contributor
timestamp: February 15, 2013, 04:22:31 pm
content: Quote from: smashedProton on February 15, 2013, 03:01:59 pmThe MCU can do an RTC quite easily in software. I never use RTC chips anymore, they're just added expense.

author: AndyC_772
author_rank: Super Contributor
timestamp: February 15, 2013, 07:16:19 pm
content: Have a look at the third circuit on this page:http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switchThis is a circuit which uses a simple pushbutton to toggle the output on and off. It's easy to add a timeout feature with a third transistor.Connect another N-channel FET as follows:Source to GNDDrain to the gate of the N channel FET in the existing designConnect a 1 MOhm resistor between the output of the circuit and the gate of the new FET, and a large capacitor between the gate and GND. The value of this capacitor governs the ON time. 1000uF will give about 2 to 3 minutes.Finally, connect a diode across the resistor, with the anode connected to the gate and the cathode connected to the output of the circuit.

author: smashedProton
author_rank: Frequent Contributor
timestamp: February 15, 2013, 07:31:09 pm
content: Wait what? How do I do RTC in software? Won't the data get wiped on reboot? Is the power consumption worse?

author: MikeK
author_rank: Super Contributor
timestamp: February 15, 2013, 08:02:16 pm
content: Don't all RTC's lose data on reboot?I have not done a power consumption comparison.The algorithm is simple for keeping track of seconds, minutes, etc:http://romanblack.com/one_sec.htmIf you need time-of-day (not just elapsed time) and calendar functionality then, yes, you need to set the time after the MCU is powered on.We can start another thread if you want to talk about it so that we don't hijack this one.

author: w2aew
author_rank: Super Contributor
timestamp: February 15, 2013, 08:27:55 pm
content: If it's a ride-on toy, then why not mount a momentary switch under the seat? That way the lights won't come on unless they're in the seat.

author: smashedProton
author_rank: Frequent Contributor
timestamp: February 15, 2013, 08:40:28 pm
content: Put a stun gun in the seat while you are at it

author: redline
author_rank: Newbie
timestamp: February 16, 2013, 02:48:21 am
content: Quote from: w2aew on February 15, 2013, 08:27:55 pmNow that is an excellent idea. Much simpler! thanks

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 17, 2013, 02:23:30 am
content: Well, you guys are no fun. Maybe I just like to make things too complicated.Here's a circuit based on my idea. I don't know if it will work or not. As usual when I design a circuit, out of the thousands of parts I have on-hand, I don't have what I need to build and test it.Some of the part values are yet to be determined. I used 4000B-series ICs so that the circuit can operate over a wide voltage range.

author: dr_p
author_rank: Frequent Contributor
timestamp: February 17, 2013, 11:50:56 am
content: is it me or you're using 4 ICs and a dozen passives instead of one transistor?

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 17, 2013, 12:10:14 pm
content: Heck, if you like that circuit you should checkthis oneout. It uses about 30 ICs when just one MCU will do.Trust me, I'm the type who would solve every electronics problem with a MCU but I like to play around with discrete logic. There's something rewarding about building state machines from ICs, I guess.

author: AndyC_772
author_rank: Super Contributor
timestamp: February 17, 2013, 03:46:53 pm
content: With due credit given to the original source (in my previous post), I still prefer this circuit - a simple switch toggles the lights between off and on, and when they've been on for a couple of minutes the large cap charges up to the gate threshold voltage of the N-FET and causes them to go off again.

author: redline
author_rank: Newbie
timestamp: February 18, 2013, 02:43:55 am
content: where do you guys buy small numbers of componants. Been dropping in to jaycar when i only need a couple bits cos most of the places online have a minimum order quantity or minimum postage cost?

author: dr_p
author_rank: Frequent Contributor
timestamp: February 18, 2013, 07:26:09 am
content: I made some calculations I was grossly overpaying just because I bought small numbers and ordered just what parts I needed for one specific project.What I did is stock up on resistors(20-100pcs each of 1/4W, some power ones), caps(ceramic, tantalum, electrolytic, low ESR), general purpose transistors(PNP, NPN, N-FET, P-FET), diodes (signal, rectification, switching), leds, voltage regulators, some ICs(555, op-amp, mcu, EEPROM, comparators, logic gates, SMPS controllers) etc.Then when I need something and it's not critical, I write it down and wait until there are 4-5 parts I need. Then order 2-3-10 more than I need (of each) , so that I will not need those parts any time soon.And with every order or any chance I have, I restock on "passives" or any component I find interesting and usefull to have.