analogReference

I am attempting to make a Specific Gravity sensor using pressure differential sensor. The concept works but it is not sensitive enough. I need to narrow range to perhaps 1 volt. I assume this is what the analogReference(INTERNAL) is for but it cant start at zero I need to read between 2 and 3 volts.

how do I move the range ?

thanks steve

No, analogReference (INTERNAL) is the internal voltage reference, which is about 1.1V (for each
device it will be different, but stable).

I think you wanted analogReference (EXTERNAL) which uses the voltage on the AREF pin. However
the datasheet says that results are only satisfactory when that voltage is 1V or more (presumably
noise and error rise rapidly below that level).

Note that when the Arduino starts up it has the AREF pin internally connected to Vcc, so you shouldn't
hardwire AREF to a strong voltage source, only to something capable of a moderate current like a
voltage reference chip (NOT a voltage regulator). I think you can get away with a series resistor on
AREF to protect it, and I believe (not checked the sources recently) that if you call analogReference()
first thing in setup () - ie before any analogRead() calls - then you are OK.

by using analogReference (EXTERNAL) set at 3 volts does it then measure 0 to 3 volts?

is there anyway to measure from 2 to 3 volts so all 1023 points are between 2 and 3 volts?

thanks for your help

steve

  1. yes.

  2. no. You need to use an op amp to get it into the range.

  1. Not with the '328p. Some atmel microcontrollers have a more sophisticated ADC that offers differential pairs, so you can give it two pins, say, one at 2.5v and one connected to the sensor, and set the reference to 1.1v... Depending on the microcontroller, there may be an option to adjust the gain as well (the Tiny841 has a particularly fancy ADC, with almost every combination of pins, and you can choose any of the gain options for any pin; more often, each pair has a fixed gain, so when you select the pair, that also sets the gain). See the appropriate datasheet for details.

i am not familiar with op amp (ive got some studying to do).

I assume the tiny841 is an aduino like thing. Does it use the same ide as the arduino?

thanks for your help

steve

It's another Atmel chip, from the ATTiny line - 8k flash, 512b ram, 11 IO pins, 2 hardware serials, hardware SPI, 6 pwm channels (the usual timer0, and 2 16-bit timers like timer1 on the '328p), ADC on every pin. I particularly like them. Works on the same IDE as Arduino, and can be programmed with a bootloader - core is in my sig, or see my github GitHub - SpenceKonde/arduino-tiny-841: Arduino core for ATtny841, 828, 1634 and 441 )

I also happen to sell Tiny841 boards :wink: So obviously they're the best thing ever.

If you want a larger chip, the 1284p (128k flash 16k ram, 31 IO pins, 2 hardware serials, hardware I2C and SPI) is a great choice - it also has differential ADC options (not as many). Crossroads (he posts a lot on these forums) sells 1284p boards, and you use Jack Christenson's core for IDE support.

The Arduino Mega (based on the Mega2560 - 256k flash, 8k ram, lotsa pins, 4 h/w serial, h/w I2C and SPI) also has differential input modes on the ADC.

Hell, the Arduino Micro (based on the 32u4 - 32k flash, 2.5k ram, 25 IO pins, native USB, 1 h/w serial, I2C, SPI) has differential input modes!

The Tiny84 does! The Tiny85 does! Just about everything in Atmel's AVR line worth using except the '328 (used in the Uno) has differential inputs on the ADC... (okay, so my other favorite chip, the tiny1634 doesn't either)

All the ATtiny and ATmega microcontrollers are almost code compatible (you have to sort out things like pin numbers) and can be programmed using the IDE as long as someone has made a core for it.

murmsk:
i am not familiar with op amp (ive got some studying to do).

I assume the tiny841 is an aduino like thing. Does it use the same ide as the arduino?

thanks for your help

steve

Op-amps are pretty straight forward. you put in a voltage and it outputs a different voltage that is proportional to the input. They are also pretty versatile. The three most common uses are as voltage followers (which isolate parts of a circuit behind a high-impedance wall), triggers (they out put low until a critical voltage is reached, then go high. With a declining voltage, they do the opposite, and the two threshold voltages are independent.) Lastly, they amplify voltage. This is how you would use it. Google "non-inverting op-amp circuit'.

I am attempting to make a Specific Gravity sensor using pressure differential sensor. The concept works but it is not sensitive enough. I need to narrow range to perhaps 1 volt. I assume this is what the analogReference(INTERNAL) is for but it cant start at zero I need to read between 2 and 3 volts.

No, this is not true. As already stated, despite what you think, the fact that you ask this question indicates you do not know that what you need is a non-inverting op amp. Your other alternative , if you need better resolution is to use a 16-bit ADC like the ADS1115

For starters, you need to post a vendor link for your sensor, that has all the datasheet info. You should always do this when posting with questions about sensors or using them.