MIAC Volt Meter

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
mimiyum
Posts: 94
Joined: Wed Jul 16, 2008 4:39 pm
Location: Philippines
Been thanked: 1 time
Contact:

MIAC Volt Meter

Post by mimiyum »

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!
Attachments
Digital Volt Meter IO-LR.fcf
(8.5 KiB) Downloaded 623 times

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: MIAC Volt Meter

Post by Sean »

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

mimiyum
Posts: 94
Joined: Wed Jul 16, 2008 4:39 pm
Location: Philippines
Been thanked: 1 time
Contact:

Re: MIAC Volt Meter

Post by mimiyum »

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!

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: MIAC Volt Meter

Post by Sean »

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).

mimiyum
Posts: 94
Joined: Wed Jul 16, 2008 4:39 pm
Location: Philippines
Been thanked: 1 time
Contact:

Re: MIAC Volt Meter

Post by mimiyum »

Thanks Sean for your very clear explanation! It puts things into proper perspective for me.

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: MIAC Volt Meter

Post by medelec35 »

mimiyum wrote:Errr...can we work around the computations to get another digit? I want to get figures like 1.234 volts?
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.
DVM.jpg
DVM.jpg (37.32 KiB) Viewed 8898 times
Attachments
Digital Volt Meter IO-LR.fcf
(8 KiB) Downloaded 624 times
Martin

mimiyum
Posts: 94
Joined: Wed Jul 16, 2008 4:39 pm
Location: Philippines
Been thanked: 1 time
Contact:

Re: MIAC Volt Meter

Post by mimiyum »

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. :idea:

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

Thanks again!

Post Reply