INA219 I2C Power Monitor #31
Labels
new component
Creating a new component for this task
PRIORITY
Really important!
sensor
Relating to a sensor implementation
Milestone
What Does This Component Do?
The INA219 is an I2C Power Monitor that is currently used in the PROVES Kit to monitor the total power consumption of the system and also monitor how much power is coming from the solar charge circuit. This is accomplished by placing two INA219s on the Battery Board, one right after the battery inhibits and the other right before the solar charge circuit.
We want to create a generic INA219 component that can be duplicated to poll data from both of the sensors individually. This component should have the following functionality:
Bus Voltage
in VShunt Voltage
in mVCurrent
in mAPower
in mWBus Voltage
,Shunt Voltage
,Current
, andPower
as telemetry on a1hz
rate groupDesign Notes
Link to INA219 Product Page
Adafruit C++ Library
Adafruit C++ Library Reference
This should be a pretty straightforward sensor to implement the only tricky part will probably be to setup the logging and error handling. Power consumption is one of the most important pieces of telemetry to pull from the satellite because it informs us about whether our power budget is positive (generating more power than is used) or is negative (using more power than we generate. Additionally, sensing the
Bus Voltage
on the system power monitor is an indirect way for us to determine the battery voltage and estimate the state of charge on the batteries using that information.Eventually we will want to link this component with a
Satellite Health Component
that receives information from all the health sensors and is able to set power modes and deactivate components using too much power. Right now though we will start by just making a generic component that can get the data from the sensor and send it into logs.Example CircuitPython Implementation
Pretty straightforward stuff, on the CircuitPy code we just directly pass through sensor calls from the library into the
pysquared_eps
Satellite
object:Repeating as needed for the other voltage and current parameters. One of the interesting things to observe here is that we actually use a simple moving average to great 50 polling cycles of the power monitor before condensing it into a single number. This helps filter out moment to moment uncertainty in the measurement and would probably be a good idea to implement in some formal way in the F' component as well.
Example PicoSDK Implementation
This is one of the few parts of the satellite that currently has a working PicoSDK C++ Implementation!
From
ina219.h
From
ina219.cpp
In
pysquared.cpp
.Reference Schematic
The text was updated successfully, but these errors were encountered: