A3 & A4 reading 10x real values

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

A3 & A4 reading 10x real values

Post by Chrisbott »

I've built a sensor to report A3, A4 and Altitude only.
My problem is that A3 and A4 show up on my Horus X12 as 10X the actual values as measured with a multimeter. i.e. a 6.6V LiFe battery reads 66V on the Horus.
I'm using a Pro-Mini 3v3 8Mhz and have programmed with the right IDE settings.
Basic
// ***** 2.1 - Frsky data *****
//#define VFAS_SOURCE VOLT_5
//#define FUEL_SOURCE ADS_VOLT_1
#define A3_SOURCE VOLT_1
#define A4_SOURCE VOLT_2

Advanced
// --------- 6 - Voltages & Current sensor settings ---------

// ***** 6.1 - Voltage Reference to measure voltages and current *****
//#define USE_INTERNAL_REFERENCE
//#define USE_EXTERNAL_REFERENCE
#define REFERENCE_VOLTAGE 3422 // as measured

// ***** 6.2 - Voltage parameters *****
#define PIN_VOLTAGE 0 , 1 , 8 , 8 , 8 , 8
#define RESISTOR_TO_GROUND 0.982 , 0.982 , 0 , 0 , 0 , 0 // as measured - 1K resistors
#define RESISTOR_TO_VOLTAGE 4.634 , 4.626 , 0, 0 , 0 , 0 // as measured - 4K7 resistors
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0
#define SCALE_VOLTAGE 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0

Any thoughts would be very much appreciated.What have I missed?

User avatar
MikeB
9x Developer
Posts: 17992
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: A3 & A4 reading 10x real values

Post by MikeB »

The FrSky spec. for A3 and A4 is to send the actual voltage measured (0 to 3.3V) in units of 0.01V (10mV).
The value received at the Tx then needs to be scaled to give your required voltage reading.

However, you could try setting the SCALE_VOLTAGE value to 0.1.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Chrisbott
Posts: 33
Joined: Sun Aug 06, 2017 3:43 pm
Country: -

Re: A3 & A4 reading 10x real values

Post by Chrisbott »

Scale voltage fixes it very nicely thanks Mike.

I'm still not fully understanding but I'm fine with that.
The actual measured voltage, when 6.6v is applied via my potential divider is around 1.16v
This must be being scaled by the values in the #define RESISTOR lines before being displayed as 66V (now 6.6 after I set scale to 0.1)
It's doing the job I want though, so many thanks for the suggestion.

Post Reply

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