Analog Input Range

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
TheChymera
Posts: 1
Joined: Wed Aug 24, 2016 9:55 pm

Analog Input Range

Post by TheChymera » Wed Aug 24, 2016 10:25 pm

What is the range that the analog input contacts can convert to numeric values? Does the voltage have to be positive/negative only?

The context is that I am trying to build a set-up that can roughly quantify the movement of an animal carrying a small magnet (similar to http://www.sciencedirect.com/science/ar ... 1906001213 but simpler and more FOS). The animal is inside a large copper coil, which will upon movement of the magnet generate voltages in the +/-100mV range.
Ideally I would want to connect this directly to the board; adding an amplifier would not be so problematic, but what I would really like to avoid is having to use a rectifier.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Analog Input Range

Post by dhylands » Thu Aug 25, 2016 6:50 am

You didn't mention which MicroPython board you're using. You really need to consult the data sheet for the MCU to determine the min/max voltages that you can use.

I think that the APIs only expose single ended ADC, but some of the chips can do differential as well.

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: Analog Input Range

Post by torwag » Thu Aug 25, 2016 7:02 am

Hi,
you did not mention which board you are going to use. Roughly from 0-Vin is the usual range. That is if you power the board with 3.3V you can measure up to 3.3V. ESP8266 is a bit different and limit the input range between 0-1V
Nevertheless, the ADC input range should not worry you. In your case, I would highly suggest to do some signal processing before feeding it to the ADC. E.g. you would like to make sure that the voltage can not spike above the ADC max. ratings.
You can't measure negative values. Again as a rough indicator, an (internal) ADC can only measure between the voltages provided to the chip.

What you could to do is to create a virtual ground circuit. That is the VGND sits just between 0 and Vmax. e.g. at 1.65 V. This will shift all voltages about 1.65V up. -1.65V becomes 0 and +1.65V becomes 3.3V and thus, it works well in the range of the ADC.
This circuitry can also take take of max ratings, and you might want to use an amplifier to make sure you cover the entire range of the ADC with your input values. That is, you need a circuit, which creates a virtual ground, amplifies your "normal" input signals and caps of any potential harmful signal levels. Usually, this can be achieved with a single OpAmp circuit. Take care working with the virtual ground is tricky since you need to isolate the entire set-up from any other ground sources. Signal to noise is the next step to take care, since applications like you describe them usual are keen to pick up a lot of noise. Also this can be considered in your analogue circuitry. Finally, check for anti-aliasing, very fast signal changes can occur which quickly outrun the max. sample rate of your ADC.

As soon as you told us which board you plan to use I will move this thread accordingly, since it is a bit misplaced currently.

Hope that helps a bit

Post Reply