I have a NAVIO2 with a power module, both bought from EMLID store.
I would like to monitor the battery state through the battery voltage and current signals.
So far I think that the ADC is 12-bit, so the ADC.read() returns 0…4095 for conversion and -1 for error.
Could anyone help me with the followings:
What is the reference voltage of the ADC?
The example divides the ADC readouts with 1000 and prints out [V] units. Does this mean the ADC ref is 4.096V?
What are the voltage and current scalers in the power modul (ADC A2 and A3 channels)?
I have found a thread in the community forum about an experimental approach (estimating the current scaler from the charge, reported by the battery charger), but I think there could be a more direct answer to this.
Yes, I am aware of the help docs. It nicely lists the mapping of the A0-A5 channels.
What I wanted to know is 1V on the ADC0 pin means how many Volts on the battery? Or similarily, 1 V on ADC1 pin means how many Amps through the battery?
With the multimeter I can measure both the battery and the ADC0 voltages, so the voltage scaler seems to something like 11.
I have not made any measurments on the current though. If you could give the scaler, that would be very helpful.
These parameters could come from the power module.
From what I can see from the ADC example output there is no further scaler on the A2 channel, and I can imagine the same on A3, but I have no input on that.
There must be something on the A0, A1, A4, A5, but those must be taken care of inside the RCIO.
I think my confusion was that initially I thought that the adc.read() gives back the 12-bit ADC values, but now I can also imagine that it gives the voltages in mV (with resolution, reference, on-board scalers applied).
I still can’t explain the 18V on the A1 channel, but I opened another topic on that one earlier.
I am using Navio2.
When I run the ADC example I can see strange readings on the A1 channel (servo rail voltage):
A0: 5.1960V A1: 18.3260V A2: 1.4720V A3: 0.0000V A4: 0.0180V A5: 0.0260V
However I can measure the servo rail voltage with a volt meter and it is 5.01V.
From the example I can see that the ADC value is divided by 1000 to get the voltage level, so for 18.326V the ADC value must have been 18326, which seems to be wrong for a 12-bit ADC.
Am I missing something?
My Navio2 seems to be OK and up-to-date:
pi@navio:~ $ emlidtool
emlidtool version: 1.0.8
Vendor: Emlid Limited
Product: Navio 2
Issue: Emlid 2018-06-05 831f3b08594f2da17dccae980a2e3659115ef71f
Kernel: 4.14.95-emlid-v7+
RCIO firmware: 0xb09979ae
2019-03-09 13:00:17 navio root[20288] INFO rcio_firmware: Passed
2019-03-09 13:00:17 navio root[20288] INFO adc: Passed
2019-03-09 13:00:17 navio root[20288] INFO pwm: Passed
2019-03-09 13:00:17 navio root[20288] INFO rcio_status_alive: Passed
2019-03-09 13:00:17 navio root[20288] INFO lsm9ds1: Passed
2019-03-09 13:00:17 navio root[20288] INFO gps: Passed
2019-03-09 13:00:17 navio root[20288] INFO mpu9250: Passed
2019-03-09 13:00:17 navio root[20288] INFO ms5611: Passed
emlidtool -h to get more help
pi@navio:~ $ emlidtool rcio check
Nothing to update! You are using the newest firmware.