OpenXsensor Voltage measure with HOTT

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
billi
Posts: 3
Joined: Sat Nov 24, 2018 4:03 pm
Country: -

OpenXsensor Voltage measure with HOTT

Post by billi »

Hi,
I'm trying to get my first OXS running. I would like to measure the Totalvoltage on a 3S Lipo without the sensorcable with warning thresholds for min voltage. I build it on a UNO to learn the Arduino IDE. I got same help from the other forum (fpv-community.de).

We simulated a 3cell lipo eg. 12.3 V Lipo /3 = 4.1 for each cell so I can set the warning thresholds for min voltage. But the indication on Nr.1 cell is wrong. We get only 0.4 volts instead of 4,1. The other 2 cells show close to 4 volts. Maybe the need some adjustments with the SCALE_VOLTAGE.

The voltage from the Lipo goes through a voltagedivider 47K/10K to A3. This voltage goes further without any real resistors direct to A1 and A2 to simulate a 3cell. Softwaresides I put a voltagedivider at A1 and A2 to get the single-cell-voltage.

Have anyone any idea to get the right voltage at cell 1

Thanks in advance
Franz

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXsensor Voltage measure with HOTT

Post by mstrens »

I do not understand how you simulate your lipo.
Can you put here a schema of your resistances and the wiring.
Can you also add here your 2 config (basic and advanced) files.
billi
Posts: 3
Joined: Sat Nov 24, 2018 4:03 pm
Country: -

Re: OpenXsensor Voltage measure with HOTT

Post by billi »

hi mstrens,
thanks for your quick reply
here are the wiring and the config files.

thanks
Franz
Attachments
config.advanced.pdf
(271.17 KiB) Downloaded 269 times
config.basic.pdf
(242.24 KiB) Downloaded 247 times
wiring.pdf
(240 KiB) Downloaded 315 times
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXsensor Voltage measure with HOTT

Post by mstrens »

OK, now I understand your wiring.
There is probably a misunderstanding in the way you use the concept of "number of cells".
In fact, with your wiring, as A1, A2 and A3 are connected toegether (to the mid point of the voltage divider), you are not measuring individual cells but just 3 times the total voltage.
The 3 measurements done by oXs provides different results because oXs applies the 3 differents values for the resistors in the config (#define RESISTOR_TO_VOLTAGE 15.7 , 31.3 , 47 ).
I think that the values are wrong.

Anyway, the normal way to use oXs is the following.
You have 2 options. You can :
- measure only one voltage (the total of your 3S lipo)
- measure the voltage of each cell and get the total and the voltage of each cell.

In the first case, you use only one physical (hardware) voltage divider. You connect the mid point to only 1 pin (e.g. A1) and then the set up should look like:
#define PIN_VOLTAGE 1 , 8 , 8 , 8 , 8 , 8
#define RESISTOR_TO_GROUND 10 , 0 , 0 , 0 , 0 , 0
#define RESISTOR_TO_VOLTAGE 47 , 0 , 0 , 0, 0
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define SCALE_VOLTAGE 1.0 , 1.0 , 1.0 , 1.0 , 1.0

#define BATTERY_1_SOURCE VOLT_1 // not sure that this line is required
#define MAIN_BATTERY_SOURCE VOLT_1
#define NUMBEROFCELLS 0

In the second case, you have to use at least 2 physical voltage dividers.
The cell 1 could be connected directly to e.g. pin A1
The cell 2 should be connected to a resistor (e.g. 33k), the other pin of this resistor should be connected to e.g. pin A2 and to a resistor of 10k ( the other pin of the 10k going to ground)
The cell 3 should be connected to a resistor (e.g. 47k), the other pin of this resistor should be connected to e.g. pin A3 and to a resistor of 10k ( the other pin of the 10k going to ground).
Then the config should be
#define PIN_VOLTAGE 1 , 2 , 3 , 8 , 8 , 8
#define RESISTOR_TO_GROUND 10 , 10 , 10 , 0 , 0 , 0
#define RESISTOR_TO_VOLTAGE 47 , 33 , 0 , 0, 0
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define SCALE_VOLTAGE 1.0 , 1.0 , 1.0 , 1.0 , 1.0

#define BATTERY_1_SOURCE VOLT_3 // not sure that this line is required
#define MAIN_BATTERY_SOURCE VOLT_3
#define NUMBEROFCELLS 3

If this is unclear, ask more.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXsensor Voltage measure with HOTT

Post by jhsa »

mstrens wrote: Thu Nov 29, 2018 12:34 pm
In the second case, you have to use at least 2 physical voltage dividers.
The cell 1 could be connected directly to e.g. pin A1
The cell 2 should be connected to a resistor (e.g. 33k), the other pin of this resistor should be connected to e.g. pin A2 and to a resistor of 10k ( the other pin of the 10k going to ground)
Please allow me to share something that I found.
By connecting cell 1 directly to the arduino pin, I get a "serial connection lost" alarm when I connect the oXs to the battery balance connector right after I turned the model ON, by just touching the oXs connector.

To avoid this, place a resistor in series (perhaps 10K) with the pin, but do not connect any resistor to ground.. This will also limit the current on the Atmega328 pin, protecting it..

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

billi
Posts: 3
Joined: Sat Nov 24, 2018 4:03 pm
Country: -

Re: OpenXsensor Voltage measure with HOTT

Post by billi »

Thanks for your reply,
That means, if I make the first case just measure one voltage, there is no chance to have the undervoltage warning threshold. I my case, I have the 3 cell Lipo e.g. 12,4 V and I would like to set the undervoltage warning at e.g. 10,5 Volt. Is that posible? I do not like to connect every time the battery sensor cable.

Franz

Post Reply

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