Pages: [1] 2   Go Down
Author Topic: Virtual switch  (Read 2222 times)
0 Members and 1 Guest are viewing this topic.
Los Angeles, CA, United States
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a camera flash that is triggered by putting two wires together. Is there any way to trigger that by plugging the wires into my arduino duemilanove and typing something into the serial monitor? It will need to be triggered my a left mouse click.
Logged

C program run. C program crash. C programmer quit.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

Yes.
See the Learning or Playground section for accepting Serial input.
Use a relay like this to close the contacts
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=PB1110-ND
http://media.digikey.com/pdf/Catalog%20Drawings/Relays/FX2%20RELAY%20NON%20LATCHING%20FTPRNT.jpg
Connect one side of the Coil to +5V (Pin 1), the other (Pin10) to one side of a 15 ohm resister, the other side of the resister to an arduino output pin that you will drive low to energize the relay (and you may not need the resister, but start with it). Put a diode across pins  1 (cathode) and 10 (anode) to voltage spikes away from the arduino pin
(such as http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=1N4004FSTR-ND).
Connect pins 4 & 5 to your contacts.
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.

Los Angeles, CA, United States
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there anyway I can do this all without external hardware?
Logged

C program run. C program crash. C programmer quit.

Los Angeles, CA, United States
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All I need to do really is touch two wires together momentarly. The problem is it is needs to be triggered by a left click as the program I am using converts sound into a left click
Logged

C program run. C program crash. C programmer quit.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

The arduino does not have isolated pins that allow you to connect external signals together.
Without knowing what the two wires have on them for voltage and how much current flows when connected, the best you can do is an external part to keep from blowing out the arduino.
Do you have a multimeter? Can you make some measurements on the pins? Is there a ground that the arduino ground can connect to?
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.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8530
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
All I need to do really is touch two wires together momentarly.
The problem is you don't know exactly what's on those two wires. It is possible that just applying a logic level to one of them and GND or 5V to the other will work, but you don't know that without proper documentation.

Therefore the only safe way is with a relay of some kind.

Get some proper data and there may be other options.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Los Angeles, CA, United States
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have now the following:

http://parts.digikey.com/1/parts/753815-relay-mini-dpdt-2a-5vdc-pc-mnt-ds2e-m-dc5v.html

A diode that appears to say "16".

How would I hook these up to create a virtual switch?
Logged

C program run. C program crash. C programmer quit.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

See the relay connections on the right side.
That relay seems to take a bit too much current to drive from an arduino pin directly.
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.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8530
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that relay pulls 80mA, way over what an Arduino can supply. Use the circuit shown in Crossroad's schematic.

NOTE: If you are careful and use direct port manipulation you could drive the relay from 4 Arduino pins and not need the transistor. But this approach is quite prone to blowing up your Arduino if you get it wrong smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Los Angeles, CA, United States
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.
See the Learning or Playground section for accepting Serial input.
Use a relay like this to close the contacts
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=PB1110-ND
http://media.digikey.com/pdf/Catalog%20Drawings/Relays/FX2%20RELAY%20NON%20LATCHING%20FTPRNT.jpg
Connect one side of the Coil to +5V (Pin 1), the other (Pin10) to one side of a 15 ohm resister, the other side of the resister to an arduino output pin that you will drive low to energize the relay (and you may not need the resister, but start with it). Put a diode across pins  1 (cathode) and 10 (anode) to voltage spikes away from the arduino pin
(such as http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=1N4004FSTR-ND).
Connect pins 4 & 5 to your contacts.

Will this work using my relay that I bought? If not can you please explain the schematic
Logged

C program run. C program crash. C programmer quit.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

You didn't purchase the relay in #9, you purchased one that has lower coil resistance, which requires more current flow.
Thus you need an NPN transister which can control that larger current flow without overheating and burning up.
When a smaller amount of current is supplied to the base of the transister, a much larger amount of current is allowed to flow from the collecter to the emitter.
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.

Los Angeles, CA, United States
Offline Offline
Full Member
***
Karma: 2
Posts: 212
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So instead of http://www.allelectronics.com/make-a-store/item/RLY-648/5-VDC-DIP-RELAY/1.html what relay do I get from all electronics?
Logged

C program run. C program crash. C programmer quit.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

The one that I linked to back in Reply #2 because it only  needs 31ma to turn it on, which the Arduino can handle.

I don't think any of these will work without a transistor as they all need too much current.
http://www.allelectronics.com/make-a-store/category/500200/Relays/DIP/1.html
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.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

http://www.allelectronics.com/make-a-store/item/RLY-620/ULTRA-SMALL-5-VDC-DPDT-RELAY/1.html

Maybe this one.  How many volts across the 2 wires?
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.

Greenwood, Indiana
Offline Offline
God Member
*****
Karma: 0
Posts: 508
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Even with the lower current relay you still need the diode or the reverse EMF can fry the arduino
Logged

If it was designed by man it can be repaired by man.

Pages: [1] 2   Go Up
Jump to: