Home - Search - Members
Full Version: Help to program a voltmeter.
firefly88
Jun 16 2008, 2:49 AM
I am making a voltmeter using Keil uvision2. I have no idea how to start, anyone can help me ....

The microcontroller receive digital data from ADC and display it on the lcd panal. The diagram is in the attach.
untitled.zip Many thanks to anyone who can help!!!
Arun Kumar V
Jun 16 2008, 5:47 AM
Hello firefly,

i have done the same project, but in assembly language, normal input is 0 - 5 V, in my other version you can measure 0 - 15 V with 8 bit resolution.

let me know how far you have come in your project, and i'll help








Arun

Ajay
Jun 16 2008, 7:58 AM
It looks nice arun
why don't you add it to download?
firefly88
Jun 16 2008, 5:59 PM
Hi arun i have done the project in c programming and now i would like to use assembly languange but with little knowledge about it. As assembly languange are more easy to understand, can youu post your assembly languange code as i would like to analyze how it works. Thank you!!!
Arun Kumar V
Jun 16 2008, 7:22 PM
Hello Ajay,

yes i can post my project in download section, i have a collection of my projects which i' ll post when the particular topic/concept arises.

Firefly88 : if you have already done this project in C then where is the problem in doing it in Assembly, the Algorithm remains the same, isn't it ?

in your first post this is what you said :

I am making a voltmeter using Keil uvision2. I have no idea how to start, anyone can help me ....

The microcontroller receive digital data from ADC and display it on the lcd panal. The diagram is in the attach.
untitled.zip Many thanks to anyone who can help!!!



start the code in assembly and i' ll help step by step here in the forum , keep in mind that the Serial ADCs are different from each other, read the datasheet before using them in your project


all the best then !

Arun
firefly88
Jun 25 2008, 7:44 PM
Hi! Arun,
I have a problem, my voltmeter display for the second decimal place is not stable. It keep changing. Do you have any idea why the display is not stable or is there any solution for it. Thank you.
pdi33
Jun 25 2008, 7:56 PM
Hi firefly,

Check the voltage input to the ADC.maybe the source to the ADC itself has ripples or is unregulated. If that is the case do the following:
1.check if ur power supply is stable. Use adequate capacitor for filtering the output
voltage.
2.If u are using a op-amp for processing the voltage then connect a 0.1uF cap between the inverting terminal to the output terminal of the op-amp(i.e. between pin2 and pin6 in case of 741).

If u still don't get it , try averaging the ADC data in ur code.
btw what ADC are u using? post ur ckt. diagram, if possible,to help u better.
firefly88
Jun 26 2008, 6:02 PM
Hi pdi33,
I use ADC AD7896 and the circuit is in my first post.
firefly88
Jun 26 2008, 6:33 PM
And when zero volt my display will show 0.1V.
pdi33
Jun 26 2008, 8:16 PM
hi frefly,
well, the ADC u r using is the fast type which uses successive approx. technique So there is bound to be some fluctuations in the reading.First check the points i mentioned previously and confirm that the supply voltage and the voltage to the input of the ADC is free from ripples and is steady.Then try to seperate the Analog and digital grounds of ur circuit and terminate them to the output capacitor negative terminal.This would eliminate any high frequency noise of ur digital circuit to interfere ur analog section thro a common ground return path.
All this will significantly reduce ur fluctuation part.
Lastly, u have to put an averaging algorithm to stabilise the reading.
To average the ADc value, just add n samples of the ADC reading and then divide the total by n. try initially by putting n=10.The ADC is really fast (8uS/sample) so updating ur data shouldn't be a problem.
Good Luck.

As for the zero reading part, have u checked that by shorting the vin and AGnd terminal?.
Another doubt is whether u are directly applying the input voltage to the ADC directly or through some op-amp signal conditioning circuit?


btw, how much does the ADC cost there?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007