I tried the Digital Volt meter sample program on my MIAC. That works fine resulting it voltage readings of up to 1 decimal point.
In my attempt to get a reading of up to 2 decimal points, I edited the program and when I download this to my MIAC, I get a zero reading instead. Can you please check my program to see what I did wrong. By the way, simulation of this program works fine. I just doesn't work on the actual MIAC.
Thanks!
MIAC Volt Meter
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: MIAC Volt Meter
Hello,
The calculations are failing at the line:
Voltage = Value/19.6
Floating-point values can not be used in integer calculations.
The MIAC analog inputs have been designed to provide a simpler conversion between the ADC value and true voltage. The divider of 20 should provide you with an accurate conversion (<1% error).
I have run your program successfully with the line modified to:
Voltage = Value/20
The calculations are failing at the line:
Voltage = Value/19.6
Floating-point values can not be used in integer calculations.
The MIAC analog inputs have been designed to provide a simpler conversion between the ADC value and true voltage. The divider of 20 should provide you with an accurate conversion (<1% error).
I have run your program successfully with the line modified to:
Voltage = Value/20
-
- Posts: 94
- Joined: Wed Jul 16, 2008 4:39 pm
- Location: Philippines
- Been thanked: 1 time
- Contact:
Re: MIAC Volt Meter
Thanks Sean! That works fine.
Errr...can we work around the computations to get another digit? I want to get figures like 1.234 volts?
Is the factor really 2 or is it 1.96 or another number?
Thanks again!
Errr...can we work around the computations to get another digit? I want to get figures like 1.234 volts?
Is the factor really 2 or is it 1.96 or another number?
Thanks again!
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: MIAC Volt Meter
The ideal conversion factor for ADC input value (8-bit mode) to voltage is 19.968 (79.872 for 10-bit). This part of the circuit uses resistors with a 1% tolerance, so 20 is a realistic approximation.
Using either 8- or 10-bit conversions, there is a limit of a maximum of 2 decimal places of resolution when displaying the measured voltage.
10-bit mode can be useful for detecting smaller voltage changes than 8-bit can detect (precision), but the absolute values should only be considered to be accurate to apprximately 1% or 50mV, whichever is greater (12.5mV for 10-bit).
Using either 8- or 10-bit conversions, there is a limit of a maximum of 2 decimal places of resolution when displaying the measured voltage.
10-bit mode can be useful for detecting smaller voltage changes than 8-bit can detect (precision), but the absolute values should only be considered to be accurate to apprximately 1% or 50mV, whichever is greater (12.5mV for 10-bit).
-
- Posts: 94
- Joined: Wed Jul 16, 2008 4:39 pm
- Location: Philippines
- Been thanked: 1 time
- Contact:
Re: MIAC Volt Meter
Thanks Sean for your very clear explanation! It puts things into proper perspective for me.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: MIAC Volt Meter
I have done that for you and I have changed resolution from 8 bit to 10 bit and used 79.872 as a value in the calculations. The only purpose of doing all of these is to demonstrate how it is achieved for educational purposes. As you know Sean and Ben + Sean (in a different post) said would not improve accuracy since accuracy is determined by resistors and opamp. Hope it helps you.mimiyum wrote:Errr...can we work around the computations to get another digit? I want to get figures like 1.234 volts?
- Attachments
-
- Digital Volt Meter IO-LR.fcf
- (8 KiB) Downloaded 647 times
Martin
-
- Posts: 94
- Joined: Wed Jul 16, 2008 4:39 pm
- Location: Philippines
- Been thanked: 1 time
- Contact:
Re: MIAC Volt Meter
Thanks Medelec for the demonstration. I was really using this for my educational purposes---as a way to learn more about accurate ADC reading for other applications.
Now, I will attempt to apply the concept on a 16F88 or 16F877a.
Thanks again!

Now, I will attempt to apply the concept on a 16F88 or 16F877a.
Thanks again!