SBUS decoder, display, and wireless buddy box project
Posted: 22 Jun 2020, 13:13
Long-winded explanation below. Probably better to watch the (long-winded) YouTube video.
SBUS (or S-BUS) is a serial protocol invented by Futaba, but now supported by many R/C manufacturers. It transmits 16 normal channels, plus 2 'digital' channels (single bit, so like an on/off switch) and two bits of data for 'frame lost' and 'failsafe'.
The serial protocol is 100 kbaud, 8 data bits, even parity bit, 2 stop bits. The signal is the opposite polarity to the normal serial signals used by Arduinos and similar. A single frame of data occupies 25 bytes, and takes exactly 3 milliseconds to transmit. With most R/C systems, there are gaps between the frames, and a typical frame rate might be every 11 milliseconds, or whatever.
I wanted to decode SBUS to use a tiny Futaba compatible receiver as part of a wireless buddy box system.
I spent a long time writing a decoder that uses pinchange interrupts to detect the incoming SBUS signal. It worked but suffered from occasional parity or framing errors because the edges need to be timed accurate to 5 microseconds, and with standard Arduino code on a standard 16MHz Arduino, that can't be obtained completely reliably. The chip itself is capable, but the Arduino overhead running the millis() timer and so on means that sometimes a few microseconds of jitter cause problems. I got the program working 100% reliably using Atmel Studio instead of the Arduino IDE, but most people won't want to do that...
So I fell back on using the Arduino's serial "hardware" to receive the signal - that works perfectly, but does mean that the SBUS signal has to be inverted (using a single transistor and two resistors) to be compatible with the Arduino Rx (D0) input.
More details, circuit, sketch etc. to follow... watch this space!