Page 1 of 1

Applying gain to differential analog inputs on Arduino Mega

Posted: Tue Mar 09, 2010 9:56 am
by isarl
I'm trying to perform acquisition of very small analog signals. I have been using an instrumentation amplifier with a gain of ~500, but I would like to try using the differential gain on the ATmega1280's analog inputs. The user manual has a table (Table 26-4, to be precise) with details on how to set the register ADCSRB for a particular choice of single-ended input or pairs of differential inputs, optionally with gain.

Normally, to perform ADC on the Arduino, I write:
Code: Select all
reading = analogRead(analogPin);
but this is for a single-ended input.

My question is: how do I perform differential amplification and conversion within the Arduino language?

Re: Applying gain to differential analog inputs on Arduino Mega

Posted: Thu Apr 15, 2010 6:44 pm
by rmd6502
Hmm, I'm surprised there isn't already a library for using the 1280's serial ports - I didn't realize they had an opamp built in! I'd grab the analogRead code from the Arduino source, and just set custom values for ADMUX and ADCSRB.

Re: Applying gain to differential analog inputs on Arduino M

Posted: Wed Apr 17, 2013 12:26 pm
by taloman05
Hi,

I had the same problem, and before i started creating a new library, i got with this (Someone already did it):

http://sekarlangit.com/arduino-differential-gain.php

Hope it helps.