Arduino Forum

Using Arduino => General Electronics => Topic started by: Vini on May 19, 2011, 12:35 am

Title: [SOLVED] Activating a Button outside of Arduino
Post by: Vini on May 19, 2011, 12:35 am
Hey guys, how are you? Hope fine.

I'm trying to activate a button of a mp3 player with Arduino. Well, the main idea is very simple, just make a short with 2 wires in a tiny period of time to "simulate" a button pressed (the mp3 player has a smd pushbutton where I soldered 2 wires to make the short). Anyone have a idea how can I do that? I know I can use a relay, but I don't want to make a large final solution so, I was thinking in something smaller.

Well, thanks for your help anyway.
Bye (:
Title: Re: Activating a Button outside of Arduino
Post by: rbtying on May 19, 2011, 12:37 am
A transistor would work, and they can be very small.  Also, if you can figure out what the voltage going through the switch is, it may be possible to hook it up to a digital output and just use digitalWrite.
Title: Re: Activating a Button outside of Arduino
Post by: zoomkat on May 19, 2011, 01:19 am
I've used transistors to simulate button pushes on a tv remote and it worked well. An optical isolator chip might also be a good option (but the local radio shack does not carry them).
Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 19, 2011, 01:20 am
Hey,

The idea with transistor is what this picture shows?

Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 19, 2011, 01:20 am
Can you post a circuit please?
Thank you :)
Title: Re: Activating a Button outside of Arduino
Post by: zoomkat on May 19, 2011, 01:27 am
Below is what I used.

http://web.comporium.net/~shb/irmods.htm
Title: Re: Activating a Button outside of Arduino
Post by: Grumpy_Mike on May 19, 2011, 09:58 am
Quote
The idea with transistor is what this picture shows?

It would do if it were right, but its wired up all wrong.

While a transistor can work, much better is an FET as this actually changes resistance. I have had situations where a transistor would not trigger something but an FET would. Remember you also need to connect the ground of your device and the arduino ground together.
Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 19, 2011, 06:00 pm
Grumpy_Mike, what is the right way to wire this?
Thanks for your help!

And thanks zoomkat for the website!
Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 19, 2011, 07:16 pm
My old image is wrong, I mean this:


What is the right way to hook that wires?
Title: Re: Activating a Button outside of Arduino
Post by: Grumpy_Mike on May 19, 2011, 08:10 pm
That is right, I was referring to the first image you posted.
Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 19, 2011, 08:15 pm
Hey Grumpy_Mike,

I'm sorry for inconvenience but, can you send to me the circuit that works with FET? I'm having a lot of trouble with this circuit.

Thank you very much.
Title: Re: Activating a Button outside of Arduino
Post by: Grumpy_Mike on May 19, 2011, 08:18 pm
Just replace the transistor with a logic level FET and make the base resistor (which is now a gate resistor) 100R.
Do not connect the drain (was the collector) to +12V or a resistor but common up the grounds between your device and the arduino.
Title: Re: Activating a Button outside of Arduino
Post by: biocow on May 19, 2011, 08:25 pm
I tried a transistor and it wasn't working, but only cause n00b me forgot to connect the grounds together. So I went with a relay instead.

http://arduino.cc/forum/index.php/topic,49979.0.html
Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 20, 2011, 03:00 am
I'll try with the FET tomorrow. I used a 12V relay and it worked but when the pushbutton was pressed by the relay, I heard a loud noise on the speaker - don't know why..
Title: Re: Activating a Button outside of Arduino
Post by: Vini on May 23, 2011, 09:59 pm
Problem Solved!

Here is the final circuit working!

Thanks for everybody!