Go Down

Topic: Get analog values on serial monitor running on 3.3v (Read 377 times) previous topic - next topic

Mainsedora

Hey folks,
when running on 5v with an analog stick, I get other values than on 3.3v. Question is, that I try to get the values on the serial monitor, when running on battery. Problem is, when I connect a usb cable to the board, I charge the battery and running then on 5 Volts. Is there a solution?
 :-\
Greetings
Mainsedora

ballscrewbob

#1
Dec 10, 2018, 04:40 pm Last Edit: Dec 10, 2018, 04:49 pm by ballscrewbob
You need to do one of two things.

Either use a reference voltage of 3.3 and set your equations to use that as the base divider.

Or add a routine that detects the change from 3.3 to 5 volts and change the divider in the sketch based on that.

Preference would be the first option using the AREF pin as that will give you consistent readings regardless of change.
Also ensure your sensor is capable of 3.3 volt stable operation as a lot require 5 volts.

A good post on the topic HERE

Another tutorial here for the calculations

You can find a lot of useful AREF material by using MKR1000 in your search terms as it is basically the same board with additional hardware. There are some notes to be aware of so please read up a little first especially when selecting internal vs external functions.


It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Go Up