openXvario development

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

openXvario development

Post by rainer »

if somebody with some more electronic knowledge than me comes up with an easy circuit to connect a balance connector to the pins of the arduino, the code to use it as a 6S cell monitor is already in there as well. if you want to test it, just install some pulldown resistors (e.g. 30k to GND ) to the pins below.
#define PIN_VoltageCell1 0 // Pin for measuring Voltage of cell 1 ( Analog In Pin! )
#define PIN_VoltageCell2 1 // Pin for measuring Voltage of cell 2 ( Analog In Pin! )
#define PIN_VoltageCell3 2 // Pin for measuring Voltage of cell 3 ( Analog In Pin! )
#define PIN_VoltageCell4 3 // Pin for measuring Voltage of cell 4 ( Analog In Pin! )
#define PIN_VoltageCell5 6 // Pin for measuring Voltage of cell 5 ( Analog In Pin! )
#define PIN_VoltageCell6 7 // Pin for measuring Voltage of cell 6 ( Analog In Pin! )
then you can put 0..5V (relative to GND!!) to those pins and get it displayed in open9x.
we just can´t connect the balance connector directly to the arduino as only the 1st cell has it´s voltage relativ to GND.
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)

User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by jhsa »

it will be interesting to see how they do it on those simple battery checkers.. will have a look at one of mine later.. ;) maybe it give me some ideas :D

gotta buy the sensor.. :(

Joao
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by jhsa »

Rainer, would you mind having a look here please?? ;)

viewtopic.php?f=23&t=174&p=37154#p37154

Thanks

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by bertrand35 »

Rainer, I am working at companion9x now. I will add an ID to the FrSky Hub protocol as soon as I am in a pause ...

Bertrand.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

bertrand35 wrote:Rainer, I am working at companion9x now. I will add an ID to the FrSky Hub protocol as soon as I am in a pause ...

Bertrand.
Just a thought... if I am correct, the HUB can be used a source for the vario in open9x. With this in mind, why does this board need both the serial and A1/2 connected?

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by bertrand35 »

No it will only need to be connected to the serial port, not to A1, providing we add this new ID inside the FrSky protocol.
Bertrand.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

Hmm. Post above says it needs a1/a2 for lift/sink rate.

Can we get some clarification?

I am thinking this may be because the radio only handles whole numbers for the vario - so the resolution is too coarse?

Although... Having both output modes works well as it works on the cheaper 6ch receivers that only have an A1/2 port.

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by jhsa »

good point..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by bertrand35 »

Right, both could be possible (A1/A2 or serial).
Bertrand.
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

OK, to clarify this...
under normal circumstances we do not have to connect A1 or A2. all values will be passed via the RS232 interface.
Just if you are using a receiver without RS232 interface you can still use this board via A1 or A2 (just one required).

The quality of the generated vario audio signal will be a lot better if you use RS232.
If you use the analog output via A1 or A2, the climb rate will allways jitter a little bit. this results in an unstable vario tone, but it is still usable.

when i started working on this project, i only had the idea of outputing a signal over A1 or A2. but then i realized i could easily calculate an absolute height in the arduino, and i liked the idea of having my 9x using voice output to say the current altitude :D . it wasn´t working at first, but with bertrands help we got it working by using the halcyon protocol. That's when i made the Analog signal optional.
And as the sensor got a builtin thermometer as well, why not output the temperature as well. Maybe your plane is freezing up there :D

EDIT: forgot one thing: i hope by using the new id for the climb rate directly, (instead of having open 9x calculate it) we can speed it up and reduce the lag. but even without the new id it is allready working quite well.
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

The new id for lift/sink sounds like a good idea. Certainly something to play with. :-)

Sent from my Nexus 7 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

So.. I am wondering if we can do something rather clever as an option for this vario.

What this vario does is to give us a barometric pressure sensor to indicate lift.

Now.. lets think out the box. Frsky have an inertial / triaxial sensor. How can we hook this in?

The reason is that we could in theory use this device to do 'total energy compensation'. This could be used with a bit of maths to help rule out stick induced lift - making the whole thing very accurate!

What you think?

This page:

http://en.wikipedia.org/wiki/Variometer

Has some info on the actual maths involved.
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

The triaxial sensor would not be the problem. There are even boards available that have the MS5611 + 3-axis gyroscope + triaxial accelerometer + three-axis magnetic field available for only a little more money.
but it would be a tough piece of work to get that algorythm produce good results...
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
gohsthb
Posts: 1412
Joined: Wed Dec 28, 2011 2:32 pm
Country: -
Location: Naperville, IL

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by gohsthb »

jhsa wrote:it will be interesting to see how they do it on those simple battery checkers.. will have a look at one of mine later.. ;) maybe it give me some ideas :D

gotta buy the sensor.. :(

Joao
I don't know how they do it in the battery checkers, but here is a circuit that can read the individual cell voltages of a 6S LiPo. I would use either the lt1639 or an LM324 opamp. Both can handle Vcc > 20V, which would be needed for 6S. Really it is just 6 differential amplifiers in series. With all equal resistors (as pictured) the output of each amp will be the voltage of the cell it is attached to. So if cell 5 is at 4V then op amp 5 will output 4V. Oh and try to use 1% resistors so the error doesn't get too large.
-Gohst
Attachments
LiPoMonitor.pdf
(21.6 KiB) Downloaded 362 times
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by jhsa »

Great info, thanks..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

The original FRSky Lipo Monitor without display FLVS-02 is available for around 10€. so it might be an idea to be able to read the data coming from it. anybody knows how the FLVS-01/02 communicate with the sensor hub?
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

OK, it looks like the flvs communicates to the sensor hub in the same format as the sensor hub is talking to open9x.
i ordered one so i´ll have a look if we can hook it up.
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by MikeB »

This is very interesting, although I don't have time to do anything about it at the moment.
I do, however have an idea. It should be possible to connect this between the HUB and the RX. Now, monitor the hub data, relaying it to the receiver, and either add extra data on the end of a hub packet, or change the data, e.g. for altitude, as it passes through.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by ReSt »

Where did you find this information?

I have a FrSky sensor hub and the voltage input is a 2 pin header being ground and signal. That looks like there should be a 1Wire protocol running.

The GPS input and the Data output (downlink to the receiver) are both UART interfaces.
On the other hand, Altitude (Vario) and ACC seem to be I2C interfaces, at least from the pins they are connected to at the processor (SDA1,SCL1 / SDA2,SCL2).

And the HUB clearly does do a protocol conversion, as NMEA ASCII data from a GPS module are output at the Data connector with HUB protocol.

Reinhard
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

Hi,
Here´s the description from frsky: http://www.frsky-rc.com/uploadfile/2012 ... 433921.pdf
I first didn´t know if the described protocoll was between sensor and hub, because i knew it allready for the comm between hub and ground station, but then i found this here:
http://www.rcgroups.com/forums/showthre ... 2&page=144
so i think it´s worth giving it a try.

Rainer.
Edit: Oh, yes, one wire could be true.. it just needs to send to the hub normaly, so no need for a RX connection. i´m doing the same to communicate from the vario to the receiver. just tx to rx connected. one wire+ground
Last edited by rainer on Sat Jan 26, 2013 6:42 pm, edited 1 time in total.
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by jhsa »

So, I do apologise but I got a bit lost here.. might be because of the fever :(
What we're talking about now is to interface the frsky battery cells sensor with Rainer's arduino project?
What about the schematic Gohsthb posted a few posts above? the one to connect to the lipo balance plug to get the individual cell voltage and connect to the arduino?
Would that also work?

Thanks,
João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

I´ve got a terrible cold as well right now.. no reason to apologize ;-)
I guess the schematics would work. But i do not want to start developing a smd board layout and solder it all up if there is a nice multiplexing version ready available for little more than 10 €.
So the idea i´m looking into right now is more too hook up the FLVS to the vario ( only 2 pins required )
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

Agreed!

End solution should be easy for non tech users to sort out.

:-)

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by jhsa »

ok, thanks.. now I understand what is happening..
So, we would have total voltage, single cell voltage, temperature, altitude and vario..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

The arduino on its own send vario, altitude, temp and its own supply voltage.
I´ll try to add support for the other sensors like Cell monitor and Current sensor to the code, so that we can make it suit our individual needs.

Total voltage is being calculated by open9x from the sum of all cells. I hope Bertrand will help me to get an alternative way to send (additional to the cell voltages) the receiver internal voltage back to open9x. Currently i´m sending that voltage as cell 0, which results in it being counted in fot the total voltage.

Open 9x additionally has a Telemetry value allways showing the lowest off all cells in order to easiliy create alarm / switches.

Rainer
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

Rainer... Shall we open. Google project for this?

I can add one if you want? Just need to decide on a name!

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

Rainer... Shall we open. Google project for this?

I can add one if you want? Just need to decide on a name!

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

Rob Thomson wrote:Rainer... Shall we open. Google project for this?
i´m just doing that ...
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by Rob Thomson »

Excellent!

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: DIY arduino variometer/altimeter/hub for open9x+FR-Sky

Post by rainer »

build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”