Test Your RC Receiver Using Arduino

Transmitter-Receiver-ArduinoThere are several use cases involving connecting an RC receiver to an Arduino board. One such use case is testing whether or not your receiver actually works. In this tutorial, I will cover how to do the test.


The core idea behind the test is the fact that the receiver uses pulse width modulated (PWM) signal to communicate with the device connected to it (the device it controls). Arduino has several pins capable to output as well as read out a PWM signal, so we will connect our receiver to one of those pins and study the signal coming to the pin when we move the control stick(s) on the transmitter that is bound to the receiver. As the control stick(s) move, corresponding channels change PWM signal values and we can use Arduino to display those values on the screen, thereby verifying that the receiver responds to the controls on the transmitter. Let’s get to it:

  • First, get an Arduino board, a transmitter and a receiver. Make sure the transmitter and receiver are bound so that they hand shake and talk to each other.
  • In this tutorial, we are hooking up the FS-R6B receiver model shown in the picture below. I already bound it to its transmitter.
    FS-R6BTo keep things simple, we will only test if channel 1 on the receiver responds to the corresponding commands from the transmitter. Testing other channels is trivial and we will cover that below. Connect your outermost pin on BAT channel (labeled BAT) on the receiver to the the ground (GND) pin on Arduino. Then connect the middle pin on the receiver BAT channel to the 5V pin on the Arduino, and finally connect the innermost pin on the channel 1 (labelled CH1) to the pin 10 on Arduino. That Arduino pin has a little tilda (~) sign next to it, which means it’s a PWM capable pin. The wiring is depicted below. The outermost and middle pins provide power to the receiver from the Arduino, the innermost pin sends the PWM signal to the Arduino. If you have a difference receiver, the pins might be laid out differently. Check your receiver documentation if you’re uncertain about the pinout.

arduino-receiver-wireup

  • Next, connect our Arduino to the computer via its USB port and start the Arduino IDE. Start a new project and upload the code below to the board
    int rcPin = 10; // PWM signal arduino pin
    int ch1 = 0;    // Receiver channel 1 pwm value
    
    void setup() {
      pinMode(rcPin, INPUT);
      Serial.begin(9600);
    }
    
    void loop() {
      // Read in the length of the signal in microseconds
      ch1 = pulseIn(rcPin, HIGH, 25000);
      Serial.print("Channel #1: ");
      Serial.println(ch1);
    }
    
    
  • arduino-receiver-code
  • Once the code is uploaded, the board will automatically execute it. At this point, turn on your receiver and start moving the stick that corresponds to channel 1. If you don’t know which one it is, simply try them all to find out. One of them should yield results. How to see whether or not the receiver actually listens to the transmitter? Read on…
  • Now that the Arduino program is running on the board, start Serial Port Monitor from the Tools menu in Arduino IDE. You should see numbers changing as you move around the transmitter stick corresponding to channel 1. The images below show how the values change for my receiver. The first image shows the values when I leave the stick in the neutral position, the second image shows values when I move the stick all the way to the left, and the last image the values when I move it all the way to the right. Clearly, my receiver is listening to the channel 1 coming from the transmitter.arduino-receiver-ouput
  • What do all these numbers mean? They show the number of microseconds of the PWM signal being in the HIGH state – meaning how long the signal is on. PWM works by rapidly alternating between on and off on each channel. As we move the control stick, the receiver communicates the change to the Arduino by changing the interval during which the signal is in the HIGH as opposed to the LOW state on the corresponding channel. You can learn more about PWM and Arduino here. The numbers should change values between roughly 1100 and 1900.
  • Good, channel 1 is tested. Now how do we test channels 2, 3, 4, 5, and 6? Simply move the wire that connects channel 1 on the receiver to the pin 10 on Arduino. Move it from channel 1 to channel 2 or whichever channel you wish to test. Always keep it in the innermost pin on the receiver (for the above type of receiver), but you can move to a difference channel. Then run the Arduino program again. It will listen on the corresponding channel. Move the relevant stick on the transmitter around and you should see the numbers changing. If you do, the channel is working properly

You can do other things with the numbers coming from the receiver, of course You can use the Arduino language to turn on other pins, run actuators, turn on LEDs, etc.

Bookmark the permalink.
  • Ad Fazil

    why cant i type Serial.printIn? it stated as error