Electronic – Arduino: Controlling a RC car remote

arduinoremote control

I have a Carson Reflex Wheel remote control for my RC car.
It has two potentiometers, one for accelerating and one for steering.

My goal is to control the RC Car from my PC by sending commands via the serial connection to the arduino.

I would like to unplug the potentiometers and put the pins (in the white box -> see image) on two Arduino pins so the Arduino can control the remote control. This would exclude the potentiometers from the circuit and make the arduino kind of replace them.

The remote control operates at 12V.

enter image description here

The two potentiometers are connected with the black red yellow wires.

What circuit do I have to use between the pins (in the white box -> see picture) of the remote control and the Arduino?

UPDATE: I recently got a multimeter.
The voltage between the yellow and black pins is 5V (constant).
Between the other pins there is no voltage unless the potmeter is connected.
In this case the voltage between black and red varies from -4.9 (left), -2.9 (center) to -0.4 (right).
Between red and yellow it's 0 (left), -2 (center) and -4.4 (right).
(depending on the position of the steering wheel)

Best Answer

If you want to control the car from the PC via the Arduino you'll have to setup the serial port to receive the commands and output a PWM signal to emulate the potmeters.

I'm not really an Arduino man, but your code should look a bit like this. It receives + and - commands from the PC and increases or decreases the virtual potmeter position. Note that this is just a framework; there's no testing for minimum or maximum position, for instance.

const int analogOutPin = 9; // Analog output pin that the LED is attached to

int outputValue = 0;        // value output to the PWM (analog out)

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  if ( Serial.available()) {
    char ch = Serial.read();

    switch(ch) {
      case '+':
        outputValue+;
        break;
      case '-':
        outputValue-;
        break;
    }
  }

  // change the analog out value:
  analogWrite(analogOutPin, outputValue);   
}

Filter the output signal with an RC filter. This will give you a voltage between 0 V and 5 V. Measure the voltage range of the potmeters and report back. It's possible that you'll have to amplify the signal.

edit after the updated info in the question
Nice! So the potmeters give you an output range from 0 V to 5 V, which is exactly what the Arduino's output will do as well. So you can use the analogWrite function like in the example code above. Note that the Arduino guys call it "analog", but the AVR doesn't have an analog output, so it's probably just PWM. The Arduino doesn't have an RC-filter to make it DC, so you'll have to add the resistor and capacitor yourself.

enter image description here

A value of 100 kΩ for the resistor, and 1 µF for the capacitor are probably OK.

edit after your measurements and comment
The arrows on the RC filter schematic indicate a voltage. The arrowhead points to the signal whose value you want to measure, the back end of the arrow to the reference you're measuring against, which is usually ground. So if you would connect the ground pin of a scope's probe to the lower connection, and the probe's tip to \$V_{IN}\$ you'd see the Arduino's PWM output. Probe at \$V_{OUT}\$ and the PWM will be averaged to a DC voltage with some ripple. That's what we want if we want to emulate the potmeters.

If I understand correctly the black and yellow wires carry the potmeters' values, and are referenced to the red wire, which is +5 V. (This is confusing; black is generally accepted to be ground!). You can look for ground on the PCB, but we can use the +5 V reference too, we'll just have to flip the filter upside down:

enter image description here

The top line is your red wire. \$V_{IN}\$ is the output from the Arduino, you have two of those. \$V_{OUT}\$ for one of those goes to the black wire, the other output to the yellow one.