Turning a light on and off with momentary switch

Discussion in 'Electronic Basics' started by Chris W, Feb 16, 2005.

1. Peter MichelsonGuest

That's great - thank you sincerely. It appears fairly simple and I look
forward to trying to implement it.

This is my first time reading a schematic in ascii, and it mostly makes
sense to me. My only question is what does "O" represent? For example,
there is an "O" next to CP1. Thanks for your patience.

Regards,
Peter

2. Peter MichelsonGuest

Thanks for the tip. I have used a 555 timer before, but I don't think I
ever used it as a one shot circuit, so I'd have to look that up.
Thanks - I think that's exactly the approach that John Fields took in his
schematic (see other posting in this thread).

3. Guest

Thanks - I think that's exactly the approach that John Fields
Yes, except for the extra transistors which will allow
much more current for brighter LEDs. If you hook the LEDs
directly to the 4017 with a resistor, you only get 2 or 3
milliamps. The extra transistor will get you 20 mA or more.

-Bill

4. John FieldsGuest

---
The 'O' is used to represent what's called a 'low true' input. That
is, a desired result occurs as a result of that input being at a
logical '0'. In this case, that's zero volts or 'ground'

The other "O"s (at the switch) are just a convention used to denote a
switch (or relay) terminal.

5. John FieldsGuest

---
Well, in all fairness, Bill's is better than mine in that he has a
single current limiting resistor as opposed to my three. Since only
one LED will be lit at any given time, there's only a need for one and
it can be connected from the common cathodes of the LEDs to ground.

He's suggested using a 555 to debounce the switch, but my simple RC
may work just as well. Depends on the switch's bounce
characteristics.

6. Rich GriseGuest

What's your goal here? To learn about flip-flops, or to turn a light on
and off? If the latter, just get a push-on-push-off switch. PCs used to
have them - it's a mechanical action, a la a clicker ballpoint pen.

Cheers!
Rich

7. Harold RyanGuest

Hi Chris:

The circuit that you want to build consists of three sections. (1) The
momentary switch must be connected to a debounce circuit. This will create
only one edge when the switch is closed or opened. This is accomplished by
using a resistor and a cap to create a lowpass filter and a buffer logic
device like a 'AND' gate. The secret is to use an additional feed back
resistor that creates hysteresis.

The second section is the flip-flop that is wired to toggle. U can use a
74HC74 D type flip-flop or even a JK flip flop. The 3rd section is the
decode logic. If you want to just toggle an LED then there is no decode
logic. Just connect the output of the flip-flop to an LED or thru an
additional buffer chip. If you want to have 3 LEDS to sequence, just add
another flip-flop and use a couple NAND gates to decode the two outputs of
the two flip flops to generate 3 outputs. Use 74HCXXXX chips because the
crossover threshold voltage is 5volts/2 or 2.5 volts.

Harold

8. Peter MichelsonGuest

Great explanation! Thank you for providing an architectural synopsis of
what's involved.
Peter

9. Peter MichelsonGuest

Yes, except for the extra transistors which will allow
That's helpful, since I do not yet know the operating characteristics of the
LEDs that I will want to use.
Thanks,
Peter

10. Peter MichelsonGuest

---
For me, there is educational value in seeing multiple approaches to the same
problem, particularly when someone explains the difference between the
various approaches, as you just did. So thank you.

Would you (or any other reader without commercial bias) please recommend an
inexpensive and reliable vendor for electronics parts for projects such as
this one? If such recommendations are not allowed on the newsgroup, please
feel free to email them to me.

Thank you,
Peter

11. Robert MonsenGuest

Here are my links to electronics distributors (US bias)

http://www.acroname.com/
http://www.allcorp.com/
http://www.alliedelec.com/
http://www.sciplus.com/?emailid=25
http://www.bgmicro.com/
http://store.yahoo.com/webtronics/index.html
http://www.componentkits.com/
http://www.elexp.com/
http://www.findchips.com/
http://www.futurlec.com/
http://www.jameco.com/
http://www.thelaserguy.com/index.html
http://www.mcminone.com/
http://www.meci.com/
http://www.mouser.com/
http://www.moyerelectronics.com/
http://www.mpja.com/
http://www.probemaster.com/
http://www.quickar.com/index.php?session=
http://www.goldmine-elec.com/
http://www.commlinx.com.au/timing.htm
http://www.electronicsurplus.com/
http://alltronics.com/wire_and_cable.htm
http://home.att.net/~wzmicro/index.htm
http://www.alltronics.com/
http://www.lsdiodes.com/5mm/
http://www.hosfelt.com/

I usually use goldmine or futurlec for hobby parts. They don't mind
small orders, and don't charge me sales tax (I'm in california)

You can also get samples of parts from distributors like microchip,
analog, linear, national, fairchild, etc.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.

12. Robert MonsenGuest

For another possibility, try this link:

http://home.comcast.net/~rcmonsen/flipper.GIF

I built a circuit nearly identical to this one, which I control with a
small 40MHz radio control. The main problem I have is that the radio
control (which I swiped from a toy car) gets occasional hits, which
trigger the device without warning. I have it hooked up to a large,
lighted, mechanical pink flamingo that my wife decided she needed (and
which was on sale for 1/2 price!). Thus, it goes on occasionally by
itself, which is actually kinda fun.

The circuit itself is really just an inverter flipflop, like this:

R1
___
.---------------|___|---------------------------.
| |
| U1A U1B |
| R1 |
| |\ ___ |\ |
'--------| >O---|___|----------o----| >O----o---'
|/ | |/ |
\ o |
S1 \ |
\. |
o |
| R2 |
| ___ |
o----|___|---'
|
--- C1
---
|
GND

(created by AACircuit v1.28 beta 10/06/04 www.tech-chat.de)

except the inverters are NPN common emitter amplifiers instead of
inverters. IF you close the switch for a moment, the inverter U1B
changes state, thus changing the state of the other inverter. If R2 >>
R1, then even when the button is pressed, it won't oscillate. The cap C1
must be large enough to allow the input of U1B to reach it's switching
threshold for long enough to switch, despite the action of R1.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.

13. Peter MichelsonGuest

Thanks for the list of resources, annotations, and candor regarding your
bias
Peter

14. Si BallengerGuest

The below LED chaser kit for \$6.50 would give you most of what
you want. A momentary push button, a 10k resistor and a 1uf
capacitor in parallel to ground for debounce should be sufficient
for manual operation instead of from the 555 timer.

http://www.allelectronics.com/cgi-bin/category.cgi?category=305&item=AEC&type=store
http://www.allelectronics.com/spec/AEC.pdf

15. Guest

Well, you could try Radio Shack, but they seem to have less and less

For mail order, I can think of three, but they may require a minimum
order.

www.digikey.com
www.jameco.com
www.mouser.com

Also, I have a few items for sale on my
website which may be of some use.

http://ourworld.compuserve.com/homepages/Bill_Bowden/sale.htm

16. Peter MichelsonGuest

That looks like a handy circuit that could be adapted to my application. I
might fiddle around with it and compare to the others. Thanks.

Do they sell any kits for this that include the mechanical pink flamingo?

Peter

17. Robert MonsenGuest

Sadly no. The R/C pink flamingo is destined to remain one of a kind.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.

19. Robert MonsenGuest

That is totally high class. The one I got was built out of pink mesh
screen. Only the neck and body move. However, it has several strings of
LEDs in it that flash on and off. It's eyes also flash, if I remember
correctly.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.