Why is it when I connect the Arduino to two pins on a button on a camera to say GND and pin 13 the button switches on?
I.e. I have a button on a camera connected on one side to Pin 13 and the other to ground....when the wires get inserted into the Arduino, they automatically switch the camera on....is this what should be happening?
Do I need a pulldown resistor?
EDIT: It also happens with any two pins on the board. Strange?
pehaps you should be using an optoisolator or a relay, if the camera sends 5 volts to the button, and you wire it backwards on your arduino, you could short out the arduino with an apparent 10 volts.
The camera did send 3.3v to the button but, I made sure all the polarity was correct, and this was happening with no power on and even before I ever put power to it all.
This is very strange, because it really shouldn't be doing this should it?
Litterally all I am doing is this:
_( b u t )_to pin on arduino
_( t o n )_to another pin on arduino
And without power on the Arduino, the camera turns on.
[1] Have you got a normally-closed switch or a normally-open switch?
[2] I would definately go with an optoisolator for this setup - so cheap and without it you are risking both the camera and arduino
[3] Try connecting the arduino to diagonally opposite corners of the button - this means it doesn't matter if your switch is normally-open or normally-closed. For example connect to the top left and bottom right pins (rather than the top right and bottom right that you are using now)
I've tried connecting it up that way as well, it still produces the same problem.
Thing is, it was presenting this behaviour and I just adapted my code around it thinking that if there was too much voltage going onto the Arduino, then it would have some sort of safety feature installed. I'm sure I've heard it does.
The switch is normally closed, I'm sure I heard as well that the Arduino pins can handle a voltage of like 12 volts for a short period of time. That may be incorrect, but surely it can handle like 8.3 volts that it would be getting connecting the button up using the way I am doing.
I'm trying to imagine how you could use the PINS to emulate a short. I mean, that's what a button is... a short circuit... But when there is a parallel "normally closed" button in use it just messes up the solution unless the button is removed entirely.
I actually meant to say that the button is normally open lol...
What I'm really asking as well is, even though that the button is normally OPEN, why when I wire it to the Arduino, even though that there is no power on the Arduino, and obviously it cannot be set to HIGH, then why does the switch act as if it closed?
maybe you need to connect the ground of the arduino to the ground of the camera and then wire your output to the switch input. that way you dont get that 8.3 volt potential. also, arduino pins are pretty sensitive. im pretty sure 12 volts and a short would destroy it almost instantly with a strong power supply.
Ok... Wild guess here...
The ATMEL chip has protection DIODES to ground and to VCC on each pin. Under certain undesirable conditions, these diodes conduct to "protect" the AVR. The diodes could be creating a circuit PATH for the button connections to take and be seen as a closure. So... something is not right.
Again, using the Arduino PINS and thinking you can use them like a transistor switch is probably not the best solution. A Mosfet, an Analog Switch, a small relay, an opto-isolator are all more desirable methods.
Making a PIN high or low does not equal "button closure emulation". You still have an unknown here... what does the CAMERA see as button closure? You may not realize this... but if the camera uses button multiplexing for all it's buttons... you'd get really odd results.
Good wild guess, that is almost certainly what is happening.
Generally any un-powered electronics looks like a diode to ground.
An arduino output can't stand 12v on it's output, even for a very short time.
Making a PIN high or low does not equal "button closure emulation"
Again nail on the head. You need to us an opto isolator.
but if the camera uses button multiplexing for all it's buttons.
Then you will need an analogue switch (analogue multiplexer) to effectively short the two connections together. Note that the multiplexer must be powered so that it's rails are within the camera's rails and that the camera's ground is connected to the multiplexer's power rail ground.
I should've guessed that wiring something as simple as a button would never be as simple as I thought. Yay.