I am using the Wisper Node AVR, without radio.
My project also uses RTC Alarms, to do tasks.
I have closed the JP11. Even though the documentation doesn’t say so for the AVR, but I read the documentation for the LORA board which say to close the JP11. Closing the JP11 made my alarms work
To get voltage, I tried to include the T2WhisperNode.h library, - but it forces me to include the RH_RF69.h library, and that library uses the D3 or Interrupt 1 that I need for my RTC alarms. So, - it seems like I cant use RTC alarms and get voltage readings if I use the T2WisperNode library?
To solve that conflict, I tried to use analog reading on A6 and A7 setting the A0 high first, and use the formular from the dokumentation:
Voltage = (MAX_Voltage * ADC_Reading) / 1024
Voltage = (7.282 * 211) / 1024
Voltage = 1.5
My test code looks like this:
The output looks like:
Bat: 126.00
Vin: 234.00
Voltage Bat: 0.90
Power VIN: 1.66
Bat: 128.00
Vin: 235.00
Voltage Bat: 0.91
Power VIN: 1.67 …...
..
The factory firmware states: ...
:: Supply Voltages ::
Battery: 2790mV
Micro-USB/VIN: 0mV
What am I doing wrong, - code vice
?
My project also uses RTC Alarms, to do tasks.
I have closed the JP11. Even though the documentation doesn’t say so for the AVR, but I read the documentation for the LORA board which say to close the JP11. Closing the JP11 made my alarms work
To get voltage, I tried to include the T2WhisperNode.h library, - but it forces me to include the RH_RF69.h library, and that library uses the D3 or Interrupt 1 that I need for my RTC alarms. So, - it seems like I cant use RTC alarms and get voltage readings if I use the T2WisperNode library?
To solve that conflict, I tried to use analog reading on A6 and A7 setting the A0 high first, and use the formular from the dokumentation:
Voltage = (MAX_Voltage * ADC_Reading) / 1024
Voltage = (7.282 * 211) / 1024
Voltage = 1.5
My test code looks like this:
Code: Select all
#include <Arduino.h>
float Bat;
float Vin;
float MaxPowerVin = 7.282;
float MaxPowerBat = 7.282;
void GetPower()
{
Bat = analogRead(A6);
Serial.print("Bat: ");
Serial.println(Bat);
Vin = analogRead(A7);
Serial.print("Vin: ");
Serial.println(Vin);
Serial.print("Voltage Bat: ");
Serial.println((MaxPowerBat * Bat) / 1024);
Serial.print("Power VIN: ");
Serial.println((MaxPowerVin * Vin) / 1024);
}
void setup()
{
Serial.begin(115200);
digitalWrite(A0, HIGH);
}
void loop()
{
GetPower();
delay(1000);
}Bat: 126.00
Vin: 234.00
Voltage Bat: 0.90
Power VIN: 1.66
Bat: 128.00
Vin: 235.00
Voltage Bat: 0.91
Power VIN: 1.67 …...
..
The factory firmware states: ...
:: Supply Voltages ::
Battery: 2790mV
Micro-USB/VIN: 0mV
What am I doing wrong, - code vice
