Documentation ¶
Overview ¶
Package ina219 controls a Texas Instruments ina219 high side current, voltage and power monitor IC over an i2c bus.
Calibration ¶
Calibration is recommended for accurate current and power measurements. Voltage measurements do not require sensor calibration. To calibrate, measure the actual value of the shunt resistor.
Datasheet ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOpts = Opts{ Address: 0x40, SenseResistor: 100 * physic.MilliOhm, MaxCurrent: 3200 * physic.MilliAmpere, }
DefaultOpts is the recommended default options.
Functions ¶
This section is empty.
Types ¶
type Dev ¶
type Dev struct {
// contains filtered or unexported fields
}
Dev is a handle to the ina219 sensor.
func (*Dev) Sense ¶
func (d *Dev) Sense() (PowerMonitor, error)
Sense reads the power values from the ina219 sensor.
type Opts ¶
type Opts struct { Address int SenseResistor physic.ElectricResistance MaxCurrent physic.ElectricCurrent }
Opts holds the configuration options.
Slave Address ¶
Depending which pins the A1, A0 pins are connected to will change the slave address. Default configuration is address 0x40 (both pins to GND). For a full address table see datasheet.
type PowerMonitor ¶
type PowerMonitor struct { Shunt physic.ElectricPotential Voltage physic.ElectricPotential Current physic.ElectricCurrent Power physic.Power }
PowerMonitor represents measurements from ina219 sensor.
func (PowerMonitor) String ¶
func (p PowerMonitor) String() string
String returns a PowerMonitor as string