I've been wanting to install my ham radio in my vehicle for a while now, and I started to research options for using a master switch to turn on and off the radio. I planned on running the power for the radio directly to the battery, so I was thinking a relay to interrupt the power line to the radio was in order. I didn't want to use a switch to interrupt the power line since the radio is rated at 22 Amps on transmit, so the switch would likely look beastly mounted on my dash - so a relay it is!
Looking at the switches available to actuate the relay, I wasn't too impressed with the selection. I wanted something lighted when turned on and I certainly didn't want to put some 1986 looking switch in my dash.
Browsing the options on Amazon, I saw a series of momentary contact switches that looked great, but those wouldn't be very helpful with my project unless I had some kind of latching relay, or something to hold the relay closed.
All I did was dream about those momentary contact switches - they would fit in my vehicle perfectly. So, I ordered one... and started to look for a latching relay or even some kind of board that would control a relay with my new cool momentary contact switch. I really didn't find anything that I thought would work. The latching relays needed a pulse on another set of pins to unlatch the relay, and some of the boards I found had a built in relay that was too small and didn't have some of the capabilities I was looking for - mainly a clean and easy to connect package.
So, I decided to make my own.
Looking through a box of old integrated circuits I got from a friend of mine - KC9QLO - I decided to make use of one of these old 4017 decade counters - the exact chip I used to use when I made Knight Rider sequencing lights back in the 1980s.
The heart of the circuit is the 4017 decade counter chip. The 4017 is a counter that counts from 0 to 9. Once it hits 9, it restarts at 0 unless the reset pin is tied to an output before 9. The decade counter will turn each pin high (then low) in sequence with a triggered input on the clock pin. I tied output 2 (pin 4) to the reset pin, so that when the counter got to 2, it would immediately reset to output 0 (pin 3). There is nothing connected to output 1 (pin 3), so nothing turns on. Once a pulse (from the switch) occurs on the clock pin, the counter will then switch to output 1 (pin2) that turns on the relay. Again, pressing the button again would sequence it to the next pin (pin 4), but since that is tied to reset, the next sequence would go back to 0 (pin 3) and the whole thing repeats. What a waste of a decade counter that only counts to 2!
1) Because mechanical switches aren't perfect, and neither are us humans, as we start to push the switch, it might engage the contacts a couple of times before we get a steady push on it. Because the decade counter is very sensitive, that will move it forward a pulse or two, and create a situation where it appears erratic. One of the resistors and one of the capacitors acts as a "debounce circuit".
2) The other resistor (that connects to 12v) is called a pull up resistor. It is recommended to make sure you either tie the clock pin either high, or low (by connecting to ground via a resistor). In this configuration, the resistor presents voltage on the clock pin when the switch is not pressed. Once you press the switch, it closes the circuit and grounds the clock pin. Once you release the switch, it gives voltage back to the clock pin therefore sequencing the counter.
Wait a second here - I think we need some clarification on the second item above. Why wouldn't you just use a pull down resistor to bring the clock pin to ground when not in use, and then just make the switch introduce voltage to the clock pin to cycle the counter? That makes all the sense in the world, and I don't have a great reason for why I did it this way, but I thought it would be cool if the counter would sequence "on the release" of the switch. Doing the opposite (using the switch to introduce voltage to the clock pin instead of grounding it) would sequence as you started to depress the switch. Preference I guess.
The nice thing about this set up is that when you turn off the vehicle, if the voltage is connected to an accessory line, the circuit, and therefore the radio turns off. Also nice, is that when you turn the vehicle back on, the radio will continue to be off until turned back on again. If you don't think this is cool, then a latching switch is for you... certainly not a momentary contact switch.