-2
\$\begingroup\$

We have developed an Atmega328p based Kit. We want to read some analog sensor values in the application. But analog readings always returns 1023. Even If we connect GND pin with analog pin, it gives 1023.

Here the schematic diagram has been attached.

enter image description here

We tried with both Arduino analogRead() function and microc function adc_Read(). Both adc reading always returns 1023.

We have also followed these Q&As below:

Q&A StackExchange

Q&A StackOverflow

Q&A AvrFreak

But no luck yet.

Is there any bugs in our schematic?

Your suggestions and helps are appreciated.

Thanks in advance.

\$\endgroup\$
  • \$\begingroup\$ Is your AREF really tied to ground on your physical circuit? Do you have your code configured to use the external reference? Because that would do it. \$\endgroup\$ – justing Oct 19 '15 at 4:03
  • \$\begingroup\$ Yes. AREF is physically connected to GND. No we haven't configured external reference. Do we have to set EXTERNAL instead of DEFAULT. \$\endgroup\$ – Jeyanth90 Oct 19 '15 at 5:26
  • \$\begingroup\$ Why would you connect AREF to ground ? A 1 uF decoupling cap to ground is a better idea. The internal ADC needs a reference, it is your choice to use the internal (then decouple AREF) or use an external reference, then connect that to AREF. Look at some examples how to use the ADC, it is very easy to use. \$\endgroup\$ – Bimpelrekkie Oct 19 '15 at 7:32
1
\$\begingroup\$

As FakeMoustache mentioned, the problem was in connecting AREF directly to GND. After we connect the AREF to GND via 1uF decoupling capacitor, it works fine.

\$\endgroup\$
  • \$\begingroup\$ @m.Alin when the internal (bandgap) reference is used AREF needs to be connected only to a cap - not to VDD. \$\endgroup\$ – kabZX Oct 19 '15 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.