Hello,
I am trying to measure the complete power consumption of a circuit. In this circuit I have four components,:
- 1 Lipo battery (500mA)
- 1 RTC (DS3231)
- 1 Accelerometer (ADXL 345)
- 1 RedBear Nano2
I would like to get the power consumption of each component, and the general power consumption, so the discharging curve of the battery. Right now I am using an Arduino Uno as a multimeter, the code is reported below:
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
float current = voltage / 1000;
Serial.print(millis());
Serial.print(",");
Serial.print(voltage, 10);
Serial.print(",");
Serial.println(current, 10);
delay(500);
}
I have also an Arduino Due if more analogical Pin are needed, and I have resistors of different values.
My idea is to put each component in parallel with the battery and connect to each component a relatively small resistor and analyze the current and the voltage of this resistors. In this way I should get the actual voltage of each sensor in the circuit. Comparing it to the battery voltage I should get the measures I want. Is that idea correct? Should I change something?
Than you.
