Measure Current/Voltage with INA219 Current Sensor
Post ReplyMeasure Current/Voltage with INA219 Current SensorPosted: Saturday, February 11, 2017 [19:25:51] - 1
Wiring INA219 I2C current sensor to Raspberry Pi: Configuring I2C: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c Python Port for INA219/I2C library: https://github.com/scottjw/subfact_pi_ina219 A quick example to query INA219 module: import time SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 2 ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS) ina.configure(ina.RANGE_16V) bvolt = "%.3f" % ina.voltage() shvol = "%.3f" % ina.shunt_voltage() curr = "%.3f" % ina.current() pwr = "%.3f" % ina.power() tvolt = "%.3f" % ( ina.voltage() + ina.shunt_voltage() / 1000 ) print ("\tBus voltage: " + str(bvolt) + "V\n\tShunt voltage: " + str(shvol) + \ "mV\n\tCurrent: " + str(curr) + "mA\n\tPower: " + str(pwr) + "mW\n\tVoltage: " + str(tvolt) + "V\n") time.sleep(1) Great resource for Solar/battery/load power logging with Raspberry Pi and INA219: https://binaryfury.wann.net/2014/04/solarbatteryload-power-logging-with-raspberry-pi-and-ina219 Fairly easy to setup. |
RE: Measure Current/Voltage with INA219 Current SensorPosted: Thursday, May 19, 2022 [14:06:56] - 2
Posted by:SamPosts: 3 | Do you have a diagram for YHDC current sensors? |