Go Down

Topic: arduino as a button?? (Read 743 times) previous topic - next topic

mubot

Sep 15, 2009, 05:29 am Last Edit: Sep 15, 2009, 06:14 am by mubot Reason: 1
hi... lemme see if i can ask this properly...

i have a circuit that has a play button (lil mini voice recorder)

how would i have that triggered by my arduino??

thanks for the help...


im assuming i have to use a relay....but was wondering if there was anything in an arduino board that had this function...code or whatever.

But...what about something like a 4066 chip...would that work?

i think they work something like ....send a digital out to the chips control pin...and that will make make an analog type switch connection?

or am i totally wrong with that !??!?


thanks again

RIDDICK

#1
Sep 15, 2009, 05:57 pm Last Edit: Sep 15, 2009, 06:07 pm by RIDDICK Reason: 1
hey!

do u mean this?

if the arduino, and the 4066, and that voice recorder share the GND-level, there could possibly be no problem...  :)
the resistance of that 4066 switch is about 50Ohm, which might be too much, because the voice recorder might want almost 0Ohm... but i dont know...

what about a good old BJT?

a relay would work, but it is noisy and fails earlier because it is mechanical...

once i saw a multi-position switch that changed its resistance the more i pressed it... does ur voice recorder use such a switch?

bye
-Arne

Eduardo_g

I would check the wires in the music board. I mean:
In the music board, the most probable case is that there is an input to the controller that expects eaither a GDN signal, or a VCC signal to PLAY.
So, check with a voltmeter the signal. Plug voltmeter black wire to battery GND.
Check voltage in both sides of the switch while OPEN (not pushed). Surely one will be 0V and the other will be VCC.
Now push the button while measuring again. One of the switches has changed the value. This one is the PLAY START INPUT, the other is directly connected to VCC or GND. The voltage you get in this pin is what it expects to PLAY (0V or VCC), so feed this voltage via a transistor to get it play.

mubot

you were correct in your assumption....

1 side of the switch is 0..the other is +4.5

when i press the switch the 0 side stays at 0 ....but the +4.5v side drops to zero


so i need to send a pin low command to the switch connections?
the 0v side to grnd  ...and the 4.5v side to an output pin...?
sorry for the dumb question..but why do i need a transistor to do the switching?

thanks for the help man!!!

RIDDICK

the arduino output pins deliver 5V...

maybe the recorder is disturbed, when it gets 5V instead of 4.5V?
-Arne

Grumpy_Mike

#5
Sep 16, 2009, 09:40 am Last Edit: Sep 16, 2009, 09:43 am by Grumpy_Mike Reason: 1
Quote
the 0v side to grnd  ...and the 4.5v side to an output pin...?


Yes that sounds like it will do it but I would also connect a 220R (or so) resistor in series with the output pin and your switch just to add a bit of protection.

Don't forget to connect the grounds of the two systems together as well.

mubot

cool ... thanks for the help ... i figured i was on the right track..but wanted some confirmation!

keep ya posted...


Eduardo_g

Mubot, two details I want to comment:
First try would be connecting an output from Arduino directly to the music box. The problem is that the music box expects a LOW signal to activate, and you will a LOW state before you can put the output HIGH when the Arduino starts, so there will be difficult to avoid one first play on every boot of Arduino.
Second detail, how can you calculate the 220R in the input? You have to know the input current of the play pin to guess the needed resistance to reduce 0.5volt. Anyhow I would assure there will be no damage feeding it with a 0.5 overvoltage.

To assure you get total control over the input pin, I would do another thing. Use a standard NPN transistor (ie 2N2222). Wire the output from arduino to the bae through a 1K resistor. Wire the collector to the input play pin. Wire the emitter to ground (and connect both ground between them, Arduino and music box)

Tell us when you get it.

Grumpy_Mike

#8
Sep 17, 2009, 10:16 am Last Edit: Sep 17, 2009, 10:18 am by Grumpy_Mike Reason: 1
Quote
and you will a LOW state before you can put the output HIGH when the Arduino starts,


No when it starts up all pins are set to be inputs, therefore they are high impedance and not pulling low.

Quote
how can you calculate the 220R in the input


That is just to provide a bit of a resistance that will drop any excess voltage caused by any miss match in the supply voltages of the tow units. The value is chosen so that it is small enough to allow the input pin to still pull down to a zero but big enough to limit the current flow for a miss match. I thought 200R what would you choose? There is no right answer only wrong ones.

Quote
You have to know the input current of the play pin to guess the needed resistance to reduce 0.5volt.


No you can guess without any knowledge ;)

Seriously though the resistor is not to drop the voltage it is only to limit the current flowing in any protection diodes of the input device.

If you want some isolation the an opto isolator between the Arduino and the device would be the way to go rather than the half way house of a transistor. With an opto isolator you DON'T connect the grounds together, anything else and you do.

mubot

hey guys....

i went with the simple route of connected the grounds, adding the 220 resistor to pin and sent a low output...  : and it worked perfectly!

thanks for all the input... the different solutions and things to check will all come in handy for future builds...

thanks again for all your help!

-Mubot

Go Up