Page 1 of 1
Volt meter
Posted: Mon Mar 01, 2010 9:05 am
by jgu1
Hi!
I try to make a Voltmeter by using of course an analog input and write the result on LCD. I tryed several eksambles, but I dont understand the formel/calibration I have to put in caculation. I like to redout in 2 decimal Eks 2.31V and readout in display 2.31V. And how does the calculation look If I want to read in the display 0 -10V by input from 0-5V still with 2 decimal, 5Vin and readout 10.00V on diplay
Will somebody give me an eksable.
Thangs in advance.
JΓΈrgen.
Re: Volt meter
Posted: Mon Mar 01, 2010 10:33 am
by Benj
Hello Jorgen
The ADC function ReadAsVoltage will return the ADC result as a floating point variable containing the voltage. The function ReadAsString will return the Voltage as a string which you can output directly to an LCD.
Re: Volt meter
Posted: Mon Mar 01, 2010 10:52 am
by jgu1
Hi Ben.
Ok, thankΒ΄s Ben. Of course I will try to do my best. But will you please be so kind and give me a couble of exambles, I am a little novice.
Like this: If I give an input from 0- 5V and get a readuot on the display 0.00 - 5.00V
And input from 0 - 5V and get a readout on the display 0.00 - 10.00V
Then I think I will be able to see the "ligth".
Thank's
Best regard
JΓΈrgen
Re: Volt meter
Posted: Thu Sep 23, 2010 7:41 am
by jadiflow
Benj wrote:Hello Jorgen
The ADC function ReadAsVoltage will return the ADC result as a floating point variable containing the voltage. The function ReadAsString will return the Voltage as a string which you can output directly to an LCD.
Hi Ben,
Nice touch! Just what I need for my current project. I'm curious though how this is scaled - doesn't the ADC basically return a fraction of the supply voltage?
Doesn't ReadAsVoltage need the supply voltage value to work?
If I have a 3.3V supply, does that mean the max voltage I can 'measure' this way is 3.3V?
thanks for your help,
jan didden
Linear Audio
Re: Volt meter
Posted: Thu Sep 23, 2010 2:42 pm
by Benj
Hello Jan,
The chip voltage or the +VREF voltage is defined in the ADC component properties.
E.g. if your running on a 3.3V system then change the Vref voltage from 500 (5V) to 330 (3.3V) and the read as voltage and read as float should scale appropriatley.