INA219 support

62 views
Skip to first unread message

Leonardo Garberoglio

unread,
Apr 16, 2016, 7:25:57 PM4/16/16
to uavdevb...@googlegroups.com
Hi team
I made a litle Voltage/Curret/Power measurement using a TI INA219
It's configured by I2C and the same bus is used to read 3 variables
I write drivers for STm32 uC and I woul like to use it on matrixpilot

Could someone point me out to achive this?
What is the current way that mp use to read voltage and current?

BTW the other board is a "power switch" to switch on/off main supply (more than 40A) all of it is open hardware

thank

Robert Dickenson

unread,
Apr 16, 2016, 8:05:31 PM4/16/16
to uavdevb...@googlegroups.com
MatrixPilot has optional configuration for reading external analog signals via the ADC channels.

If you don't intend to use the optional magnetometer or barometer support (which currently share the external I2C bus), then you could develop an I2C driver to communicate with your device.

--
You received this message because you are subscribed to the Google Groups "uavdevboard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leonardo Garberoglio

unread,
Apr 16, 2016, 8:58:56 PM4/16/16
to uavdevb...@googlegroups.com
I understand that part.
Correct me if I'm wrong:
Voltage/current are measured using DMA driven ADC and on it interrupts it fill udb_analogInputs[].input array
and make some average (stored on udb_analogInputs[].value)
Then on calculate_analog_sensor_values you take udb_analogInputs[].value and scale it to Voltage, Ampere and Ampere Hour.

So, I need to add my code on calculate_analog_sensor_values, here I can use i2c to read volt / amp / and calculate Ah.
am I right?

Leonardo Garberoglio

unread,
Jul 3, 2016, 12:32:20 PM7/3/16
to uavdevboard-dev
Now that I have an official UDB5 I would like to add support for for my electric magnitude measurement board
It is an INA219 board and use I2C for measurement reading

What I2C bus is free on the board? is it I2C2? or is it I2C1?
I saw on magnetometer c that we coud use i2c1 or i2c2 and the same on barometer c

I think I have to create an ina219 c/h and try to implement register read/write and on heartbeatpulse after the call to     calculate_analog_sensor_values(); I could call to my ina 219 register reading

am I on the right direction?

thank
Reply all
Reply to author
Forward
0 new messages