Jump to content
43oh

Volt/Amp/Watt meter


Recommended Posts

This is a simple voltage and current meter that uses the TI INA219 chip. Voltage measurement range is 0 to 26 volts with 4 mV resolution and current measurement range is -4 to +4 amps with 1 mV resolution (when using a 0.01 ohm shunt). The specs are inferior to a pair of quality multimeters, but it is a fraction of the price and shows wattage in addition to voltage and current. The Nokia 5110 display is used so the firmware could be enhanced to do simple graphing. Sending the measurements to a computer could also be done.

 

Using the INA219 makes for a very simple circuit.

post-2341-135135558819_thumb.png

 

The normal display is three lines with voltage, amperage and wattage.

post-2341-135135558794_thumb.jpg

 

Pressing the P1.3 switch will show the 6 registers in the INA219 in hex and signed decimal.

post-2341-135135558806_thumb.jpg

 

The code is written in C++ and uses templates for the LCD, IIC and INA219. Software SPI and IIC is used for maximum portability.

vam.zip

Link to post
Share on other sites

Using templates allows the compiler to do compile time optimization that is not possible with C or C++ classes. It knows the pins and ports won't change at run time, so it can generate optimal code for I/O. This results in code that is smaller, faster and uses less RAM.

Link to post
Share on other sites
Using templates allows the compiler to do compile time optimization that is not possible with C or C++ classes. It knows the pins and ports won't change at run time, so it can generate optimal code for I/O. This results in code that is smaller, faster and uses less RAM.

Nice technique. Now, I think you should put the method definitions of Nokia5110 inside the struct/class, to avoid repeating the whole template <...> before every definition. I don't know MSP compiler internals, but if you use -Os, it most likely won't inline the calls.

Link to post
Share on other sites

The accuracy is +/- 0.2% typical. That is similar to a low cost 3 1/2 digit DMM.

 

It alternates between current and voltage samples. It only has one ADC.

 

For 12 bit resolution it takes about 1 millisecond to sample both current and voltage, so about 1000 samples per second. The resolution can be adjusted down to 9 bits for an almost 10x increase in speed. It is also possible to average up to 128 samples.

 

Full details are in the spec sheet linked in the first post.

Link to post
Share on other sites
  • 2 weeks later...

Thank you for sharing this oPossum.

 

Is there a reason not to use hardware SPI when talking to 5110 besides compatibility with older chips? Or are there other issues, such as the D/C signal somehow getting in the way?

 

Also, am I correct to assume that 5110 is no longer manufactured and that the displays that we buy from ebay come from recycled phones? Is there a similarly cheap / easy to use display that is still in production and can be bought outside of ebay (e.g. from Mouser)?

Link to post
Share on other sites
  • 4 weeks later...

Very nice work! I just duplicate this. It makes a very nice meter for my bench power supply :) Still trying to see if my shunt resistor (0.01ohm .5%) is wrong or what but my amp meters (fluke 179 and a clamp meter) show 0.5A less than what the INA219 gives the code. I had to parallel a 0.1Ohm with the 0.01 to get the reading closer to my meters.

 

It looks sophisticated with the memory dump too :)

 

Thanks

 

-Thanh

Link to post
Share on other sites
  • 1 month later...

Was just looking at the code, and I have to ask, how are you getting anything for registers 3, 4, and 5 (Power, Current, and Calibration), if you never set the calibration register? On power-on, the calibration register should be blank, as should the power and current (because anything multiplied by 0 is 0)?

Link to post
Share on other sites

First post , looks like a great forum so far. I have been looking to make a simple voltmeter that outputs to a binary style display using Led's , that would end up being up to the 16's place. Basically long story short , I'm looking to make a test light for automotive wiring (low load preferable , but I have a great multimeter for CMOS lines) .

 

Any idea how to output from the 430 to a binary display?

 

 

Thanks

-hov

Link to post
Share on other sites
  • 4 weeks later...

The accuracy is +/- 0.2% typical. That is similar to a low cost 3 1/2 digit DMM.

 

It alternates between current and voltage samples. It only has one ADC.

 

For 12 bit resolution it takes about 1 millisecond to sample both current and voltage, so about 1000 samples per second. The resolution can be adjusted down to 9 bits for an almost 10x increase in speed. It is also possible to average up to 128 samples.

 

Full details are in the spec sheet linked in the first post.

Opossum.. can I use this in conjunction with the DP ATX breakout board to detect an over current situation (by sampling current)

 

This would help me to:

- Adjust the current threshold.

- Relay the voltage rail off when current reaches threshold.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...