I need to measure the power consumption of a circuit I have built. The components are as follow:
- Lipo battery 500mAh
- Accelerometer
- RTC
- RedBear Nano 2
Usually I measure the consumption using an Arduino and its analogical pin. The level of accuracy is enough. In this case my idea is to attach to every component a relatively small resistor and see which is the voltage of this resistors. Comparing this values to the battery voltage I should get an idea of how much power consumption I have. Is that correct, am I missing something?
The picture shows the configuration I wanna make, the green annotation represents the measures I will take with an Arduino.
The Arduino code I am using for a single analog pin is the following:
int Re = 1000;
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
float current = voltage / Re;
Serial.print(millis());
Serial.print(",");
Serial.print(voltage, 10);
Serial.print(",");
Serial.println(current, 10);
delay(500);
}
EDIT: What I am trying to measure is basically how much time my circuit can be on. Thus, let say that 2 or 3 days of variance in the result can be manageable.