Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] confuse to displaying the average adc value using codevisonavr

Status
Not open for further replies.

johaniskandar

Newbie level 3
Joined
Sep 25, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
17
please help, how solve the fluctuated adc value using codevisionavr? i will just to display the average value of it on lcd 16x2. thx very much
 

can you please elaborate Your Question?
Its Difficult to understand...
 

Fluctuating ADC reading most of the time caused by noise. Try power your device using battery and keep away from mains, if the reading is getting better then it is positively the 50/60 mains noise is injected to the adc input. Some filtering needed, also averaging large number of adc samples can help a bit.
 

I m sorry my mean is just want to scanning adc value during a minute and then dispalying the average value on lcd.,
 

buffer in at an array and than take the average...
like
Code:
int i ;
long sum  = 0;
for(i = 0; i < "your Limit say 50"; i++)
array[i] = read_adc();
for(int x = 0; x < i; x++ )
{
sum = array[x] ;
}

average =sum / i;


i think This Do.... I hope
 

Thx u very much for your replies, i will try. I hope the code is work
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top