How to Read the Traxxas Radio PWM Signals using an Arduino

How to Read the Traxxas Radio PWM Signals using an Arduino

These are my notes on how to read the PWM servo signal coming from the Traxxas TQ receiver.

Disclaimer: use this information at your own risk.  I am not responsible for any damage.

RC car radio receivers communicate with the steering servo and electronic speed controller using electrical pulses called PWM(pulse width modulation).  Using an Arduino, we are able to capture  these pulses and print their values out to the Serial Monitor.  These numbers represent the width of the electrical pulse in microseconds, and are essentially the same numbers you would use in an Arduino sketch to control the car programmatically.

Materials Needed

  • Arduino
  • RC car radio receiver
  • USB Cable
  • Jumper Wire

Receiver

The TQ Receiver that comes with a stock Traxxas vehicle consists of two channels, representing steering and throttle.  Starting from the bottom is Channel 1.  The next one up is also Channel 1 (I am unsure why they exist in duplicate)  The third one up is Channel 2 and it is used for the ESC.  These are the two we are concerned with.

Each channel contains three pins:

  1. The left-most pin is for the “signal”.  This is the pin that communicates by sending electrical  pulses to the servo and ESC, directing them to turn, go forward, or reverse.
  2. The middle pin is the Positive terminal.
  3. The right-most pin is the Ground/Negative terminal of your  power supply.

Note:  the Positive and Negative pins are all connected together underneath.  Sending power to any channel will supply electrical charge to any of the other +/- pins.  Once you connect power to one channel, connecting power to the other channels is not necessary.

Important:  be sure to disconnect all wires from the radio before connecting anything to the Arduino.  In the stock configuration, the receiver is powered by the ESC at 6 volts.  You do not want to accidentally turn on the ESC with any of the radio’s +/- pins connected to the 5v pins of the Arduino as this may damage your board.

To set up, you will need to plug a wire to a PWM pin on the Arduino.  These are designated by the tilde ~ symbol.  This code example will be using Pin 3.  Connect Pin 3 to the left-most pin of Channel 1 on the receiver.  Then connect a red wire from the +5 pin of the Arduino to the middle pin of Channel 1.  Finally, connect a black wire to right-most pin of Channel 1 and the ground pin of the Arduino.

 

Connect the USB cable.  The LED light on the Receiver should turn red.  This indicates that it is on but not connected to the Transmitter.  Power on your Transmitter controller, the LED light should change green.

Now upload the following sketch:


byte PIN = 3;
int pwm_value;

void setup() {
    pinMode(PIN, INPUT);
    Serial.begin(9600);
}

void loop() {
    pwm_value = pulseIn(PIN, HIGH);
    Serial.println(pwm_value);
}

 

Next open the Serial Monitor by going to the menu:  Tools -> Serial Monitor

If you get an error in the console that looks like this:   Board at /dev/ttyACM0 is not available

Go to Tools -> Ports and select the port listed in the error code(in this example it would be /dev/ttyACM0).

You should see values in the Serial Monitor.  Turn the steering knob of the transmitter and the values should change.

Full left should be around 1000

Full right should be around 2000

And neutral position should be around 1500.

For reading the throttle values, simply disconnect the left-most wire(signal) from Channel 1 and plug it in to Channel 2.  Look closely at the markings(it’s tiny!).  Channel 2 is actually third from the bottom.  Use a magnifying glass to be sure.

You do not need to move the +/- wires since those pins are already connected together inside the radio.

 

Now squeeze the throttle on the transmitter and observe the values in the Serial Monitor.

2 thoughts on “How to Read the Traxxas Radio PWM Signals using an Arduino

  1. Excellent article & blog!

    Traxxas TQ Receivers have dual Channel 1 ports for applications like a dual steering servo setup which some larger RC vehicles require.

    Your PMW article inspired an idea…
    anti-lock disc brake-like (ABS) setup for my Traxxas 4-tec 2.0. Basically, an Arduino that detects brake input from the ESC and then outputs pulsed braking. The thought is the ABS-like brake pulsing would prevent brake skid/increase traction during high speed runs. I hope to test it out.

    Thank for the inspiration and keep up the great work!

    1. Hi Nick,

      Yes! That’s an excellent example of something that could be done by intercepting the PWM signal. Once you have that, you can do whatever you want with it. Thanks for reading and commenting.

      John

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.