Virtual switch

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.

Yes.
See the Learning or Playground section for accepting Serial input.
Use a relay like this to close the contacts


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.

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

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

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?

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

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?

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.

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


Rob

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

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.

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?

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.

Maybe this one. How many volts across the 2 wires?

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

I should have stated this in the beginning but the flash is a disposable camera flash and the idea is just to make a high speed photography trigger with the parts available at www.allelectronics.com. What parts would I need? I was thinking of using this: Arduino High Speed Photography Trigger - YouTube
but I cant find a Opto Isolator at All Electronics that works.

MOC3020

I cant seem to find that at the Allelectronics website.

I know how to use google. I want to get the optoisolator from All Electronics as it is 5 minutes from where I live.