Page 1 of 1

oXs with two simultaneous current sensors

Posted: Fri Aug 19, 2016 8:18 pm
by Trebb
I just built an oXs rpm and current temp thanks to kuroguy for providing inspiration on helifreak! And it is working really well. So now I want to make more oxs sensors for all my helis and planes.

Just wondering is it possible to have two simultaneous current sensors to the same Arduino and appear as two separate readings in my Taranis transmitter?

Is it possible to modify the sensor ID codes in the oxs code?


Sent from my iPhone using Tapatalk

Re: oXs with two simultaneous current sensors

Posted: Fri Aug 19, 2016 9:09 pm
by mstrens
Currently oXs support only one current sensor and one RPM on one arduino.

If you want several current sensors, the easiest is to build 2 oXs.
It is possible to assign different sensor ID code in oXs code (for SPORT protocol). In the latest (current) version, the sensor ID are defined in oXs_out_frsky.h in folowing lines :
#define DATA_ID_VARIO 0x00 // = sensor 0
#define DATA_ID_FLVSS 0xA1 // 1
#define DATA_ID_FAS 0x22 // 2
#define DATA_ID_GPS 0x83 // 3
#define DATA_ID_RPM 0xE4 // 4
#define DATA_ID_ACC 0x1B // ?

There is one Id per group of data being sent.
Current is sent using the ID defined in DATA_ID_FAS.

Re: oXs with two simultaneous current sensors

Posted: Sat Aug 20, 2016 2:40 pm
by Trebb
Ok, thanks! That's just the info I was after.


Sent from my iPhone using Tapatalk

Re: oXs with two simultaneous current sensors

Posted: Sat Aug 20, 2016 11:46 pm
by raleighcoter
Who is kalle123? I thought I was the inspirer.

By the way, current sensors output a voltage that is proportional to current measured. You can hook up 6 current sensors as voltage sensors. All you need to do is figure out the range and offset in opentx. Hint: the n2 minihub instructions have the range and offset for the 5, 20, and 30 amp sensors.

oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 5:21 pm
by Trebb
Thanks for the tip, yes that makes sense I'm sure you could duplicate the current reading code and point it to a different pin and change the Data ID, just wondering had anyone had already done it.


Sent from my iPhone using Tapatalk

Re: oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 5:28 pm
by kalle123
raleighcoter wrote:Who is kalle123?
That is me. Any problem, wanna fight :mrgreen:

Re: oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 5:47 pm
by raleighcoter
Glad i could help both of you. I enjoy spreading the hobby.

Re: oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 6:56 pm
by kalle123
raleighcoter wrote:Glad i could help both of you.
How did you help me? Must have forgotten ...

Re: RE: Re: oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 6:57 pm
by raleighcoter
kalle123 wrote:
raleighcoter wrote:Glad i could help both of you.
How did you help me? Must have forgotten ...
viewtopic.php?t=8976

Re: oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 7:15 pm
by kalle123
And I did not thank you for that useful information. My mistake :shock:

Re: oXs with two simultaneous current sensors

Posted: Sun Aug 21, 2016 9:36 pm
by raleighcoter
My pleasure

Re: oXs with two simultaneous current sensors

Posted: Mon Sep 26, 2016 7:04 pm
by Trebb
mstrens wrote:Currently oXs support only one current sensor and one RPM on one arduino.

If you want several current sensors, the easiest is to build 2 oXs.
It is possible to assign different sensor ID code in oXs code (for SPORT protocol). In the latest (current) version, the sensor ID are defined in oXs_out_frsky.h in folowing lines :
#define DATA_ID_VARIO 0x00 // = sensor 0
#define DATA_ID_FLVSS 0xA1 // 1
#define DATA_ID_FAS 0x22 // 2
#define DATA_ID_GPS 0x83 // 3
#define DATA_ID_RPM 0xE4 // 4
#define DATA_ID_ACC 0x1B // ?

There is one Id per group of data being sent.
Current is sent using the ID defined in DATA_ID_FAS.
Hi mstrens,
I've now tried this with a second arduino but I couldn't get my taranis to read two clear separate values for the current.

How do I "assign a different sensor ID"?

I tried changing 0x22 to 0x23 but then the current couldn't even be discovered... I'm not familiar with how these hex values work...

Thanks!


Sent from my iPhone using Tapatalk

Re: oXs with two simultaneous current sensors

Posted: Mon Sep 26, 2016 8:38 pm
by mstrens
there are only 28 valid values for a device ID.
Here are the valid values:
0x00, 0xA1, 0x22, 0x83, 0xE4, 0x45,
0xC6, 0x67, 0x48, 0xE9, 0x6A, 0xCB,
0xAC, 0x0D, 0x8E, 0x2F, 0xD0, 0x71,
0xF2, 0x53, 0x34, 0x95, 0x16, 0xB7,
0x98, 0x39, 0xBA, 0x1B

0x23 is not a valid ID and can't be used.
You can try replacing 0x22 by e.g. 0x45