Page 1 of 1

voltage not correct measured???

Posted: Tue Mar 01, 2011 9:07 pm
by Frank
Hi,

I'm making a voltmeter with a flowcode buggy and a LCD from E-blocks on the D-port.
I try to use the ADC as a 10-bit converter.

After simply using the command ReadAsVoltage, the result is placed into a floating point variable.
Then the floating point is converterd to a string and placed on the LCD. (see program attached)

When I try in real time this program I measure for example 1V with the multimeter, while on the LCD 1.3V is displayed.
Mesauring 2V gives 2.6V on the LCD. ...

I'm wondering were this problem is come from.
Thus anybody knows how this comes or how I can fix this easily?

greetings,
Frank
voltmeter v4 met floating points.fcf
(7 KiB) Downloaded 1111 times

Re: voltage not correct measured???

Posted: Wed Mar 02, 2011 12:38 am
by medelec35
Hi Frank,
I tested the flowchart you posted and with i/p voltage set at 1.00V (checked with a calibrated DMM), LCD displayed 0.99
with i/p voltage set at 2.00V, LCD displayed 1.97
so I don't get same error as you. So maybe you can look at your hardware, including +5V supply, Voltmeter etc.
Not sure if you are aware, but to get same result you don't require float variable at all.
Try this:
Read as string
print string on LCD. Simple as that and saves space on chip.
No conversions required. The voltage format stays the same. E.g if measure 1.23V, LCD will display 1.23 (maybe slightly different due to conversion errors)

Also some time ago, I posted a voltmeter flowchart, which had a built in bar graph function.
Thread is here:
http://www.matrixmultimedia.com/mmforum ... 99&p=20336
To get LCD to display 0 - 5 V then you need to delete *3 in the calculation box.

Re: voltage not correct measured???

Posted: Thu Mar 03, 2011 8:40 pm
by Frank
Hi,

You are right about the wrong +Vref voltage.
Normally the FFrobot is battery powered. So, because of a diode in the power circuit, the VDD = +Vref of the controller is maximum 4.3V instead of 5V.
Very normal that the calculation results of the µC where wrong.

I changed the power by a regulated power supply of 5.7V on the battery connector of the robot.
This gives the µC 5V exactly.
Now the display gives the correct value I should expect. 1V is 1V.

So thanks for the tip ;)

greetings,
Frank

Re: voltage not correct measured???

Posted: Thu Mar 03, 2011 10:07 pm
by medelec35
Your welcome. Just glad you got it sorted easily enough. What I would do to get 5.7V is get a 5V regulator, and connect a diode from common to ground. Anode at common terminal, cathode connected to ground. Mentioning this for any one else who requires a slightly higher voltage as you may have already done it this way.
Thanks for letting us know on the forum.