Page 1 of 1

6S with Temperature

Posted: Thu Jul 16, 2020 9:14 am
by mattuk
2 parts to this question really...

1) My Arduino has 8 analogue inputs (A0-A7). If I use 6 of them for my 6S cell monitoring and another 1 for current monitoring, this leaves me with 1 more that I'd like to use for temperature monitoring. Is it possible to do this in a nice way as it seems the configuration files are only setup to read 6 voltages?

2) My (nasty) solution so far has been to hack the analogue reading of a thermistor into the RPM section of the main openXsensor.ino as RPM seems quite an easy section to modify:

Code: Select all

#ifdef MEASURE_RPM
  if (millis() > ( lastRpmMillis + 200) ){  // allow transmission of RPM only once every 200 msec
        if (RpmSet == true) {               // rpm is set 
            RpmSet = false ;
        } else {
            RpmValue = 0 ;
        }
        //sport_rpm.value = RpmValue ; //------------------------Comment this out so RPM isn't populated with actual RPM!
        sport_rpm.value = 25 ;   //------------------------Add thermistor code here (value of 25 now reported on the tx as a test, which seems to work...)
        sport_rpm.available = true ;    
        lastRpmMillis = millis() ;
However with this method my Taranis is reporting the temperature as RPM and although I can charge this on the Taranis I'd like to change it in the code really. I've tried changing this line in the advanced configuration files but the Taranis still seems to see the temperature as RPM:

Code: Select all

#define         DATA_ID_RPM    0xE4
Does anyone know what I'd have to change to get this 'RPM' to show up as a temperature by default?

Thanks

Matt

Re: 6S with Temperature

Posted: Thu Jul 16, 2020 10:11 am
by mstrens
Please note that the voltages of the 6th cell will perhaps not be very accurate because it will be calculated substracting total 5 cells voltage from total 6 cells voltage. A small error on total 5 cells voltage and on 6 cells voltage will have a much greater impact on the difference.

In order to get the temperature on the Tx, you can copy the value (temperature) you calculated into a field named "test1.value" and set "test1.available" to true. Then in the oXs_config_basic.h file, you can uncomment the line "#define T1_SOURCE TEST_1"

Re: 6S with Temperature

Posted: Thu Jul 16, 2020 11:37 am
by mattuk
Thank you, that did it! I can now monitor all lipo voltages, current draw from the lipo and the temperature of the lipo :D :D
Hopefully cell 6 will be close enough, I'll see how I get on.

Re: RE: Re: 6S with Temperature

Posted: Thu Aug 06, 2020 10:33 am
by jhsa

mstrens wrote:Please note that the voltages of the 6th cell will perhaps not be very accurate because it will be calculated substracting total 5 cells voltage from total 6 cells voltage. A small error on total 5 cells voltage and on 6 cells voltage will have a much greater impact on the difference.
Hi Michel, I have been away from RC electronic projects for a little while :) and forgot how do we get a more accurate voltage reading? Some special ADC chip? If so, which one?
Sorry about the question, but I cannot check the oXs code at the moment, as I don't have access to my PC.
Thanks

João

Re: 6S with Temperature

Posted: Thu Aug 06, 2020 4:59 pm
by mstrens
Measuring the total voltage of a 6S should not be an issue at all.
Measuring the voltage of each cell will probably be less accurate on the last cells because the cell voltage is calculated based on the difference of e.g. 5th and 6th cells. So a small error on a value can give a bigger error (in %) on the difference.

oXs supports an external cheap ADC (the ADS1115) which is more accurate than the internal ADC. Still it measures only 4 channels if I remember well.

Re: 6S with Temperature

Posted: Thu Aug 06, 2020 9:14 pm
by jhsa
Thanks.. what about two ADC chips? Could they read up to 8 cells? Are they i2c?

João

Re: 6S with Temperature

Posted: Fri Aug 07, 2020 6:46 am
by mstrens
They are I2C so in theory it could but it is currently not supported by oXs ( and there is no real interest).

Re: 6S with Temperature

Posted: Sun Aug 09, 2020 7:48 pm
by jhsa
Well, I think there would be interest for models running on 6s as it is much more accurate. Also multiple sensors would be good for models with more than 1 battery. At the moment I am building a model that will probably have a battery powering each of the 2 motors.. So, two batteries. I still didn't think how I am going to diaplay both battery voltages, but 2 sensors would be nice as I would like to detect the lowest cell on both batteries. And I think I could probably configure that in ErskyTX..

João