Jump to content
Forum sending old emails Read more... ×
oPossum

Volt/Amp/Watt meter

Recommended Posts

I have a doubt about the INA219 resolution. The bus voltage measurement has two full-scale ranges: 16V or 32V, but for what i understand from the datasheet the resolution is allways 4mV. This makes sense with the 16V range because it has a 12 bit adc, so 16/4096=0.0039 V

The 32 range should have twice that resolution, wright?

 

 

Share this post


Link to post
Share on other sites

The resolution of the bus voltage register is always 4 mV. The resolution of the ADC is programmable up to 12 bits. So in some cases the lower bit(s) of the bus voltage register may not change. The ADC reading is shifted internally as necessary to maintain the same reading granularity in the register.

Share this post


Link to post
Share on other sites

@@oPossum.... i tried to build the circuit as it is shown in the vam_meter_schematic picture file. but the LCD do not show anything. may i know if the capacitor u used in this is a ceramic ones or electrolytic capacitor?

The back light is working but it did not display the power up logo---> msp430 and INA219 

Edited by bluehash
[ADMIN] Issued opossum call.

Share this post


Link to post
Share on other sites

Ordinary ceramic monolithic caps.

 

Make sure your LCD module does not have a pullup resistor on the reset line - some do, some don't. If it does, you will have to remove it. The LCD reset circuit used by this project will not work with a pullup resistor on the LCD reset line.

Share this post


Link to post
Share on other sites

I packed an INA219 and a MSP430G2553 with a 128x64 OLED screen into a compact 6x3cm box to measure the volt-amp-watt of my fischertechnik models.

 

One simple bulb lamp uses almost 1W! So large models can easily add up to various amps... putting the batteries under heavy stress.

 

post-12238-0-42007000-1387313073_thumb.jpg

 

The screen comes from Digole and features an I

post-12238-0-20752400-1387313108_thumb.jpg

post-12238-0-18915400-1387313648_thumb.png

post-12238-0-90457800-1387313759_thumb.png

Share this post


Link to post
Share on other sites

Hi,

 

if I want to use two or three INA219's, do I need to worry about the V- and GND or when two V- are have the same starting point but V+ ( of course ) not, visa versa?

 

I wil do another display of course.

 

Thank you

Share this post


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.

 

The compiler will in-line optimise the methods if required (helps if declared "inline") - if the ports definitions are const (which they are) the optimisations should be exactly the same as a templated class - you instantiate a static instance of the LCD class anyway... not sure what, if anything, is gained from using templates here other than a whole bunch of typing... just wondering...

 

Further, using an initialiser list in the LCD constructor would allow class-local constants to be fixed during construction which is somewhat neater than using blank namespace or static consts and creates better encapsulation (compile -O3 or -finline-functions).

 

There should be no extra costs in memory/stack/efficiency in using this method, but there'd be a bunch less text and the code would arguably be a load clearer   :smile:

 

Nice project, BTW.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×