Auto Leveling an RC Plane


We are attempting to use an Arduino Uno to interface with an RC plane in order to design our own "auto leveling" system. The Arduino will control elevation as well as roll. However, we signed up here because we are running into some issues, and hope we can get some help!

The plane uses digital proportional control, which means that the ailerons and elevator are receiving pulse position modulation signals. In order for us to integrate with the servos, we need the Arduino to be able to read and also write these same pulse position modulation signals. The plane has its own controller that has an antenna. The signal from the remote controls the servos fine when tested. We tapped into the signal wire to the servo, and plugged that into A1 of the Arduino (does it need to be a digital pin?). When we read the values, we can see there's a pulse, but its so difficult to read and interpret! I've pasted our very basic code below. Any and all advice would be appreciated in this endeavor! :)

int pin = A1; unsigned long duration;

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

void loop() { duration = pulseIn(pin, HIGH); Serial.println(duration); delay(40); }

Read Receiver in playground for reading PPM from a hobby RC Receiver Can read a nearly unlimited number of channels using PinChangeInt and Timer1 libraries.