FTDI Community

General Category => Shared Projects => Topic started by: FTDI Community on September 21, 2017, 04:53:20 PM

Title: USB Current and Voltage Monitor
Post by: FTDI Community on September 21, 2017, 04:53:20 PM
Hi Everyone,

Here is a small project that our Applications engineers designed using a UM232H module (http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UM232H.pdf) in MPSSE mode. It acts as a USB to I2C Master bridge to take readings from a Texas Instruments INA219 current and voltage monitor. It also provides a couple of GPIO input lines and (most importantly of course) a flashing LED!

It connects in-line with a USB device and tracks how much current it is drawing from the host as well as the voltage on the VBus line. The 0.1" connector on the rear panel can be used instead if you want to connect it to measure other circuits via jumper wires. This can be really useful when debugging your own circuits and checking how much power they will require.

A program written in Visual Basic NET displays the results on a scrolling chart with different range settings. You can modify the code to talk to other I2C sensors as well though.

Here are some pictures showing the meter itself and a chart showing a USB flash drive which was connected and enumerated accessing a file on the disk.

(https://s26.postimg.org/tqyzx8gi1/Meter_Inside.jpg)
(https://s26.postimg.org/kyi19jvd5/Screenshot.png)


We have written a document on the project as well as publishing the source code, and you can find these at the links below:

AN_355 (http://www.ftdichip.com/Support/Documents/AppNotes/AN_355_FT232H%20MPSSE%20Example%20-%20I2C%20Master%20Interface%20with%20Visual%20Basic.pdf)
Source Code (http://www.ftdichip.com/Support/SoftwareExamples/CodeExamples/VB/AN_355.zip)

We hope this gives you some ideas for some projects of your own ...

Best Regards,
The FTDI Team