Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
You should be able to set your "ADC" AVR to use the internal 2.56V internal reference which is ideal for reading this sensor.
a2dInit(); // initialize analog to digital converter (ADC)a2dSetPrescaler(ADC_PRESCALE_DIV32); // configure ADC scalinga2dSetReference(ADC_REFERENCE_AVCC); // configure ADC reference voltage
INTERNAL: an built-in reference, equal to 1.1 volts on the ATmega168 and 2.56 volts on the ATmega8.
ADC Voltage Reference The reference voltage for the ADC (VREF) indicates the conversion range for the ADC. Single ended channels that exceed VREF will result in codes close to 0x3FF. VREF can be selected as either AVCC, internal 1.1V reference, or external AREF pin.