Go Down

Topic: Simulate push button with arduino (Read 8 times) previous topic - next topic

PeterH

Some Arduinos run at 3.3V so if you need to send a few mA to to your camera at 3.3V that would be easy if you are using an Arduino at the right Voltage.

Alternatively, as long as the amount of current you're providing is tiny, you could use a resister pair to divide 5V at the pin down to 3.3V at the camera.

The spec you quoted talks about a need to drive the pin low and then drive it high again. That seems odd to me. I'd expect to find that the line was pulled high (or low) via a resister and then pulled low (or high) via the switch when the switch was closed. In that case I'd expect you would need to pull the signal low to simulate closing the switch, and then let it float high again to simulate opening it. In that case you don't need to provide 3.3V - just pull it to earth as dc42 already suggested.
I only provide help via the forum - please do not contact me for private consultancy.

dc42

See attached (excuse the scrappy diagram) for how I would simulate a button press depending on whether the button is connected to +3v (with pulldown to ground) or to ground (with pullup to +3v). I'm assuming 3v not 3.3v because I presume the camera is powered from a lithium battery.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Carlcox89

#17
Jan 22, 2012, 06:39 pm Last Edit: Jan 22, 2012, 06:45 pm by Carlcox89 Reason: 1

I'll try measure the pads of both push buttons, then i'll post the values.
what I need to get (when camera is on) is what voltage  is running at powerButton and at modeButton (without actually pressing them), correct?


EDIT: the camera afaik is powered from 3.7v battery.

dc42

OK, 3.7v nominal then, but the circuitry is the same. You can probably get away with using a digital input to read the power status instead of an analog input, because with a 5v supply to the Arduino, anything from 3.0v upwards on a digital input pin is guaranteed to be recognised as a logic high.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Carlcox89

Ok, assuming i got it correctly.
Is this right?

(sorry for crappy pic)

sirbow2

#20
Jan 22, 2012, 07:57 pm Last Edit: Jan 22, 2012, 08:29 pm by sirbow2 Reason: 1
pic is better than the last one posted :)

im not sure but i thought switches are split vertically(right two pins are one side, left pins are the other) and when the switch is pressed, it connects the two.

EDIT: just use your continuity feature on your multimeter to find out.
http://dduino.blogspot.com all my Arduino/electronic projects!!!

{NEW} Getting Started, Learning, Reference + FAQ PDF!!:
[url]http://ar

Carlcox89

for me it looks like they are turned 90ยบ CC, but apart from that, is the wiring correct ?

dc42

If the PNP transistor you use has pinout c-b-e from left to right in your diagram, then that looks OK, if the mode switch connects the top right and bottom right pins when it is pressed (i.e. bottom right pin is always at +3.3v). Otherwise you might need to use the bottom left pin of the mode switch instead of bottom right.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Carlcox89

#23
Jan 22, 2012, 10:07 pm Last Edit: Jan 22, 2012, 10:19 pm by Carlcox89 Reason: 1
But from the diagram you posted, emitter is connected to 3.3v :o
(check attachment)

e(connected to top right)-b-c(connected to bottom right) (is what i've in my picture two posts above)

dc42

From the diagram you posted earlier, the top right pin of the mode button is the one that is 0v when the switch is open and 3.3v when the switch is closed. Therefore that should be connected to the collector. The emitter should be connected to the other side of the switch, which should always be at +3.3v when the camera is on.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Carlcox89

ok, got it!
i forgot to ask one more thing...
what characteristics does the PNP transistor must have?

dc42

Any small signal PNP transistor will do, e.g. BC337 BC327 or 2N3906.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Carlcox89

Many thanks :)
i'll update this thread whenever i have time to start the project.

Carlcox89

Something's not right here :x
i've measured with my multimeter, connecting the black probe to ground (where the battery connects to the camera) and connecting the red probe to most right pushbutton ( top right leg) and the power pushbutton (bottom leg)
this is what i got:


So from what i understand, this is the oposite of the original right?

dc42

To double-check how they are wired:

Each pushbutton has 4 legs. You have measured the voltage on one leg with the button pressed and released. For each pushbutton, one of the other legs will be connected to the one you measured, and the other 2 legs will be at either +3v or ground. I suggest you use your meter to find out which, and report back.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up