Page 1 of 1

replace SPDT with button and indicator

Posted: Fri Nov 03, 2017 9:36 am
by FoG
Yes, in advance I am a total noob, and I have tried to find this information already. My goal is to replace a single pole double throw switch with a temporary push button circuit. Press once to toggle from one option or the other (also intend to put dual color LED in to show what option is selected). If there is a resource that could help me figure out how this is supposed to work, I would greatly appreciate a point in that direction.

Many thanks in advance,
FoG

Re: replace SPDT with button and indicator

Posted: Sat Nov 04, 2017 4:11 am
by theropod
Hey,

If you are planning on driving this application with an Arduino it is a simple thing.

Your code should look to turn on an output pin when the first button push is enacted. When the second button push is encountered that pin is turned off and a second output pin is activated. The loop would constantly be “looking” for that pushbutton input. You would probably be best served to drive those output pins by using the analog input pins. A couple “if-else” condition statements should take care of your needs.

Basically what you would be doing is creating a software (sketch) environment to emulate a latching relay. If you are not interested in using an Arduino a latching relay could be used, but could be more power hungry and rely on mechanical means to achieve your goal.

Make sense?

Re: replace SPDT with button and indicator

Posted: Tue Nov 07, 2017 8:37 am
by lyndon
Simplest way is to use a 4017 counter with the pushbutton on the Clock input and your LED on the Output 0 output. Connect RESET to ground and Enable to +5V. Each button press toggles Output 0 on and off.

Re: replace SPDT with button and indicator

Posted: Wed Nov 08, 2017 4:27 am
by theropod
Excellent use of the decade counter!

I think the OP wanted a single push button to select one of two conditions, unless I read it wrong. This would just require two output pins from the 4017, with self reset enabled, and use the pulse to the counter from the push button to toggle back and forth between option “A” or option “B” driven by the counter (and drive components for larger loads).

Hmm, multiplexing input to Arduino! Hadn’t even thought of using these devices as external inputs. Variable frequency inverter driver?

Re: replace SPDT with button and indicator

Posted: Wed Nov 08, 2017 5:48 am
by theropod
Alternatively a simple flip flop circuit could do this, like a 4013. An either-or state is what flip flops do.

http://www.learningaboutelectronics.com ... ircuit.php