Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Issues with analogRead when using Vin on Arduino

Issues with analogRead when using Vin on Arduino

Issues with analogRead when using Vin on Arduino


I am having hardware specific problems with analogRead when I am supplying power via the Vin pin on an Arduino MKR1000 (https://www.arduino.cc/en/Main/ArduinoMKR1000) — It’s an Atmel SAMD21.

Attached is a very simple voltage divider circuit that should always return a value around 2047 when I am using 12 bit ADC resolution of pin A2. This is indeed the case when I am supplying power via USB - either directly to the computer or USB charger device.

But when I am using the Vin pin via an external source

then the ADC values are 1954 - 1890 —> around 100 values lower! I have no explanation for this and the Vcc of 3.3 is not changing if I use either way of supplying power.

(In case you are wondering: I am sending the ADC values via Wifi to the computer in both power supply methods)

What could be the source of this?


RE: Issues with analogRead when using Vin on Arduino

You are right, that seems to be the issue: If I supply the GND from my power supply to the GND of the USB connector then it's all good - but: If I tie the GND from the USB to the GND pin of the board than I am back at my wrong results. How does that make sense?
Two different GNDs?

RE: Issues with analogRead when using Vin on Arduino

Correction: it looks like I am not connecting to USB GND directly

I am connected to the USB shield which has a ferrite bead (BLM18PG471SN1D) in line with it.

RE: Issues with analogRead when using Vin on Arduino

Not sure if this applies but it might help.

EEVblog #441 - How To Track Down Common Mode Noise

I find this guy pretty entertaining, sometimes I listen to random videos of his while I work.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close