Reference
Library
- DFRobot_INA219 Library (for Arduino)
- DFRobot_INA219 RaspberryPi library (for Raspberry Pi)
Principle
The module adopts TI INA219 zero temperature drift current/power monitoring chip and 2W high power low temperature drift 10mΩ alloy sampling resistor. The voltage and current resolution can reach 4mV and 1mA respectively. Under the full scale measurement condition, the maximum relative error of voltage and current measurement is lower than ±0.2%. It provides also four I2C addresses that can be configured via the 2P DIP switch. The module accurately measures bi-directional high-side currents (current flowing through the power supply or battery positive), which is especially useful in solar or battery fuel gauge applications where the battery needs to be charged and discharged. This status can be simply determined by positive or negative current readings. In the motor applications, the current can be monitored in real time by monitoring whether the motor current is too large due to overload. In addition, you can use this module to measure the power consumption of various electronic modules or the entire project to evaluate battery life.
Other Supplementary Information
Applications
-
Measuring power consumption electronic modules
Many electronic modules do not clearly indicate the operating current of the module. The following figure (taking the SEN0161-V2 Gravity: Analog pH Sensor as an example) shows how to measure the power consumption of the analog pH sensor by connecting the Gravity: I2C digital power meter between the VCC of the controller and the sensor in series. Such consumption measurement is simpler and more intuitive than measuring current and voltage by using the multimeter separately.
-
Monitor the power consumption of the solar panel, battery and outputs in a solar system
In a typical solar system as shown below (taking the Solar Power Management Module For 12V Lead Acid Battery as an example). Four Gravity: I2C digital Wattmeter are used to monitor the voltage, current and power of the solar panel, battery and two output terminals OUT1 and OUT2, respectively. Each meter is configured by a DIP switch to a different I2C address. They are connected in parallel to the same controller, which records the energy data of each meters (nodes).
For the solar panel, in addition to the voltage, current and power, we maybe more concern about the accumulated electrical energy generated over a period of time. This period may be a day, or it may be several weeks or even months. The time recording can be achieved by adding an RTC module to the controller. Accumulated Power Generation can be obtained by integrating the power with time. For example, sum P power (W) every 1s to obtain the E (electrical) energy (J). This can be converted into another unit Wh by E/3600, or kWh by E / (3.6 × 10 ^ 6) .
For the battery, the wattmeter measures the capacity of the battery by measuring the charge and discharge current. Note that IN+ is directly connected to the positive terminal of the battery, and IN- is connected to the positive input terminal of the BAT IN of the power management module. When the reading is positive, current flows from IN+ to IN-, indicating that the battery is discharging. When the current reading is negative, current flows from IN- to IN+, indicating that the battery is charging. Therefore, the charge and discharge state of the battery can be determined by the positive and negative values of the current. Capacity (Ah), remaining power of the battery is another parameter we may concern. Similar to recording the Accumulated Power Generation, integrating the current with time to get the Capacity (Ah). To obtain a more accurate capacity of the battery, battery can be first fully charged with the power management module and a laptop power adapter (rated output voltage 19V or 20V and power at least 65W). Then, the battery is discharged at one of the OUT terminal until the output is turned off. The Capacity (Ah) is then recorded using the wattmeter at the battery side. Of course, the battery capacity is also related to a number of factors such as the discharge current, the temperature, and the number of cycles the battery has been used. However, the capacity obtained by this method is much more accurate than the nominal capacity of the battery.
For the output terminal OUT, the Accumulated Power Consumption is another power statistic worthy of attention, and its calculation is similar to Accumulated Energy Generation.
It is worth noting that Accumulated Energy Generation is usually larger than the sum of the other three Accumulated Power Consumption (assuming the battery is always charging, that is, all three are sourced from solar panels). Excluding the measurement error of the wattmeter, the difference between the two mainly comes from various types of wire and conversion loss, such as: loss of the power management module, loss of the module sampling resistor, and loss of the connection wire and the terminal contact resistor etc. Users can take these losses into account according to the actual application scenarios.
Most solar management modules include battery protection circuitry that disconnects BAT- from GND. If you connect BAT- directly to GND as shown above, the protection circuit will no longer be able to isolate the battery, effectively disabling the battery protection function.
Was this article helpful?
