Sunday, December 2, 2012

nRF24L01 2.4GHz RF Linux-Joystick Controlled Arduino Based Plane

How Transmitter Works:
Joystick -> Linux OS -> ardjoy Program -> Arduino 1 with TX code -> Transmits Joystick Info

How Receiver Works:
Receives Joystick Info -> Arduino 2 with RX code -> Controls Plane Servos and ESC

What you need:
  • 2 Arduino's
  • 2 nRF24L01 2.4Ghz RF devices
  • IDE cable (optional, to connect nRF24L01 to Arduino)
  • Linux OS with joystick support
  • USB/Serial Joystick that works with Linux

Downloading and Compiling Code
 mkdir -p ~/workspace
 cd ~/workspace
 git clone
 NOTE: the ardjoy code may need to be modified for joystick other than a ps2 controller.

Connect each nRF24L01 to each Arduino
Here is a  goodlink to help you do that:

Upload Arduino Code (Arduino Sketch files are found in the git repository above)
Setting up the transmitter 
  • Connect Joystick to Linux OS 
  • Verify that you have a /dev/input/js0 joystick device file
  • Connect the Arduino 1 to the Linux OS
  • Verify that you have a /dev/ttyUSB0 arduino device file
  • Run the following command "./ardjoy /dev/input/js0 /dev/ttyUSB0 115200"
  • Your Arduino should now be transmitting joystick information
Setting up the receiver (TODO, THIS IS INCOMPLETE)
  • Connect the Arduino 2 to the RC plane
  • Power the Arduino 2
  • You should now have the servo and ESC move in response to joystick inputs.

No comments:

Post a Comment