OxS Five temperature sensor and one voltage sensor

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

OxS Five temperature sensor and one voltage sensor

Post by nesan »

Hi great guys. I came to this project like a snail after all these years.
I manage to build with Arduino nano i manage to pull to the tx two temp readings through T1 and T2 strings .is there a way to pull all five temperature readings to tx? my other voltage pins directed as VFAS,A3,A4 and T1,T2 only T1 and T2 shows in Celsius rest in voltage how to show all temperature telemetry?
below is the code section from advance and basic config files.
thanks for the help
Nesan
oXs_config_basic.h
(11.71 KiB) Downloaded 312 times
oXs_config_advanced.h
(16.84 KiB) Downloaded 313 times
Last edited by nesan on Thu Nov 19, 2020 2:08 pm, edited 1 time in total.

User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: OxS Five temperature sensor and one voltage sensor

Post by kalle123 »

I think, it would be easier, if you attach the complete oXs_config_basic.h and oXs_config_advanced.h file here as attachments ;)

br KH
Attachments
oXs_config_basic.h
(11.34 KiB) Downloaded 1124 times
oXs_config_basic.h
(11.34 KiB) Downloaded 271 times
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

HI thanks for responding!
I have updated the files as you direct.
thanks
Nesan
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

nesan wrote: Thu Nov 19, 2020 2:31 am Hi great guys. I came to this project like a snail after all these years.
I manage to build with Arduino nano i manage to pull to the tx two temp readings through T1 and T2 strings .is there a way to pull all five temperature readings to tx? my other voltage pins directed as VFAS,A3,A4 and T1,T2 only T1 and T2 shows in Celsius rest in voltage how to show all temperature telemetry?
below is the code section from advance and basic config files.
thanks for the help
Nesan

oXs_config_basic.h
oXs_config_advanced.h
The Arduino nano not measuring temperature from pin 3 ! when I run another configuration it seems it measure the voltage at all the pins. can you check if I conflict anything in my config file please.
or is it possible nano A3 "hardware" went bad?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

I do not see a conflict in your config files.

Do you get a value from A3 if you run another configuration (e.g. reading only A3 as volt_1 and sending it as VFAS)

nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 4:36 pm I do not see a conflict in your config files.

Do you get a value from A3 if you run another configuration (e.g. reading only A3 as volt_1 and sending it as VFAS)
Yes I do get volt sending through VFAS from A3 when I run different config.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

So, your arduino is not defect.
Perhaps, it is the Rx that does not accept that oXs uses the telemetry fields A3 or A4.
To check this, try to send VOLT_x (from Arduino pin A3) on another telemetry field (e.g. fuel source)
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

Hi first of all thanks to you mstrens for coming to my help!
I comment these two lines all the voltages in pin A0 to A7 except "A4 andA5" mesure voltage
//#define FIRST_NTC_ON_VOLT_NR 2
//#define LAST_NTC_ON_VOLT_NR 6
if I un comment these lines one of the pin not measures temp. in this case volt_3 Pin A2.
-----------------------------------------
if I push the
0 , 1 , 2 , 3 , 6 , 7 // Fill all 6 values; set to 0 up to 7 for analog pins A0 up to A7 ; set the value to 8 for the voltage(s) not to be measured.
#define RESISTOR_TO_GROUND 0 , 0 , 0 , 0 , 0 , 0
#define RESISTOR_TO_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define SCALE_VOLTAGE 204.6 , 204.6 , 204.6 , 204.6 , 204.6 , 1

and in
config basic
#define T1_SOURCE VOLT_1

then all the pins measure "Volt_1 pin AO" temperature except A6 and A7???? ?/???
why
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 5:57 pm So, your arduino is not defect.
Perhaps, it is the Rx that does not accept that oXs uses the telemetry fields A3 or A4.
To check this, try to send VOLT_x (from Arduino pin A3) on another telemetry field (e.g. fuel source)
I tried as you said
// --------- 2 - Data to transmit --------- uncomment the lines below if you want to transmit some extra oXs measurements into some telemetry fields
// ***** 2.1 - Frsky data *****
#define VFAS_SOURCE VOLT_1
#define FUEL_SOURCE VOLT_2
#define A3_SOURCE VOLT_3
#define A4_SOURCE VOLT_4
//#define ACCX_SOURCE YAW
//#define ACCY_SOURCE ROLL
//#define ACCZ_SOURCE PITCH
#define T1_SOURCE VOLT_5
#define T2_SOURCE VOLT_6



// ***** 6.2 - Voltage parameters *****

#define PIN_VOLTAGE 0 , 1 , 2 , 3 , 6 , 7
#define RESISTOR_TO_GROUND 0 , 0 , 0 , 0 , 0 , 0
#define RESISTOR_TO_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define SCALE_VOLTAGE 1 , 204.6 , 204.6 , 204.6 , 204.6 , 204.6

// ***** 6.4 - Convert voltage to temperature (° Celcius) *****
#define FIRST_NTC_ON_VOLT_NR 2
#define LAST_NTC_ON_VOLT_NR 6
#define SERIE_RESISTOR 4700
#define STEINHART_A 7.00111E-4 .
#define STEINHART_B 2.1644E-4
#define STEINHART_C 1.0619E-07

pin A2 VOLT_3 not working.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

So, you can try to send some VOLT_x on ACCX, ACCY and/or ACCZ if those are not used for another purpose.
There is still an attention point using ACCX,Y. If remember wel, it requires using a scale (255?) on Tx side to get the expected value.
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 7:03 pm So, you can try to send some VOLT_x on ACCX, ACCY and/or ACCZ if those are not used for another purpose.
There is still an attention point using ACCX,Y. If remember wel, it requires using a scale (255?) on Tx side to get the expected value.
Here something puzzling me. how come I could measure voltages when I disable temperature calculation part?
only happen when un comment temperature calculation.

one more thing I am measuring either volt or temp pin by pin. Do I have to connect all temp probe at once for any internal loop hardware need in Arduino ?
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 7:03 pm So, you can try to send some VOLT_x on ACCX, ACCY and/or ACCZ if those are not used for another purpose.
There is still an attention point using ACCX,Y. If remember wel, it requires using a scale (255?) on Tx side to get the expected value.
I tried to send through VOLT_3 by ACCX and VOLT_6 by ACCY . ACCY shows in g I do not know how to scale it
ACCX shows 0.00g then I switch VOLT_3 TO VOLT_6 ACCY and ACCX also change accordingly.

all this with another new Arduino nano.
so if it is not the code then could it be so I have to connect all the sensors at once for desire result?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

in the line #define PIN_VOLTAGE 0 , 1 , 2 , 3 , 6 , 7 you declare which voltages have to be measured (here 6 voltage e.g)
In the lines (e.g)
define FIRST_NTC_ON_VOLT_NR 2
define LAST_NTC_ON_VOLT_NR 5
you declare which voltages have to be converted into degree. So here oXs will calculate degree based on VOLT_2, VOLT_3 , VOLT_4 and VOLT5 which are measured on pin A1, A2, A3 and A6).
Then oXs will use the results of the calculation in following way (extract of the config_description.h file)
* When you use 1 or 2 NTC, the temperature(s) will be registered in VOLT_X and VOLT_Y where X is the value of FIRST_NTC_ON_VOLT_NR and Y the value of LAST_NTC_ON_VOLT_NR
* If you use more than 2 NTC, oXS will register in :
* VOLT_X the lowest temperature
* VOLT_X+1 the index of the highest temperature (1 being the index of the first NTC)
* VOLT_Y the highest temperature

So yo can't get all temperatures but only the highest and lowest.
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 9:42 pm in the line #define PIN_VOLTAGE 0 , 1 , 2 , 3 , 6 , 7 you declare which voltages have to be measured (here 6 voltage e.g)
In the lines (e.g)
define FIRST_NTC_ON_VOLT_NR 2
define LAST_NTC_ON_VOLT_NR 5
you declare which voltages have to be converted into degree. So here oXs will calculate degree based on VOLT_2, VOLT_3 , VOLT_4 and VOLT5 which are measured on pin A1, A2, A3 and A6).
Then oXs will use the results of the calculation in following way (extract of the config_description.h file)
* When you use 1 or 2 NTC, the temperature(s) will be registered in VOLT_X and VOLT_Y where X is the value of FIRST_NTC_ON_VOLT_NR and Y the value of LAST_NTC_ON_VOLT_NR
* If you use more than 2 NTC, oXS will register in :
* VOLT_X the lowest temperature
* VOLT_X+1 the index of the highest temperature (1 being the index of the first NTC)
* VOLT_Y the highest temperature

So yo can't get all temperatures but only the highest and lowest.
oh! my goal is to make a temp sensor for 5 cylinder and 7 cylinder radial engines I have. so what is your suggestion here?
measuring cell voltages and use lua script to convert them in Celsius in TX side .
or
is there any way to use analog multiplexer and drive through i2c digital for decode in tx? or any other way?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

If you really want to get all temperatures (instead of min, index n and max), you can change some lines of code in file oXs_voltage.cpp

You just have to remove the lines (from 271 up to 275)
if ( numberOfNtc > 2) {
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR - 1].value = minTemp ;
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR ].value = maxNtcIdx ;
voltageData.mVolt[LAST_NTC_ON_VOLT_NR - 1].value = maxTemp ;
}

Then VOLT_X, X+1, X+2, .....Y will store the expected temperatures. You can then transmit them in the way you expected (using VOLT_X , ....)
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 9:59 pm If you really want to get all temperatures (instead of min, index n and max), you can change some lines of code in file oXs_voltage.cpp

You just have to remove the lines (from 271 up to 275)
if ( numberOfNtc > 2) {
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR - 1].value = minTemp ;
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR ].value = maxNtcIdx ;
voltageData.mVolt[LAST_NTC_ON_VOLT_NR - 1].value = maxTemp ;
}

Then VOLT_X, X+1, X+2, .....Y will store the expected temperatures. You can then transmit them in the way you expected (using VOLT_X , ....)
Oh that is the good news!
I will try and let you know. do you thing the 6th voltage in this case VOLT_1 can be used for other purpose? I would like to use for pneumatic retract low presser activator function.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

For 5 cylinder, you can get them with one single oXs (see my previous mail)
For 7 cylinder, the easiest would be to use 2 oXs. In this case, you should have to change the device ID in the second one in order to avoid that both reply on the the same polling request from the RX.

Othewise, in order to get more than 6 VOLT_X, it is also possible to add an ADS1115 (ADC) to oXs.
This provide 4 extra ADS_VOLT measurement.
It would then be possible to add a few lines of codes to oXs in order to let oXs convert the ADS_VOLT to degree too.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

nesan wrote: Fri Nov 20, 2020 10:08 pm
mstrens wrote: Fri Nov 20, 2020 9:59 pm If you really want to get all temperatures (instead of min, index n and max), you can change some lines of code in file oXs_voltage.cpp

You just have to remove the lines (from 271 up to 275)
if ( numberOfNtc > 2) {
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR - 1].value = minTemp ;
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR ].value = maxNtcIdx ;
voltageData.mVolt[LAST_NTC_ON_VOLT_NR - 1].value = maxTemp ;
}

Then VOLT_X, X+1, X+2, .....Y will store the expected temperatures. You can then transmit them in the way you expected (using VOLT_X , ....)
Oh that is the good news!
I will try and let you know. do you thing the 6th voltage in this case VOLT_1 can be used for other purpose? I would like to use for pneumatic retract low presser activator function.
The voltages that are not used for temperature can be used for other purpose. So, for a 5 cylinder, you still have 1 VOLT available (5 if you add a ADS1115 chip)
nesan
Posts: 37
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by nesan »

mstrens wrote: Fri Nov 20, 2020 10:14 pm
nesan wrote: Fri Nov 20, 2020 10:08 pm
mstrens wrote: Fri Nov 20, 2020 9:59 pm If you really want to get all temperatures (instead of min, index n and max), you can change some lines of code in file oXs_voltage.cpp

You just have to remove the lines (from 271 up to 275)
if ( numberOfNtc > 2) {
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR - 1].value = minTemp ;
voltageData.mVolt[FIRST_NTC_ON_VOLT_NR ].value = maxNtcIdx ;
voltageData.mVolt[LAST_NTC_ON_VOLT_NR - 1].value = maxTemp ;
}

Then VOLT_X, X+1, X+2, .....Y will store the expected temperatures. You can then transmit them in the way you expected (using VOLT_X , ....)
Oh that is the good news!
I will try and let you know. do you thing the 6th voltage in this case VOLT_1 can be used for other purpose? I would like to use for pneumatic retract low presser activator function.
The voltages that are not used for temperature can be used for other purpose. So, for a 5 cylinder, you still have 1 VOLT available (5 if you add a ADS1115 chip)
All work as you said thanks for your help and generosity ! I will let you know the progress and expect your help for all my projects. thanks again.
Nesasn :P
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OxS Five temperature sensor and one voltage sensor

Post by mstrens »

OK, fine.
bivo
Posts: 84
Joined: Wed Jan 28, 2015 11:15 am
Country: Brazil

Re: OxS Five temperature sensor and one voltage sensor

Post by bivo »

Hi Dears!
I only need to program one temperature sensor for my plane.
Does anybody already have the code to be added in the arduino?

Post Reply

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