voltage not correct measured???

For Formula Flowcode Micromouse users to discuss projects, flowcharts, and any other issues related to the Formula Flowcode Micromouse.

Moderator: Benj

Post Reply
Frank
Posts: 5
Joined: Thu Feb 07, 2008 11:13 am
Contact:

voltage not correct measured???

Post 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 1091 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: voltage not correct measured???

Post 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.
Martin

Frank
Posts: 5
Joined: Thu Feb 07, 2008 11:13 am
Contact:

Re: voltage not correct measured???

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: voltage not correct measured???

Post 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.
Martin

Post Reply