Pages: [1]   Go Down
Author Topic: complete a circuit  (Read 525 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 0
Posts: 323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26473
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Doc
Logged

--> 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

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What voltage and current are you wanting to switch?  AC or DC?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Sr. Member
****
Karma: 0
Posts: 323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,

thanks,
Logged

Pages: [1]   Go Up
Jump to: