The INA3221 or rather one of the boards based around it, allows for a single power input and up to 3 power outputs –each monitoring voltage and current and all done via I2c.
You can (almost) think of this as a triple INA219 – the bidirectional current power monitor. If you recall, a little while ago, I added the INA219 to my ESP8266 software. I thought the INA3221 board might be better than three of the INA219 boards – but read on…
The difference here is a saving in cost – saving in number of devices you need to address and saving in size. I bought this one from AliExpress but you can get them on Ebay etc. I paid £2.15 – which seems reasonable.
Meanwhile over here I discovered some software to test the board with… it gets better, the software also worked first time – without even as much as a pair of I2c pull-ups.
And from there, for a while it all started to go downhill. From my stabilised power supply I put out 5.2 volts set to put out a maximum of 3 amps, just to be safe. Here is the output with no load:
Pretty much as you’d expect, 5.25v is near enough as my power supply only has one digit after the decimal point (got a much better one on the way).
The three outputs showing pretty similar results – I’d have preferred if they’d shown 0 amps but that’ll do. I took a large 2 ohm resistor – which you might reasonably expect to take 2.5 amps when faced with 5v. I put it across my supply – and sure enough – 2.32 amps. That is well within the likely 10% tolerance of my test resistors.
The voltage out of my power supply didn’t budge – and stayed rock steady.
After I recovered from burning my thumb and allowing the resistors time to cool off, I repeated the experiment more briefly and nothing had changed.
I picked one of the outputs and put the load across that instead of my power supply.
The input voltage was down to 4.98v which is fine because I will have lost power along the lead to the little monitor unit.. I had attached the load to output 3 which was showing an output voltage of 4.73 at 1.638 amps.
Something very wrong there… my power supply was saying 2.1 amps was being used… the software was saying 1.638 amps voltage drop. I checked the library header – sure enough – it said that the default resistor was 0.1R – I checked the board, sure enough R100….
And then reader NEIL wrote in to point out the mistake – I had ASSUMED these chips were similar to the INA219 – but they are not – there’s a maximum input voltage to the chip of 1.163.8 mV – put that through the default 0.1r resistor and you’re looking at 1.1 amps or so MAX. So – if you’re happy with that, fine – if like me you’d rather have over 2 amps AND a lower voltage loss, it is out with the fine soldering iron and replace those three 0.1r resistors with 0.05r resistors (remember to ensure you get high accuracy resistors or you’ll have to mess with calibration). The advert didn’t actually state the maximum voltage reading of the chip – I just made assumptions.
So rather than sit about, I tested the INA219 with the same kit, using software from here – and sure enough – 2.2 amps – absolutely correct.
So then I started thinking about making a little voltage/current meter using one or more of the INA219 boards – and as I had one hooked up anyway…. I looked at graphics – but then I figured I’d always be at a PC screen – and noticed an article on the PROCESSING system – available for Windows and Linux…. the first attempt was a partly modified USB Arduino voltmeter. Well, GUTTED more like it – here’s what it looked like after an hour or so – ignore the last reading.
I'm not sure why the origial author displayed voltages as points - it really didn't look good - but that was easy enouhg to fix and so my first working version is shown above. Do remember though that any such system involving a 0.1r resistor to detect voltage drop – and hence measure current - is always going to produce that voltage drop and lack of stability in the output – beats me why they don’t use a much lower voltage. There is no way around this…
So consider 0.1r… you feed it with, say, for simplicity 10 volts and draw 1 amp. So that is 1 amp going through the 0.1r resistor – you are GOING to lose 0.1v. Off load you lose nothing… so your super stable supply, assuming a variable load, how has a 0.1v ripple on it. Decide if that is important or not before using these boards. At 2 amps it gets worse, 0.2v.
It may be that the INA3221 is better (given that you are able to replace the 0.1r with a 0.05r resistor – or solder another 0.1r on top) even if you only use one channel.
Of course the above was just a starting point. several hours later having pulled out most of the original code to get just exactly what I need… a single working area with the three graphs in one. This is currently like a car before they put the decals on it… I’ve much more to add but it’s taking shape and is already useful. Here's the latest version...
And here’s a short video to give you a better feel for where I’m up to..