Hello,
For testing purposes, I’ve my power module connected to regulated power supply and the 6 pin cables is connected to an Arduino Uno (Analog pin), I’m trying to measure voltage value like this.
I wrote this Arduino code. which would read analog pin and convert the value from 0-1023 to 0-5V.
//pin1 - current
//pin2 - voltage
int pin1 = A1;
int pin2 = A3;
float current = 0.0;
float voltage = 0.0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
current = analogRead(pin1);
// multiply by 5/1023 to convert to volts
voltage = analogRead(pin2)*0.00488759;
//Serial.println(current);
Serial.println(voltage);
}
For a certain voltage from my regulated power supply, I get fluctuating values in Serial monitor.
Here's the output:
My intuition here is that I would require some kind of filtering to get rid of bad datapoints.
Does anyone how this data is filtered when we see it QGroundControl?
Could anyone point out the firmware page for this code?