Applying gain to differential analog inputs on Arduino Mega

Your source for all things Atmel.

Moderator: phalanx

Post Reply
isarl
Posts: 1
Joined: Tue Mar 09, 2010 9:37 am

Applying gain to differential analog inputs on Arduino Mega

Post by isarl » Tue Mar 09, 2010 9:56 am

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?

rmd6502
Posts: 13
Joined: Fri Nov 24, 2006 12:45 pm

Re: Applying gain to differential analog inputs on Arduino Mega

Post by rmd6502 » Thu Apr 15, 2010 6:44 pm

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.

taloman05
Posts: 1
Joined: Wed Apr 17, 2013 12:23 pm

Re: Applying gain to differential analog inputs on Arduino M

Post by taloman05 » Wed Apr 17, 2013 12:26 pm

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.

Post Reply