2

I am trying to hack a cheap RC car as to be able to control it using my Arduino. I took apart the cars remote controller and found the pins that make it go forwards, backwards, left, and right. So I soldered 4 jumper wires to these pins and connected them to the Arduino as follows: Pin 8 - Left Pin 9 - Right Pin 10 - Forwards Pin 11 - Backwards I found the remote controller is controlled by a chip called TX-2E, I checked the data sheet online and found that if any of the pins that control the pins motion are ground, the car will move in that corresponding direction. So if the forwards pin is grounded the car is supposed to move forwards. To test this, I connected each jumper wire to ground on the Arduino individually and found that it worked as described on the datasheet.

Then I decided to create a sketch that makes the car move forwards for 1 second and backwards for 1 second, it worked as expected.

Then I wrote a sketch that makes the wheels turn left for 1 second and then turn right for 1 second. But it didn't work as expected instead the wheel turned left for 1 second, went to neutral for a second.

I wasn't sure what was wrong, but I decided to run a sketch that should move the car forwards for 1 second, move it backwards for 1 second, turn the wheels left for 1 second, and then turn right for 1 second. But all it actually did was just turn left for 1 second every couple of seconds. I removed the jumper wire connected to pin 8 that is supposed to control the wheels turning left, while the sketch was running and everything worked as expected except the turning left part. it moved forwards for 1 second, moved back for a second, waited at neutral for a second, and then turned right for a second. When I connected back the jumper wire that controls the car moving left everything stops working again. I am not sure whats wrong, I even connected a multimeter to each pin and found they were pulsing between 0V and 5V as expected but for some reason they weren't moving the car, it was only moving left, in this case at least. Any help to get this working, ideas to why its not working, or any troubleshooting tips would be greatly appreciated. Below you can find the code for the sketch, that is supposed to move the car forwards, backwards, left and right.

const int LEFT = 8;
const int RIGHT = 9;
const int FWD = 10;
const int BWD = 11;

void reset () {
  //Sets all pins to HIGH as the car moves when the pins are grounded.
  //And we want the car to start out by not moving.

  digitalWrite(LEFT, HIGH); //For some reason everything works when I remove this
  digitalWrite(RIGHT, HIGH);
  digitalWrite(FWD, HIGH);
  digitalWrite(BWD, HIGH);
}

void setup() {
  // put your setup code here, to run once:

  pinMode(RIGHT, OUTPUT);
  pinMode(FWD, OUTPUT);
  pinMode(BWD, OUTPUT);
  pinMode(LEFT, OUTPUT);
  reset();
}

void Forward(){

  digitalWrite(FWD, LOW);
  delay(1000);
  digitalWrite(FWD,HIGH);
  delay(1000);
}

void Backward(){
  digitalWrite(BWD, LOW);
  delay(1000);
  digitalWrite(BWD, HIGH);
  delay(1000);
}

void Left(){
  digitalWrite(LEFT, LOW);
  delay(1000);
  digitalWrite(LEFT, HIGH);
  delay(1000);
}

void Right(){
  digitalWrite(RIGHT, LOW);
  delay(1000);
  digitalWrite(RIGHT, HIGH);
  delay(1000);
}

void loop() {

  Forward();
  Backward();
  Left();
  Right();


}
  • 1
    Did you connect the arduino ground to the remote's ground? – Gerben Jun 12 '16 at 13:54
  • What is the voltage across the switches when they are not depressed? Perhaps your Arduino is getting reset periodically rather than running the entire program. It could be useful to add some serial output to your program which you could capture to monitor its operation, though connecting to both the computer and the RC transmitter could perhaps cause electrical issues. Perhaps you could add an LED and resistor (anode to 5v, cathode to signal) to your setup and visually monitor it that way? – Chris Stratton Jun 12 '16 at 20:08
1

Without details of the car's circuitry one can't say with certainty what the problem is. However, from the description given, one thing sticks out: The TX-2E spec sheet says to ground a control pin to select a motion. But besides grounding pins at times, you are also taking them high.

Instead, try leaving pins open when not active, and pulled down for active. Eg, try code like:

void motion(const int pin) {
  pinMode(FWD, OUTPUT);
  digitalWrite(pin, LOW);
  delay(1000);
  pinMode(pin, INPUT);
  delay(1000);
}
void Forward() {
  motion(FWD);
}
void Backward() {
  motion(BWD);
}
void Left() {
  motion(LEFT);
}
void Right() {
  motion(RIGHT);
}
  • But is there a reason, this works as opposed to applying a high voltage to the pin when not active? Some extra info: The pin when not active and not connected to the Arduino is at around 3.5 V. But when I connect the pin to the Arduino and apply a high voltage to it, the voltage across the pin is about 5 V. Could this somehow have led to my issue? If so, in what way? And could it have led to more long term issues if I kept applying 5V to a pin that was used to taking about 3.5 V. The confusing thing is that it worked properly for all movement except for leftward movement. – user22945 Jun 13 '16 at 11:35
  • I don't really know and haven't thought of a circuit that would work precisely that way, but can imagine there's some matrix or multiplex circuitry that works when certain combinations are used -- eg, forward and left, or forward and right -- and depends on the left or right contact point being open to let signals flow through. – James Waldby - jwpat7 Jun 13 '16 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.