Arduino-Controlled RC Radio

Is it possible to use the Arduino to close a pushbutton switch electronically? The radio for my RC truck uses 4 (normally open) pushbutton switches to control it forward, back, left, and right.

I would test this on my own but I'm afraid of frying my board. The radio uses two AA batteries (1.2V, 2000mAh each). Are there any precautions I need to take while working on this project?

I have a $30 RC truck from Radio Shack I want to automate with an AI program on the Arduino or my laptop. I did this once before but I used a $70 relay switch and a Java program on my laptop.

You can use an NPN transistor to close a switch circuit like yours (15 pack at RS for ~$2.49).

The way I would approach it (and I could be wrong) would be to find out where each side of each switch goes; depending on how it it wired (and I suppose it could be wired very weird, but...), one side of each switch will go to the positive terminal of the battery (or to a voltage source/regulator on-board the PCB in the transmitter, which may be lower than the battery voltage), or to the negative terminal (common ground).

Hopefully, one side goes to common ground; it makes things easier to do (because the components are more available). If this is the case, what you want to do is hook up an NPN switching transistor between the side going to ground and the other side, so that the transistor becomes the switch (the collector goes to the side of the switch not connected to ground, the emitter goes to the other side, or ground); a common 2N2222 NPN should work OK for this task, since the current flowing should be minimal. You will want a bias resistor on the base of the transistor as well; see here for a method on how to calculate such a base resistor value:

http://forum.allaboutcircuits.com/showthread.php?t=9751

You can also try starting with a 1k ohm, sometimes you can get away with lower values (there's a way to calculate the proper base resistor, I am sure there's a calculator somewhere on the internet, actually), but don't go below 330 ohms. The other side of this resistor you hook up to a digital pin on the Arduino, where you control it as normal.

If you are really paranoid about your Arduino, you could hook up an opto-isolator between the two (or you could try to find an opto-isolator with an NPN detector that has a high enough current rating to handle the switching; anything over 25 ma should do - try to get around 50-100 ma to be "safe".

Now - if the switch control on the positive side, its basically the same kind of scheme, except with a PNP transistor...

:)

[edit]Something else you could try would be to wire the Arduino to the receiver, so that you can directly control the h-bridges/switches that control the truck. You would have to do a bit of reverse engineering, and maybe some probing with a multi-meter after some schematic drawing and reverse engineering (taking guesses at components, diagraming the schematic wiring of the receiver PCB) - it isn't easy, but it can be done (sometimes its easier to trace back from the motors to the PCB)...[/edit]

I'm a little new at this so if someone could walk me through it I would be very appreciative. I have taken a photo and labeled it to show where the switches are (sorry about quality).

It looks like the switches are connected to an IC. If the poles of two different switches are connected on the board does that indicate where the ground is?

At this point I guess I'm trying to determine 1) where to connect the transistor to +V and G on each switch, and 2) do I use a PNP or NPN

Back of Board

Front of Board

It is difficult to tell from those pics what is what, but it -looks- like the pins are being pulled to ground (active LOW); the best way to find out would be to take a multi-meter, set on resistance, and go probing; put one probe on the known ground (battery negative), and the other probe to one side or the other of the switch; if you find that, then you should be able to trace the circuit back to the chip itself with some eye-balling and guesstimation.

BTW - is that all the information there is on that chip? If so, it seems "house marked" for New Bright, so figuring out which real radio transmitter IC it is may be difficult (have you looked at the receiver yet - maybe the IC there isn't re-marked (unlikely), and with that information you could find the datasheet for the pair, since they are typically sold in complementary pairs anyhow)...

I agree you need to use a multimeter and see what is going on with each side of the switch. See if one side of the switch is directly connected to the common ground. Years ago I used a transistor to operate the "up" button on an IR remote (below).

http://web.comporium.net/~shb/irmods.htm

A site which may help you (I've been browsing the site lately, and other than the various "UKisms" that make things seem a tad strange here in the US, overall it seems like a great resource):

http://www.kpsec.freeuk.com/index.htm

:)

If you go with a CD4066, it will probably work regardless of how the switches are wired, since you’re dealing with low-level (3V-ish) signals.

Not quite as “sure-fire” as a bank of relays, but the odds are so good that I would skip breadboarding and go straight to soldering it up on a perfboard.

Don’t forget to tie the grounds on the Arduino and transmitter together.

Thanks for all of your replies!

Here's a MUCH better picture of the RC board. You can see the stamp on the chip (New Bright T6648B).

I'm currently struggling with the NPN transistor switch. I can't even to get a test circuit to work so I must not understand something fundamental about how this works. Can someone check out this circuit and tell me what I'm doing wrong:

Test Circuit 1

That is a 2n2222 transistor. If I can get the most basic version of this type of circuit working then I can build on that.

edit: added image link edit: typo

bump

I'm really sorry for the multiple posts but I have had a little success with the CD4066 Ran Talbot suggested. I was able to wire up the transmitter to a pushbutton switch via the 4066. Next I tried to replace the pushbutton switch with the Arduino. I wrote a sketch that sends alternating HIGH and LOW signals to pin 2 which is wired to the control pin on the 4066.

Here's a diagram of my circuit.

I'm uncertain how to ground the Arduino part of the circuit. Do I need a resistor between the Arduino and the 4066 since the Arduino is running on 5V? If so, what size resistor? Thanks in advance for your help. I feel like I'm getting close to solving this!

Here's my sketch:

// Send a signal to close a switch on a remote control.

int forwardPin = 2;
int ledPin = 13;

void setup(){
  pinMode(forwardPin, OUTPUT);
  pinMode(ledPin, OUTPUT);  
}

void loop(){
  digitalWrite(forwardPin, HIGH);
  digitalWrite(ledPin, HIGH);
  delay(500);
  digitalWrite(forwardPin, LOW);
  digitalWrite(ledPin, LOW);
  delay(3000);
}

just tie the gnd wire from both chips together

I would instead use four small 5vdc reed relays ( http://www.allelectronics.com/make-a-store/item/RLY-541/5VDC-SPST-N.O.-DIP-REED-RELAY/1.html ) only a buck a piece and can be driven directly from Arduino output pins without needing transistor drivers, although you should still wire a reversed connected diode right across the relay coil terminals. No worry about voltage or ground connections.

Lefty