Analog IR Joystick w/ Syma S107 Protocol
More electronics projects on mikekohn.net here.
Posted: August 21, 2013
I've have several projects that use the Syma S107 helicopter joystick as the controller including IR car and a Linux kernel driver I wrote for it. Unfortunately, this controller was made for a helicopter and requires the thrust to be forward to send any data, even if the project I'm doing doesn't use the thrust value. So when I was working on my new IR car with a dsPIC I decided to make my own controller using SparkFun's joystick kit.
So the joystick kit is just a a thumb joystick, several buttons, some headers, and a PC board that would fit an Arduino. My chip of choice here is the MSP430G2231 instead of an Arduino, so luckily SparkFun left a small area in the center of the board for random components. I simply soldered a socket for the MSP430 along with an IR LED driven by a ZTX1049A high gain transistor, and connected the pins of the micro to all the buttons and the X,Y axis of the controller.
The firmware is pretty simple and can be assembled using naken_asm. It basically just looks to see if the joystick is tilted beyond a threshold or any of the buttons are being pressed and if so sends the data out the IR using Syma S107 format. Since there is no thrust control, the thrust is always sent as 0. Pitch and yaw are sent as the Y and X axis (being read in with the A/D of the MSP430), and the buttons are mapped to the correction byte. After the joystick is centered and all the buttons are released, 5 or so extra command data bytes are sent out the IR to make sure the receiving device knows controller is idle.
Here is the Syma S107 controller sitting next to the SparkFun joystick.
Just the SparkFun controller.
And here's the schematic...
Copyright 1997-2018 - Michael Kohn