Reading Radio Frequency Info
Overview:
Check out Ryan Boland’s explanation of Pulse Position Modulation to see how RF Transmitter/Receiver works…
The receiver transmits data through Pulse Position Modulation (PPM). Roughly every 20ms, the signal pins become high (5v) for between 1ms (1000μs) and 2ms (2000μs). The duration of this pulse indicates the position of the channel's stick. Check out this article on reading an RC receiver for further explaination.
When the stick is centered, this pulse will be 1500μs in length. When it is at maximum, the pulse will be 2000μs, and when it is a minimum the pulse will be 1000μs. Note that these values can vary slightly depending on the manufacturer of your RC receiver, and how it is configured.
In order to check my understanding of how everything was working, I connected 5V and GND to the receiver, and connected the channel 3 (which I know to be the throttle) signal pin to my oscilloscope.
With the throttle stick all the way at the bottom, I saw that the pulse was approximately 1ms (or 1000μs) in length. Note, each major division on the graph is 5ms.
When I raised the throttle stick to the maximum position, I saw that the pulses lengthened to approximately 2ms (or 2000μs) in length:
It seems that the signals look just as expected!
Materials:

- Radio Frequency Transmitter
- Radio Frequency Receiver w/ binding clip
- Arduino Uno
- Male to Female Wires
Pairing/Binding your Receiver to your Transmitter:
1) Install batteries into Transmitter. Do not turn on yet!
2) Install bind plug into receiver.

3) Connect 5V and GND from Arduino to the receiver.
4) A red LED blinks rapidly on the receiver.
5) Press and hold the bind button on the Transmitter as you turn it on.

7) The red LED on the receiver should stop blinking and remain on within five seconds.
8) Remove the bind plug.
9) Disconnect 5V and GND from receiver.
10) Turn off transmitter.
Now for wiring the receiver to Arduino…
Receiver Pin
Arduino Pin
CH1
A0
CH2
A1
CH3
A2
CH4
A3
Any 3rd Column Pin
GND
Any 2nd Column Pin
5V
Code:
#include <EnableInterrupt.h>
#define SERIAL_PORT_SPEED 57600
#define RC_NUM_CHANNELS 4
#define RC_CH1 0
#define RC_CH2 1
#define RC_CH3 2
#define RC_CH4 3
#define RC_CH1_INPUT A0
#define RC_CH2_INPUT A1
#define RC_CH3_INPUT A2
#define RC_CH4_INPUT A3
uint16_t rc_values[RC_NUM_CHANNELS];
uint32_t rc_start[RC_NUM_CHANNELS];
volatile uint16_t rc_shared[RC_NUM_CHANNELS];
void rc_read_values() {
noInterrupts();
memcpy(rc_values, (const void *)rc_shared, sizeof(rc_shared)); interrupts();
}
void calc_input(uint8_t channel, uint8_t input_pin) {
if (digitalRead(input_pin) == HIGH) {
rc_start[channel] = micros();
} else {
uint16_t rc_compare = (uint16_t)(micros() - rc_start[channel]); rc_shared[channel] = rc_compare;
}
}
void calc_ch1() {
calc_input(RC_CH1, RC_CH1_INPUT);
} void calc_ch2() {
calc_input(RC_CH2, RC_CH2_INPUT);
} void calc_ch3() {
calc_input(RC_CH3, RC_CH3_INPUT);
} void calc_ch4() {
calc_input(RC_CH4, RC_CH4_INPUT);
}
void setup() {
Serial.begin(SERIAL_PORT_SPEED);
pinMode(RC_CH1_INPUT, INPUT);
pinMode(RC_CH2_INPUT, INPUT);
pinMode(RC_CH3_INPUT, INPUT);
pinMode(RC_CH4_INPUT, INPUT);
enableInterrupt(RC_CH1_INPUT, calc_ch1, CHANGE); enableInterrupt(RC_CH2_INPUT, calc_ch2, CHANGE);
enableInterrupt(RC_CH3_INPUT, calc_ch3, CHANGE);
enableInterrupt(RC_CH4_INPUT, calc_ch4, CHANGE);
}
void loop() {
rc_read_values();
Serial.print("CH1:"); Serial.print(rc_values[RC_CH1]); Serial.print("\t");
Serial.print("CH2:"); Serial.print(rc_values[RC_CH2]); Serial.print("\t");
Serial.print("CH3:"); Serial.print(rc_values[RC_CH3]); Serial.print("\t");
Serial.print("CH4:"); Serial.println(rc_values[RC_CH4]);
delay(200);
}
Testing
- At this point your receiver should have 5V and GND applied. Now turn on your transmitter.
- With Arduino plugged into the computer, open your Serial Port
- You should see data like this:
Serial Port
- Try moving your joysticks around. You should see the numbers on the screen changing. - Make a note for yourself what part of the transmitter is connected to each channel so that you can use the remotes to control things in the future.
Last updated
Was this helpful?