/s107g-arduino

Code to control the S107G RC mini helicopter with an Arduino Uno

Primary LanguageC++

s107g-arduino

Control an S107G RC helicopter with an Arduino board.

Circuit and components

IR LED sketch

If you have a different number of LEDs, you may want to use this LED calculator tool. To increase the range of this circuit, you will either need more LEDs or brighter LEDs, which will draw more current from the Arduino's pin. In such case, consider using a transistor to drive the LEDs' power.

Test

Upload S107G_Controller.ino to your Arduino and open the Serial Monitor. Turn on your helicopter and control its throttle, yaw, pitch, or trim by sending the following commands:

  • t:X: set throttle to X - any integer between 0 and 127, for example t:50
  • y:X: set yaw to X - any integer between 0 and 127, centered at 63
  • p:X: set pitch to X - any integer between 0 and 127, centered at 63
  • r:X: set trim to X - any integer between 0 and 127, centered at 63

Run

Upload S107G_PyController.ino to your Arduino and run S107G_PyController.py on your computer. Control the helicopter with your keyboard.

Known issues

  • The serial interface between the Arduino and the computer is too slow to maneuver the helicopter

References

The code in this repository is based on the work of several people, including that of Jim'ung, ladyada, and Kerry D. Wong. Credits to all of them for reverse engineering the controller protocol and showing how to send a 38KHz infrarred pulse using an Arduino.

Some of the sources on which I based my work are:

S107G protocol

The protocol to control the RC helicopter can be found here. Note that this code works for the 2-channel version, if you have a 3-channel remote controller follow this link.