Go Down

Topic: complete a circuit (Read 706 times) previous topic - next topic


hi guys .

i need to the code in the arduino to close and open a switch during certain parts of the code,

my plan is to use a digital out, connect it to the pin of the switch that goes to ground when pressed, then when i send the pin LOW it should act like its been grounded,

the arduino and the external board can share ground im sure,

question ,
is this safe or am i going to send showers of sparks everywhere?

if its not safe, how can i safely do it using normal components found in a parts bin ?

i need the solution to be cheap because  i may need to integrate two ro three switch controls, and dont want to pay tons for each ,

thanks in advance


What holds the pin hi normally that you want to ground?
If you don't know: Safest way would be to use a transistor to pull the pin low.
Arduino output pin to 270 ohm resistor to base of NPN transistor, emitter to Gnd, collector to the switch pin.

Connect all grounds in common.
Or use an optoisolator if the grounds must be separated.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


The Opto is the Ideal solution... 2 resistors 1 opto, some wire = Problem solved @3.00 for 1 input and about $1.00 ea for expansion BTW a P2504 is a 4 section opto that is REAL easy to use... P2501 2 - 4 for 1, 2. 4 Channel all in one small package P2504 is a 16 pin package and is available in Small Outline (SO) SMT packages

--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard


What voltage and current are you wanting to switch?  AC or DC?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


if i can find a cheap opto then i will go with that,

but i have a ton of old transistors kicking about here, it would be good to use them,

the switch is just a push to make switch, as far as im aware it isnt controlling any high amps or voltage,

i may want to control five switches in total in the future, so the cheaper the solution the better, i will check out the recomendations later,


Go Up