RC Receiver FS-iA10B communication with Arduino Nano

Hey guys!
I want to build a remote controlled drone by myself using an arduino nano.

So far i have successfully:

  • set up communication with a MPU6050 gyroscope using “I2Cdev” and “MPU6050” libraries
    (SCL to analog pin A5, SDA to analog pin A4)
  • combined gyroscope data with linear acceleration data using a complementary filter and got
    sufficiently good angular position/speed values
  • tuned PID control

The tricky part right now is communicating with the RC Receiver FS-iA10B.

Until now i have used the EnableInterrupt library to read out the PWM signals of the four different RC channels. This approach seems to work, but sometimes those values are not updated fast enough. Besides PWM i could use PPM, but reading a PPM signal needs computation resources too. To get the RC data faster and more reliable i want to use BUS communication. FS-iA10B offers iBus and SBUS. I have tried to use the following libraries:

Those are written only for use with Arduino Mega 2560, which has “Serial1” in addition to “Serial”.
On Arduino Nano i have only one serial port, which i need to connect to my notebook and output the data on screen.
So i wanted to use the “SoftwareSerial” library, i changed every occurence of “HardwareSerial” in the SBUS library with “SoftwareSerial”.

I ran the following code on my Arduino Nano:

#include "SBUS.h"
#include <SoftwareSerial.h>

// I have made following changes to the SBUS library:
//   - I replaced every occurence of "HardwareSerial" with "SoftwareSerial"
//   - I set the baud rate _sbusBaud to 115200;
//   - in SBUS::begin() i simply removed the if-condition for the 
//     used microcontroller and instead put "_bus->begin(_sbusBaud);",
//     so that the begin()-function is called when using the arduino nano

// SoftwareSerial port for connecting the RC Receiver FS-iA10B
// (Arduino Nano has only one serial port
//  we need two: 1) RC Receiver, 2) notebook via USB)
SoftwareSerial mySerial(10, 11); // RX, TX

// an SBUS object
SBUS x8r(mySerial);

// channel, fail safe, and lost frames data
uint16_t channels[10];
bool failSafe;
bool lostFrame;

void setup() {
  // begin BUS communication
  x8r.begin(); // with RC Receiver
  Serial.begin(115200); // with notebook via USB
}

void loop() {
  Serial.println("      Loop.."); // Visualize that process is running
  
  Serial.println(x8r.read(&channels[2], &failSafe, &lostFrame)); // successful reading?
  Serial.println(channels[0]); // output receiver data CH1 on notebook
  Serial.println(channels[1]); // output receiver data CH2 on notebook
  
  delay(500);
}

I don’t receive any valid data though.
I only get 3 lines of “0”.

Does anyone have experience with SBUS or iBus on Arduino Nano?
Are there any better ways to communicate with the RC Receiver FS-iA10B?
Or did I mess up at some point in my code?

Thanks for your help!

Ok so i tried to keep things simple and used the standard “Serial” (instead of software serial).

Besides adding the following lines to the SBUS library i changed nothing.
Now it does to my Nano whatever it would to to a Mega, which should work, right?

#ifndef __AVR_ATmega2560__
#define __AVR_ATmega2560__
#endif

I updated my code to indicate SBUS activity by using LEDs:

#include "SBUS.h"

// a SBUS object
SBUS rcReceiver(Serial);

// channel, fail safe, and lost frames data
uint16_t channels[10];
bool failSafe;
bool lostFrame;

void setup() {
  // begin the SBUS communication
  rcReceiver.begin();

  // Setup LEDs as output
  pinMode(13, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);

  // Indicate finish of setup()
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  digitalWrite(13, LOW);
  delay(1000);
}

void loop() {
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  digitalWrite(13, LOW);
  delay(100);

  // Read channels
  rcReceiver.read(&channels[0], &failSafe, &lostFrame);
  
  // Reading successful?
  if(rcReceiver.read(&channels[0], &failSafe, &lostFrame)){
    digitalWrite(13,HIGH);
  }

  // Did something happen?
  if (channels[0] < 0.5) {digitalWrite(5,HIGH);};
  if (channels[0] > 0.5) {digitalWrite(6,HIGH);};
  if (channels[0] == 0) {digitalWrite(7,HIGH);};

  delay(100);
}

However, nothing happens.

The onboard RX LED is switched on steadily,
rcReceiver.read() returns false, channel 0 stays at “0” as well.

Any ideas?