Pages: 1 [2] 3 4 5   Go Down
Author Topic: Simulate push button with arduino  (Read 6302 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Shannon Member
****
Karma: 183
Posts: 11138
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

I only provide help via the forum - please do not contact me for private consultancy.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* Scan 72.JPG (77.94 KB, 1653x1165 - viewed 176 times.)
Logged

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.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
« Last Edit: January 22, 2012, 12:45:45 pm by Carlcox89 » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

(sorry for crappy pic)
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 481
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

pic is better than the last one posted smiley

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.
« Last Edit: January 22, 2012, 02:29:18 pm by sirbow2 » Logged

http://dduino.blogspot.com all my Arduino/electronic projects!!!

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)


* Untitled.png (32.5 KB, 580x328 - viewed 49 times.)
« Last Edit: January 22, 2012, 04:19:30 pm by Carlcox89 » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Any small signal PNP transistor will do, e.g. BC337 BC327 or 2N3906.
Logged

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.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 139
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Pages: 1 [2] 3 4 5   Go Up
Jump to: