Thank you for sharing your amazing work! I have a question, may be it is already being answered, please bare with me I am new to this . From my understanding, the Sbus Protocol is a 25bytes data with 12 bits per byte and 12 X 25= 300 bits. I am trying to make Arduino communicating with NAZE 32 flight controller by using Sbus. Basically, if a ultra-sonic sensor is being used to measure the height and id it is below certain preset value, it will send a signal to increase the throttle automatically. It is a little bit confuse here, since many of the post mentioned that the Sbus data is something like this: 0x0F5C9126377FA46AAB00108000042000010870000210800C00 this is not 300 bits data and where is the start bit, paritybit and stop bit?
S-BUS protocol
The protocol is 25 Byte long and is send every 14ms (analog mode) or 7ms (highspeed mode).
One Byte = 1 startbit + 8 databit + 1 paritybit + 2 stopbit (8E2), baudrate = 100'000 bit/s
The highest bit is send first. The logic is inverted (Level High = 1)
data 1-22 = [ch1, 11bit][ch2, 11bit] .... [ch16, 11bit] (ch# = 0 bis 2047)
channel 1 uses 8 bits from data1 and 3 bits from data2
channel 2 uses last 5 bits from data2 and 6 bits from data3
etc.
flags = bit7 = ch17 = digital channel (0x80)
bit6 = ch18 = digital channel (0x40)
bit5 = Frame lost, equivalent red LED on receiver (0x20)
bit4 = failsafe activated (0x10)
bit3 = n/a
bit2 = n/a
bit1 = n/a
bit0 = n/a
Has anyone here managed to get a working SBUS to PPM servo HUB with a nano or ProMini? Or this has absolutely nothing to do with anyone's intention in these posts? Because I've searched for some time and I noticed that this is a frequently requested code and so far I couldn't manage to find an organized project about this.
I am trying to implement a sensor to a drone to avoid obstacles. I want to control the pitch channel so that when the drone senses an obstacle in front, the Arduino will overwrite the pitch channel, the drone will pitch up, and move back to avoid the obstacle.
I am using a 8 channel Futaba R2008SB radio receiver. I downloaded the Arduino libraries:
I used a 74LS14 hex inverter.
I connected the SBUS signal of the radio receiver to input of an inverter, the output of the inverter to the RX of the Arduino.
The TX of the Arduino connected to the input of another inverter, the output of the inverter to the RC signal of the Pixhawk.
I opened the serial monitor and set it to 115200 baud, however, there is no numbers displayed on the serial monitor.
I am wondering if the code is suitable for 8 channels, or am I required to modify the code to suit 8 channels? Does the code work if some of the channels between the radio transmitter and the radio receiver are inverted? Also, I am not sure whether my circuit connections are correct.
I do not understand SBUS protocol. I am interested to learn about how the bytes affect the channels.
I hope to receive help please, I would appreciate your help. Thanks.
I have been using the fantastic Futaba SBUS Library on an Arduino Mega to read channel data from a FRSky X8R / Taranis. I am using the inverter described here.
I get frequent Lockups, where the transmitter will stop responding and my robot will just going until i reset the Arduino. Sometimes after 20 seconds, sometimes after 5 mins. I have built several robots which use this library and I have experienced the same problem on all.
I am using the stock FUTABA_SBUS_h Library and RX SerialPort 3 on the Mega to receive the Sbus Data.
It's starting to drive me crazy. Any help much appreciated.
I have no idea how to debug.
mturneruk:
using the fantastic Futaba SBUS Library on an Arduino Mega to read channel data from a FRSky X8R / Taranis.
...several robots which use this library and I have experienced the same problem on all.
Have you tried a Futaba Tx/Rx? If not you've bet the farm on the skills of the Chinese reverse engineering department. They're notorious for de-engineering things, lowering parts specs, leaving parts out, and changing critical circuit points just to save a few nickels. Which often leads to failure
Any idea on why dont i get values from channel 9 and 10?
ch9 stays solid on value 1023
ch10 stays solid on value 0
Solution:
Well i found it so i leave this post here if someone else wonders.
In the libraryfile "FUTABA_SBUS.h" i removed "//" before `1
Now it works perfectly and prints all channels
Thanks for posting this...now I've got all 16 channels of my Taranis after uncommenting #define ALL_CHANNELS. Before this, I was only able to see channels 1-8 changing.
Next step for me is to pass along some of these values to a Pololu Servo Maestro controller.
Here is my updated serial display line with all channels
I am new the arduino and uav.
Currently my project requires me to have arduino communicate with f3 fc.
Knowing f3 supports Uart, how can I use arduino to simulate sbus/ibus RX and TX serial input to f3 fc
Thank you Erni. I recently discovered, the sBus signal is generated at the RX module level. I was under the impression it was generated at the transmitter, and sent through RF modules - but that is not the case.
Do you know if there is a transmitter library / project I can learn to connect to a TX module, to bind to an RX sBus (or iBus) ?
I am also struggling with this sketch. I am using the Elegoo Mega1560 and keep getting the
##avrdude: stk500v2_ReceiveMessage(): timeout
errors when trying to upload. Usually, I can unplug the RX0 which is going to my inverted SBUS signal, and the sketch then uploads, but then when I plug it back in and open up serial monitor, I don't get proper values. Using http://www.ernstc.dk/arduino/pic/inverter_sbus.jpg as my inverter with 1 10k and 1 5k resistor and a PN2222A transistor. can't burn bootloader to mega board either. Thinking it might be the board, and possibly will switch to an Uno. Any suggestions?
robweidner:
I am also struggling with this sketch. I am using the Elegoo Mega1560 and keep getting the
##avrdude: stk500v2_ReceiveMessage(): timeout
I never seen a ellego mega1560 before. If that works same way as meg2560, my advice is to remove your custom ciruitry first. Then try compile and upload a test led blinker sketch. If that works, try compile and upload the futaba compiled sketch.
Once you knos you csn upload a sketch to the bare board, then move on to adding circuits to test the software that it runs.
So I have wired up my 2x 1k resistor inverter and have managed to get the upload to complete, but when I open up the serial monitor, nothing shows up...
Hello. i have a big problem i need yours help.
i use RB7008SB and arduino. i made a inverter circuit.
i see SBUS protocol data on putty no problem but data frame is different.
data frame problem same like this post: @Glattnos —> #63
here is my sbus output on putty
Hello, i have tryed to run this Programm GitHub - kreidler/SBus_Decoder: S.Bus to PWM/PPM decoder on a Pro Mini 3,3V.
But there is a Problem with the PWM Output. The Pro Mini give out a PWM Signal but not the correct Framerate and Puls! The Framerate should be 20 ms but it is about 45 ms and the puls is also 2-4 ms!
So my Servos run to the Endpoint at middle Position!
I think this can be a Problem with the 8 MHz instead of 16 MHz Rate by a Pro Mini 3,3V!
Is it Possible to change the Progamm for a Pro Mini 3,3V 8 Mhz?
I dont know much about Programming so please give me excact Instuctions or a changed Programm!