CONTENTS

Home
Updates
Software
Electronics
Music
Resume
Contact


YouTube
Twitter
GitHub
LinkedIn

HTTPS VERSION


Analog IR Joystick w/ Syma S107 Protocol

Posted: August 21, 2013

Introduction

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.

Explanation

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.

Pictures

SparkFun joystick

Here is the Syma S107 controller sitting next to the SparkFun joystick.

SparkFun joystick circuit

Just the SparkFun controller.

SparkFun joystick schematic

And here's the schematic...

Source code
sparkfun_joystick.asm
sparkfun_joystick.hex

Copyright 1997-2024 - Michael Kohn