Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Issues with analogRead when using Vin on Arduino

Status
Not open for further replies.

SolarTrap

Computer
May 5, 2014
89
0
0
DE
Hello,

I am having hardware specific problems with analogRead when I am supplying power via the Vin pin on an Arduino MKR1000 ( — It’s an Atmel SAMD21.

Attached is a very simple voltage divider circuit
FullSizeRender_alknr5.jpg
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
IMG_6176_qubu3x.jpg

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?

Thanks
Markus
 
Replies continue below

Recommended for you

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?
 
Correction: it looks like I am not connecting to USB GND directly
Screen_Shot_2017-06-17_at_3.42.54_PM_adbezw.png

I am connected to the USB shield which has a ferrite bead (BLM18PG471SN1D) in line with it.
 
Status
Not open for further replies.
Back
Top