Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Tools
Old 31st October 2009, 04:04 PM   #1
Default Switching between two LEDs

Hopefully, this should be simple for you gurus! I need help designing a curcuit on a breadboard that switches between two different colored LED's operated with a momentary switch. I also need a 1 second delay between the transition. I would appreciate any help.

Thanks
Netguru5 is offline  
Old 31st October 2009, 04:48 PM   #2
Default

I'm not a guru, an one of them here may give you a better solution but if you explained yourself well this can help you.

With a JK FF, you can achieve that. You would need a 1Hz (your 1 second delay) "clock" and the two inputs to a HIGH level, and then your FF will toggle, you will have one LED in each output, and then it will toggleand switch your LEDs, I think that's what you're asking for.
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein
Karkas is offline  
Old 31st October 2009, 05:26 PM   #3
Default

Karkas,

Thanks for the reply, this may be exactly what I need. I had one more question on the flip-flop since I've never actually played with one. If I set the Hold state, will it hold that state when the power is removed? And does it hold the state until the reset command?
Netguru5 is offline  
Old 31st October 2009, 05:36 PM   #4
Default

The power removed? you mean turning off the supply?
For that application you won't be able to use the reset command, because it is with J=0 and K=1, and for toggling, you need the two inputs to be high,
If mean by that clearing the FF, they have the input CLR.

this is a link for the datasheet to a positive edge triggered JK FF.
http://pdf1.alldatasheet.com/datashe...74ALS109A.html
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein

Last edited by Karkas; 31st October 2009 at 05:37 PM.
Karkas is offline  
Old 31st October 2009, 05:59 PM   #5
Default

Quote:
Originally Posted by Karkas View Post
The power removed? you mean turning off the supply?
For that application you won't be able to use the reset command, because it is with J=0 and K=1, and for toggling, you need the two inputs to be high,
If mean by that clearing the FF, they have the input CLR.

this is a link for the datasheet to a positive edge triggered JK FF.
DM74ALS109A pdf, DM74ALS109A description, DM74ALS109A datasheets, DM74ALS109A view ::: ALLDATASHEET :::
Yes I mean turning off the supply, I should have been more clear. To be more clear, here is the desired function.

* Power supply comes on and LED1 is Lit.
* Momentary switched is engaged
* LED1 goes OFF
* 1 second delay
* LED2 is lit
* Momentary switched is engaged
* LED2 goes OFF
* 1 second delay
* LED1 is lit

I woud also like to retain which LED was last lit when the PS is turned off, then back on.
Netguru5 is offline  
Old 31st October 2009, 06:54 PM   #6
Default

Well now that you put it that way then is not that easy, at least for me.
FF doesn't do that exactly, the JK FF toggle between the two states but they don't have an indefined state, I mean a OFF state, unless you pull LOW the CLR input, maybe you this will work. I haven't tested It but it's an idea:
Look up, 555 astable configuration, and design it for the TL to be 1 sec. and the TH to be the time you want it to be, and do that I said but besides connecting it to the clock input, connect it to the CLR input, so when it goes LOW for 1 sec. it will CLR the FF, and it will give you a 0 in the two LEDs, and when the other rising edge comes, maybe it will toggle, by maybe I mean that I think that once you clear it, it will start over a Q High, and will never toggle.

About that of turning off the PS, I don't think any device will keep working without the power supply.
About retain that last LED, taht where gurus come in.

I'm sorry if that doesn't work, it turned harder than it looked in your first post.
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein
Karkas is offline  
Old 1st November 2009, 12:07 AM   #7
Default

Netguru5,

I've attached a circuit that should do the job. The left part is a toggle flip-flop, the right part is the 1second (approx.) delay-on (no delay off).

LEDs are driven from the input supply voltage, the schmitt trigger inverters are supplied power from a capacitor (I said 1F, but smaller values will work depending on how long the main supply will be removed for) which will allow the state to be remembered when the power is switched off. The inverters must be CMOS type or they will draw too much power when the supply is removed and won't remember the state on power up. Also, no guarantees which LED will light on the first power up; although I've my bets on LED1.
Attached Files
File Type: pdf TOGGLE.PDF (33.9 KB, 22 views)
dougy83 is offline  
Old 1st November 2009, 07:58 AM   #8
Default

Hi Netguru5, the solution by Dougy83 looks simpler, if you want you can try this, here you can design the time you want the LEDs to be on, and the 1 sec. delay is exactly designed with those components, it will give 0.99 sec, the transistor in the CLOCK will invert that signal, so when the time delay goes high, it will be a LOW in the CLOCK and when it goes LOW after that 0.99 sec. the transistor will send the rising edge that will turn on the other LED.
That should do what you need, the first two images are the explanation of how is that going to work, and the last is what you need, it will also remember the last LED on turn on, but by turnin' the opposite when you turn on again, you won't exactly remove the power supply but by moving on and off that switch, and by the way, when you turn it off the on LED won't turn off instantly, it will be on for the time you programmed it, and then the other LED won't light.

It is not complicated, and not as big as it looks, by doing 1.1*C*R you will have the time ON of the monostable multivibrator, that will light the LEDs.
Attached Thumbnails
Switching between two LEDs-555monostable.gif   Switching between two LEDs-wavforms-triggering-555.gif   Switching between two LEDs-para-netguru5.gif  
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein
Karkas is offline  
Old 1st November 2009, 08:42 AM   #9
Default

Sorry Karkas, I can't see how your circuit will work. You've tied the 2 outputs of the 555s together. If that wasn't the case, the LEDs would only light for a second after the change of state and then stay off. The clocking to the FF (and the feedback from the rightmost 555) also looks a bit sus...sorry I don't mean to be negative; just have another look at your circuit.
dougy83 is offline  
Old 1st November 2009, 08:55 AM   #10
Default

I haven't tested it yet but see, When the switch is closed, there is a positive edge at the clock, and that sets the FF, setting it means that Q* is low and because of the rrangement of those two resistors and the cap, thar 555 can be triggered, and it will last as long as Netguru design it, when it falls LOW, the right-most 555 is triggered, and it will last aproximately 0.99 sec. and that will inhibit the CLOCK, once that 0.99. sec are over, there's another rising edge at the CLOCK, and that will RESET the FF, doing the same thing in the opposite LED, did you see it?
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein
Karkas is offline  
Old 1st November 2009, 09:09 AM   #11
Default

I think Netguru is after a 1 second delay between the transitions of one LED going off to the other coming on; the LED then stays on indefinitely until the switch is pushed again.

The FF clk pin is not held at a defined voltage - perhaps a pull-down resistor is warranted? Also, check the two 555s on the left - are the outputs supposed to be connected together?
dougy83 is offline  
Old 1st November 2009, 09:16 AM   #12
Default

No, That's a mnostable multivibrator it won't be on undefinitely, none of them, and yes the two outputs are supposed to be connected together, because the third 555 needs the two falling edges to be triggered, that transition is between the two LEDs,
I'm maybe it won't work, but if it doesn't I don't think it will be for the cuases you're saying, no offense.
I'm sorry but tell me something, isn't that 10K resistor a pull down when the transistor is cut-off?
I'm not sure about that.

If you don't mind, I wouldlike to see how yours work, not because I don't see it will, but because I'm not that experienced.

Thanks.
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein

Last edited by Karkas; 1st November 2009 at 09:17 AM.
Karkas is offline  
Old 1st November 2009, 09:45 AM   #13
Default

Quote:
Originally Posted by Karkas View Post
No, That's a mnostable multivibrator it won't be on undefinitely, none of them, and yes the two outputs are supposed to be connected together, because the third 555 needs the two falling edges to be triggered, that transition is between the two LEDs,
Having the 2 outputs connected together will mean that both LEDs will always be displaying the same state. To get the 3rd 555 to detect a falling edge from either of the 1st or 2nd 555s you could use a diode from pin 2 of the 3rd 555 to the output of each of the 1st & 2nd 555s (note 2 diode in total) - this will isolate the outputs of the 555s from each other and the 3rd 555 will then get the falling edge of either output.

Quote:
Originally Posted by Karkas View Post
I'm sorry but tell me something, isn't that 10K resistor a pull down when the transistor is cut-off?
The 10k is connected inline with the switch and won't be in-circuit until the switch is pressed. Perhaps the leakage through the transistor will pull the clock down when the switch is open, I don't know.

Quote:
Originally Posted by Karkas View Post
If you don't mind, I wouldlike to see how yours work, not because I don't see it will, but because I'm not that experienced.
I can't find a good description of how the inverter FF works, but the circuit and a description are available here:
Simple Toggle Touch Switch Using Two Inverter Gates | Free Circuit Diagram

The LED drive circuits are the same, but driven from opposite-state signals; the resistor and capacitor delay the turn on of the gate, while the turn off time is much less due to the capacitor being discharged through the diode.
dougy83 is offline  
Old 1st November 2009, 09:55 AM   #14
Default

Yes you're right, the two diodes are necessary, well, I don't think it is necessary to put them on the picture, unless Netguru doesn't understand how to put them.

But tell me, a pull down resistor isn't the opposite of a pull up? I mean the pull ups are put in the outputs to make sure the desired output is given and that output is not in a floating state, what's the differenec between them and the pull down?

I though you had designed it. I'll check your link, thanks.

Sorry for the lot of "outputs"
__________________
"A person who never made a mistake never tried anything new"
Albert Einstein

Last edited by Karkas; 1st November 2009 at 09:56 AM.
Karkas is offline  
Old 1st November 2009, 10:30 AM   #15
Default

Quote:
Originally Posted by Karkas View Post
Yes you're right, the two diodes are necessary, well, I don't think it is necessary to put them on the picture, unless Netguru doesn't understand how to put them.
He is more clever than me for assuming that; I didn't mean to state the obvious.

Quote:
Originally Posted by Karkas View Post
But tell me, a pull down resistor isn't the opposite of a pull up? I mean the pull ups are put in the outputs to make sure the desired output is given and that output is not in a floating state, what's the differenec between them and the pull down?
a pull-up usually pulls an input high; a pull-down usually pulls an input low. It keeps the input in a defined state when it's not being driven by another source. The 10k resistor inline with the switch in your circuit does nothing until the switch is turned on.

Last edited by dougy83; 1st November 2009 at 10:31 AM.
dougy83 is offline  
Reply

Tags
leds, switching

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
switching chandu13 Micro Controllers 19 15th September 2008 11:40 PM
Switching Between Different Color Leds synergy General Electronics Chat 1 2nd September 2008 03:21 PM
Switching LEDs skeeterb Electronic Projects Design/Ideas/Reviews 17 12th January 2008 03:05 PM
switching a block of LEDs with a PIC? Andy1845c Chit-Chat 16 26th March 2007 07:47 PM
LEDs-Super Bright White LEDs $1.35USD ea ssullivan777 Datasheet/Parts Requests 0 27th February 2003 03:02 AM



All times are GMT. The time now is 05:35 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker