Momentary switch to latching switch

dudewth

[H]|G Minecraft Division Leader
Joined
Jul 13, 2002
Messages
1,976
I'm trying to make a momentary switch function like a latching/locking/on-off switch. I've seen a few examples of circuits online and am about to start trying some out. Most of my choices are here: http://www.cpemma.co.uk/flipflop.html

Before I go and do this I wanted to find out if anyone knows of something prebuilt that I could use for this function.

I basically have a momentary switch and want to power 2 LED arrays plus the switch's indicator lamp with a 12v source. The current draw will be at most 1A for all 3 functions combined.

Thanks for your help.
 
Toggle latching relays that trigger from a momentary signal do exist but are typically oriented towards industrial use and are designed and priced accordingly, putting them out of reach for a simple project like this. I can't think of any other low cost prebuilt alternative. Those circuits you linked are not hard to build and do work well, I would suggest they are the best solution. #2 or #3 (with the settable startup state) would probably be the better ones.

It is possible to use two inexpensive relays (like you could get at RatShack or surplus houses) and build a relay flip-flop circuit, but that would still probably cost more than the electronic parts for the circuit above, and be cumbersome to mount for a pc mod. Nonetheless, check out page 9 of this 4 bit relay counter pdf. I'd like to build a larger version of that one day if I find a good source of cheap relays ;)

edit -

I still think the electronic versions are better suited, but if you don't mind a surplus monster like this (the momentary button would be switching low amperage line current)...
 
Thanks for the links, that's more than I could find. You're right about the pricing of that first latching relay, I'd prefer to spend a little less. :p

I'm leaning towards #3 from the link. I've used 555's before, they're simple enough. I'll definitely let you know how it goes.

That 4-bit counter looks like something I did back in school. I've been working on just computers too much! I haven't looked at a circuit in 4-5 years now. It's sad how much I have to go back and read to refresh my memory. :eek:
 
Is there a reason you couldn't just use a push-button on-off switch like this? It's only $2.58, and would save you a lot of time and effort. Or are you looking for something else?

 
Is there a reason you couldn't just use a push-button on-off switch like this? It's only $2.58, and would save you a lot of time and effort. Or are you looking for something else?
I nearly suggested the same idea, but I was thinking he probably has something like an illuminated Bulgin or similar....
 
Is there a reason you couldn't just use a push-button on-off switch like this? It's only $2.58, and would save you a lot of time and effort. Or are you looking for something else?
That's my last resort. If I can't make the switch I already have latch, then I'll be doing exactly what you pointed out.

I nearly suggested the same idea, but I was thinking he probably has something like an illuminated Bulgin or similar....
Close, but not quite. :eek:

This actually isn't for a computer application. It's for my car. I want to keep the look completely OEM and the switches that are in the car are all momentary. This is the switch I bought:
s4switch.jpg


and it will be going between the passenger airbag light and the hazard switch here:
s4interior.jpg


The S on the switch will light up red when the LEDs are on (that's the plan at least). The lighted S is supposed to be background illumination, but I wanted a switch without an LED indicator. Plus that S switch is from the RS4 and I've take a decent number of queues from it.
 
If this is for a car, there are additional considerations.... Car power is not friendly to electronics; it's full of noise and spikes that can reach nearly 100V. Without some changes to the component values and some protection diodes, the circuits discussed above might not work properly or last very long.

I'll see if I can find some relevant links regarding all this...
 
I've never tapped power from another source in my car, so I've got a few questions. Hopefully someone can help me with them.

I plan on using some kind of inline fuse just in case anything goes wrong with the circuit, anything wrong with that?

Also, do you think I should try to avoid a constant 12v line? I'll be measuring current once I get this going (I have a 12v battery to test it out) but I'm not sure how accurate that will be. A small current over a long period of time could get me. I think there are some sources that are on only when the engine is on, but I'd have to do some research to find where they are.
 
If this is for a car, there are additional considerations.... Car power is not friendly to electronics; it's full of noise and spikes that can reach nearly 100V. Without some changes to the component values and some protection diodes, the circuits discussed above might not work properly or last very long.

I'll see if I can find some relevant links regarding all this...
Thanks, this is exactly the information I was needing.
 
I've never tapped power from another source in my car, so I've got a few questions. Hopefully someone can help me with them.

I plan on using some kind of inline fuse just in case anything goes wrong with the circuit, anything wrong with that?
At the very least, you'll want a 12V regulator, followed by a good-sized capacitor, to power the circuit. Make sure the regulator is rated to take an input voltage of well over 100V, and get it in a large enough package so that you can put a small heatsink on it. The fuse can only protect against over-current, not over-voltage.
 
If I tap a fuse in my fuse box, will I have to worry about regulating the voltage? You'd think that the voltage/amperage being provided to other components in the car is somewhat stable. Or at least you'd hope so. I'm guessing there's an unused fuse in the box that I could hopefully use if needed.

I'm really just trying to avoid the voltage regulator because it's just going take up more space! If I want a 12v output from a regulator, then I'll need around a 14v input. I'm not sure where I'd get that either. In that case there would be about 2W of heat, so I'm not sure if I'd still need a heatsink. I'm really hoping that tapping a fuse from the fuse box or something like that would allow me to not have a regulator.

edit: redid the end, wasn't right.
 
A fuse won't protect your circuit at all from over-voltage. A fuse protects from over-current, mostly to prevent the wiring from melting or catching on fire if there's a short.

You'll actually get around 14.4ish volts from your alternator--that's the charging voltage from your battery. It's called "12V" because your battery produces about 12.6V at full charge. So you'll have enough voltage to power your circuit.

 
A fuse won't protect your circuit at all from over-voltage. A fuse protects from over-current, mostly to prevent the wiring from melting or catching on fire if there's a short.

You'll actually get around 14.4ish volts from your alternator--that's the charging voltage from your battery. It's called "12V" because your battery produces about 12.6V at full charge. So you'll have enough voltage to power your circuit.


Right, so if I get my power from the fuse box I still have to worry about voltage spikes? I was basically hoping that there was already some sort of over-voltage protection in place before the fuse box that would help me eliminate the need for a voltage regulator. If not, then I'll still hook up some sort of regulation.

Someone else suggested a resistor, capacitor, zener diode as long as I could afford the voltage drop.
 
Right, so if I get my power from the fuse box I still have to worry about voltage spikes? I was basically hoping that there was already some sort of over-voltage protection in place before the fuse box that would help me eliminate the need for a voltage regulator. If not, then I'll still hook up some sort of regulation.

Someone else suggested a resistor, capacitor, zener diode as long as I could afford the voltage drop.
You're correct--you still have to worry about voltage spikes.

Okay, I've started looking at some datasheets, and here's what I've found:
1) 12V linear regulators require at least 14.5V supply voltage, so that's out.
2) You can get J/K flip-flops that will reduce the complexity of the switching circuit considerably. The only problem is that they all seem to run off 5V. This is good news and bad news at the same time.

So here is my suggestion:
1) Get a J/K flip-flop and a 5V regulator. Power the flip-flop with the regulator and toggle it with the switch you have.
2) Since you're powering LEDs, you've got some flexibility on supply voltage. I would suggest that you get a 10V regulator to supply voltage to your LEDs.
3) Take the output of the flip-flop and run it to the gate of an nMOS, which will switch the 10V on and off for the LEDs.

Does that all make sense?

 
Yes, it does make sense. That's a whole new approach, I'll have to fully think it through now. :eek: Thanks for your help!
 
I would suggest this:

http://www.atmel.com/dyn/resources/prod_documents/doc4771.pdf

Unfortunately the only source I could find was http://www.arrownac.com, and the only version of the chip in stock is the one is the SOT8 package... SMD soldering anyone?

I find it odd that there isn't a "black box" device like this in the Automative Aftermarket area with all those LED/neon lighting accessories that are out there.
Wow, that's awesome. Just need to find it now! It looks like I can get it from digikey...but the minimum order is 2800. :eek:
 
Right, I was hoping for one in a DIP package.
I tried to order the U6032B SO8 from Arrow. I figured I could just use an SO8->DIP adapter worst case. They replied telling me that those are only sold in reels of 4000. So that didn't work. I'm just going to stop looking and try my other options. Thanks for the help.
 
Back
Top