Page 1 of 1
ADC NOISE REDUCTION in AVR
Posted: Tue Oct 12, 2021 5:45 pm
by RABO2320
Hi
please guide me.
How to enable ADC noise reduction mode in AVR.
Re: ADC NOISE REDUCTION in AVR
Posted: Tue Oct 12, 2021 7:52 pm
by medelec35
Hi, RABO2320.
There are several things you can do.
1. Have conversion speed within POT properties set n the max e.g FOSC/128
2. Use GetAverageByte or Use GetAverageInt macro.
3. Use a suitable capacitor across ADC and GND
4. Make sure Supply voltage is stable.
Re: ADC NOISE REDUCTION in AVR
Posted: Tue Oct 12, 2021 9:33 pm
by Benj
Hello,
A common Avr circuit uses a 10uH inductor between vref and vcc and a 100nf cap between vref and gnd. Then in your adc settings switch to use the external vref. This should help to get rid of some noise.
Martins suggestions are also very useful.
Re: ADC NOISE REDUCTION in AVR
Posted: Wed Oct 13, 2021 4:19 pm
by RABO2320
thank you so much medelec35
thank you so much Benj
I want the code that activates the ADC noise reduction mode.
What is this code and how can this code be used?

Re: ADC NOISE REDUCTION in AVR
Posted: Wed Oct 13, 2021 7:32 pm
by medelec35
The are several suggestions from myself and Ben.
Which option are you referring to?
Re: ADC NOISE REDUCTION in AVR
Posted: Thu Oct 14, 2021 12:33 pm
by RABO2320
According to the MCUCR register tables:
I want SM0 = 1, SM1 = 0, SM2 = 0 to be in the MCUCR register Until Sleep Mode changes to ADC Noise Reduction mode.
Re: ADC NOISE REDUCTION in AVR
Posted: Thu Oct 14, 2021 12:52 pm
by mnf
You can set bits in the registers using a C block
to set use | (or) and to clear use & (and)
in this case to set SM2 to SMO to 0b001 (binary)
MCUCR = MCUCR & 0b10001111; // Clear SM2 to SM0
MCUCR = MCUCR | 0b10000; // Set SM0 to 1
In the real world these would probably be combined into one line:
MCUCR = (MCUCR & 0b10001111) | 0b10000;
Martin
Re: ADC NOISE REDUCTION in AVR
Posted: Fri Oct 15, 2021 11:52 am
by RABO2320
I used this code in C block but there was no change in the ADC reading.
The value read from the ADC fluctuates continuously, albeit slightly.
I have complied with all of the above regarding ADC circuit power supply.
Re: ADC NOISE REDUCTION in AVR
Posted: Fri Nov 05, 2021 5:23 pm
by RABO2320
Hi
Can you help me what to do?

Re: ADC NOISE REDUCTION in AVR
Posted: Sat Nov 06, 2021 4:39 pm
by QMESAR
Hi,
Software filtering is not always the solution you need to find out from where the noise is coming or at what frequencies and you need to do HW filter
your problem sounds to me like a PCB ground plane issue which generate noise and that is hard to filter it normally comes down to bad PCB layout
Re: ADC NOISE REDUCTION in AVR
Posted: Mon Nov 08, 2021 8:07 am
by AbhijitR
Hello!
Is it possible to know what is the type of analog signal you are trying to sense from the field, is it some kind of current transmitter (4-20mA) or any other type and how do you convert that signal to feed to the microcontroller, is there some analog circuit in between to stabilize the signal before feeding the micro.
As mentioned by QMESAR in his post there are many probabilities which can cause the unstable analog signal.
Abhi