Flysky IBUS Sensor

Hello,

I am making an RC ship right now. I am using Flysky FS-i6 transmitter and FS-IA10B receiver, which support telemetry over the IBUS protocol.

I want to make my Arduino to monitor the voltage of the LiFePo4 battery and use IBUS Telemetry to send the voltage back to receiver, and later extend it for current, RPM of the screw, etc, too. Read out voltage is easy by using a voltage divider and analog in, but I have a problem with IBUS. There are libraries which can read it, but only one which can write it - GitHub - Hrastovc/iBUStelemetry: Arduino - iBUS telemetry support. And there is no wiring suggestion...

IBUS is a half-duplex, and has both TX and RX on the same pin. Library defines 2 different pins for RX and TX. Is there a suggestion how to wire this? Would such connection work? https://i.stack.imgur.com/ZsepX.png

Just a small update. After reading the code, connecting pin 4 to IBUS Signal was enough. I also supplied Arduino with GND and VCC from IBUS. Worked well at first, I also read the voltage out and transmitted it, by voltage divider (100k/1M, so I get safe voltages at A0). Only limitation was that I was able to transmit only integers, so I ended up transmitting 10x of the real value (so my controls shown 99V instead of 9.9, but as I need it for low battery alarm only, I can always set it to 90V instead of 9.0V)

When there was no motor on ESC it worked fine. Then I added a motor to ESC, and tried to control it. At this moment the GND cable between IBUS and Arduino went up in flames, and second later, the ESC (cheap Chinamade 320A part) also started smouldering. Fire alarm also started howling, at midnight.... After I extinguished it, stopped alarm, opened windows, and brought my wife and daughter back to sleep, I realized that the ESC probably had no common ground on Battery side and on Receiver/Servo side, so when only one idling servo was a load, it went well, and with a big can motor taking several Amps the entire current flowed over IBUS and Arduino to the battery GND (my sensor was at balancer plug). Luckily the thinnest wire acted as a fuse - the cable was a cut protoboard connector..

Arduino seems to be optically intact, same as receiver, will need to check if they are alive tonight.... Should have been only flowing over the GND on the board.... ESC is dead for sure.

So, my task is now to make a ground-isolated sensor for voltage

I finalized it I hope. My setup is now like this:

  1. Battery Balancer connector. Contains a voltage divider (1M/100k, reducing 11 times) and 3 wires out (GND is doubled for convenience)
  2. DC Stepdown buck, for supplying Sensor Arduino with 5V
  3. Sensor Arduino. Reads the voltage, transmits it over hardware serial at 300 baud
  4. Optoisolator pair, set to double inversion (Opto LED normal OFF), worked better like this. Prevents the Short due to no common ground.
  5. IBUS Arduino. Receives the Sensor Data on hardware Serial, transmits them to IBUS
  6. IBUS connector

Surprisingly, both the RC Receiver and Arduino survived the fire. Arduino on the left is the one, after cleaning fire traces and soot.

Will fetch some fresh heat shrink and iso tape tomorrow, and pack it into a small plastic box (which contained 100 pcs of 3x10 wood screws earlier), leaving only both cables out.

Hello,
I have a fs-ia6b receiver and I should like to build my own battery sensor.
Is it possible you share your code and may be your schematic please?
Thanks.

Pierre

Hi,

I dont really have the schematics except the image in my previous post.
Voltage divider is simple I think, a pair of chinese Arduino Pro Minis, a power step-down too.

I will look if I have the sketches still, should be on my home PC.

About the optocoupler part, I had separate thread on that: (see the last post there, I had to invert the inputs)
http://forum.arduino.cc/index.php?topic=548866.0

Depending on your ESC, if that one has common ground for power in and power out, you can use just one arduino, but if they are not connected as it was in my case, you risk a fire and maybe damage to your LiIon/LiFePo battery, so opto between is a good idea.

OK,
Thanks for your help.
About the schematic, juste a picture how resistors are connected to the arduino and in what pin.
I suppose you use an analogue pin and after you send a ibus message?
Thanks again.

Interaction between the "measure Arduino" and "IBUS-Arduino" is done using the serial protocol on hardware serial ports.

IBUS is using a virtual com port for communication. I will try to make a layout now, if I can get the software installed.

Here it is. I hope I have it correct in my head - I cant look onto the original, as it is epoxied into the hull of my ship.

ERR - R4 is 10KOhm, not the 220 ohm!

1 Like

Sorry for no answer yet - my baby son got ill, so I had no chance to even turn on my home PC over weekend...

Hi,

So, I finally found the ino files. You would need the ibus telemetry library (GitHub - Hrastovc/iBUStelemetry: Arduino - iBUS telemetry support)

The limitation - I was not able to transmit decimals, so I ended up sending the 10*V. Meaning for your 3S LiFePo4 battery, that instead of 9.9V you see 99V in transmitter. Not a problem in general I assume, as you can set your alarm at 96V instead of 9.6 or so..

TelemetryMeasurement.ino (640 Bytes)

TelemetryIBUS.ino (528 Bytes)

I may have figured out a fix for the voltage issue. You should be able to replace the “
void iBUStelemetry::setSensorMeasurement(byte adr, float value){
switch(sensorType[adr]){
case 0:
sensorValue[adr] = (int)value100.0;
break;
case 1:
sensorValue[adr] = (int)(value
10.0)+400;
break;
case 2:
sensorValue[adr] = (int)value;
break;
}

statement with

void iBUStelemetry::setSensorMeasurement(byte adr, float value){
switch(sensorType[adr]){
case 0:
sensorValue[adr] = (float)value100.0;
break;
case 1:
sensorValue[adr] = (float)(value
10.0)+400;
break;
case 2:
sensorValue[adr] = (float)value;
break;
}

That should fix your issue. Keep in mind that I haven’t tried it, but from a code standpoint, that should fix the weird voltages.

Not sure if you´re going to answer, but the IDE simply gives an error compiling for board when including and modifying the .cpp file. Any ideas? 12.6v lipo's surpass the 99.9v display capacity the Flysky has. Which means I need to use 42-35. Considering the diplay has a battery symbol, it isn´t much of a problem. But looking at the numbers and getting 38-39 doesn´t feel good.

Hi,

For the error, post it here. Which board do you use?

For display, I would go for last 2 digits there, i.e. 26, you would anyways avoid dropping below 10 V.
Something like

if (v>10){
vsend = (v-10)*10
}

Thing is the transmitter display apparently allows values <100 with up to two decimals. Even using values such as 38 instead of 3.8, I still loose the second decimal digit, which is important sometimes. I already have a bunch of ways of seeing the actual voltage (it´s and arducopter with a lipo alarm connected directly to battery+automatic warning on drone buzzer+warning on Ground Station). The thing is that it´s also interesting to see the actual value and the battery icon directly on the controller. The fs ia6b also supports voltage monitoring directly through the power supply; only problem is that the board´s limit is 8.4. That´s 4.2 volts short.
P.D.: I´m using a Pro Mini for this project. Should try changing a few things to see if it works.

Hmm, if you are using it for a quad, why not to take a flight controller with OSD? My RC plane uses a Matek F411-wing with OSD - a cheap 800TVL camera and a USB receiver dongle for my cellphone for FPV produces fantastic results in fact. I am planning for a similar thing to be done on my camera-enabled drone, and also on RC ships.

Alternatively - a wireless connection over something like HC-12 or ESP8266 module, or by using wemos mini. One arduino on the quad transmitting data, and another driving a I2C display on your transmitter to show data.

Actually my setup is now only used on a quite large slow sailing RC ship, and even there, I plan to install the flight controller with OSD for speed, compass, voltage.. No need for ailerons, only rudder and prop.

It´s an arducopter with OSD and a telemetry stream going straight to a tablet I´m using, not only for values, but also GPS and everything. The controller has an inbuilt screen designed to receive ibus voltage, which also has a low voltage alarm. That is why I plan on adding the Arduino Pro Mini. Is there any way to make the voltage value non-integer using this library?

It´s not absolutely necessary, it´s just for the accomplishment.

According to specification, it should work... The problem is, I did not manage to do it, but I did not try it too much, as all my stuff is flying or swimming with max. 3C LiFePo4, and thats 9.9V...

You will need to dig into the specification and see if you could fix the library...

and yes, if you manage - I would be very interested to see the solution!

HI ,

i try this one with TGY-ia10B and turnigy receiver but nothing work, i can't choose sensor in the sensor list ?
can you help ?
thank's

Yves

Not sure what you mean about not being able to choose the sensor from the sensor list. Make sure your wiring´s ok, check some images on the internet if you need to. Send a pic of your problem if you can