Please help with my switch circuit. Electronics newby

Thread Starter

alb10811

Joined Aug 29, 2017
15
Hi I'm trying to design a circuit that switches between a manual button push to activate a relay and an ardunio output. I can do that fine however I want to add two LEDs to incate which output is currently selected. I need an LED to light up constantly if the switch is on the arduino but not to trigger the relay unless there's an output from the arduino. The circuit below just lights everything up regarless of which side the switch is on when there is an ouput from the arduino. Is there anyway to fix this?

1698368874241.png
 

Attachments

Last edited by a moderator:

Thread Starter

alb10811

Joined Aug 29, 2017
15
I just added a piezo in place of the relay. It's just how I have the breadboard set up for testing. The relay is not important to the problem. Without the Arduino side LED it all works as wanted, I just can't figure out how to put a LED indicator light in that shows that it's switched to Arduino not manual.
 

dl324

Joined Mar 30, 2015
16,679
I want to add two LEDs to incate which output is currently selected
I only see one Arduino output being used.

Your schematic would be easier to read if you didn't have so many unnecessary wire crossings and you made the flow primarily from left-to-right and top-to-bottom.

What are the batteries powering? Why aren't the negative terminals for both connected to the Arduino ground?
 
Last edited:

Thread Starter

alb10811

Joined Aug 29, 2017
15
Yes there is only one Arduino output being used however when I can figure this problem out it will be used with an 8-board relay and 8 outputs will be used. I have programmed the Arduino to give a timed output sequence. With the piezo instead of a relay it could play a tune for example or I can switch it to manual and the piezo will sound constantly. This all works. The only thing I can't figure out is how to put an LED that lights up when the switch is switched to the Arduino. I have an LED that lights up when power is supplied to the common pin of the switch however I can't figure out how to have a 2nd LED light up constantly when the switch is switched to the Arduino. Currently, it works however if the switch is switched to manual and the Arduino gives an output both lights light up however the 2nd LED shouldn't because the state of the switch is not on the Arduino. Does this make sense?
 

dl324

Joined Mar 30, 2015
16,679
Does this make sense?
Not really.

It would be best if you drew a truth table showing all of your inputs and the desired LED state for each combination.

In your schematic, with the switch in the up position, LED1 is on. Do you want LED2 to be on when the switch is in the down position?
 

Thread Starter

alb10811

Joined Aug 29, 2017
15
The switch is an ON, ON, OFF latching button. In the first position (Manual) the first LED lights up because power is being supplied to the common pin. In the second position (Arduino) the first LED only should light up when power is supplied by the Arduino output pin. With the switch in this position, the second LED also lights up because the switch is in the second position. In the third position OFF both LEDs are off because no power is supplied. This all works until the Arduino supplies power via the output pin. When this happens both LEDs light up even when the switch is in the OFF position. This is what I need to fix if it is possible.
 

dl324

Joined Mar 30, 2015
16,679
The switch is an ON, ON, OFF latching button.
What does this mean? Push button switches are generally ON or OFF. They can have 2 throws (a normally open and a normally closed contact), but the switch only has 2 positions. I have some that are alternate action, but the switch still only has two positions: depressed or not depressed. You showed a switch with two positions.
 

MisterBill2

Joined Jan 23, 2018
17,800
If the switch is only to select one of two input sources, arduino versus a push button, and the LED is only to indicate switch position, then the trivial simple solution is a double pole switch, with one side doing the election and the other pole/side controlling the indicator LED. Simple, consumes no extra power and uses no additional components. Also easy to wire.
 

dl324

Joined Mar 30, 2015
16,679
SPDT switch with ON, ON, OFF. I've made a video, this is the link
The video didn't help because I can't tell what's going on with the switch presses. Do you have a part number for the switch, or a datasheet you can upload?

This is how C&K describes one of their pushbutton switches:
1698418108801.png

The 8161 switch is an alternate action. The other is a more typical pushbutton switch. It can also be described as ON-(ON). With the parenthesis indicating momentary action.
 
Last edited:

Thread Starter

alb10811

Joined Aug 29, 2017
15
The video didn't help because I can't tell what's going on with the switch presses. Do you have a part number for the switch, or a datasheet you can upload?

This is how C&K describes one of their pushbutton switches:
View attachment 306021

The 8161 switch is an alternate action. The other is a more typical pushbutton switch. It can also be described as ON-(ON). With the parenthesis indicating momentary action.
To drive the indicators separately you need a DPDT switch, that is two sets of contacts.
The video didn't help because I can't tell what's going on with the switch presses. Do you have a part number for the switch, or a datasheet you can upload?

This is how C&K describes one of their pushbutton switches:
View attachment 306021


To drive the indicators separately you need a DPDT switch, that is two sets of contacts.
Yes that will resolve the problem, thank you so much.
 
Top