arduino pro micro ADC internal voltage drift

Hi,

I'm using a 3.3V arduino pro micro (Atmega32u4) to capture analog output from an accelerometer (MMA7361). The whole thing is powered by a 18650 battery which is connected to the RAW pin of the microcontroller (which is supposed to go through a regulator) and the 5v input of the accelerometer (the accelerometer has a regulator on the breakout .. it also has a 3.3v pin but I'm using the 5V one just to be sure)

I'm using the internal reference voltage for the ADC. i.e. analogReference(INTERNAL); which is 2.56V.

My problem is that as the voltage of the battery goes down over time the absolute values captured by the microcontroller are increasing. Bellow you can find two measurements captured with 8 hours difference. As you can see the min and max values of the readings are higher as time goes on.

MIN/MAX x 622:636 y 669:681 z 893:907 (battery voltage 3.9 V)
MIN/MAX x 634:663 y 682:707 z 915:936 (battery voltage 3.57 V)

Is this expected? I thought that the internal reference voltage was supposed to be unaffected by the battery voltage.

Regards,
Nick

PS. unless the analog output of the accelerometer goes up as the voltage goes down :S But I wouldn't think so.

What's the actual voltage on the Vcc pin of the Micro?

Regulators have some dropout, and it may be that you're getting a lower voltage on the Micro than you think. Same goes for the voltage on the output of the regulator of the accelerometer module.

The voltage on the Vcc pin of the micro using the battery (at its current voltage) is 3.25V while when using the usb connector the Vcc voltage is 3.31V.

I realised now that the accelerometer behaves quite differently when using different power pins (accelerometer's 5V, 3.3V) and different power sources/pins (arduino's vcc,raw.. etc). I think I get accurate measurements when I power the arduino using the RAW pin and power the accelerometer using arduino's (regulated) Vcc.

My main problem is that I'm getting confused with the battery and it takes a long time to discharge it and get measurements. I will try to simulate the voltage range of the battery by powering the arduino using a dc-dc converter and post the results here soon.

PS. One more thing (not very relevant).. what happens if the arduino is powered from a battery and I connect the usb cable to my laptop to check the serial port output? Could I have issues with the battery? :S

nicktgr15:
I realised now that the accelerometer behaves quite differently when using different power pins (accelerometer's 5V, 3.3V) and different power sources/pins (arduino's vcc,raw.. etc). I think I get accurate measurements when I power the arduino using the RAW pin and power the accelerometer using arduino's (regulated) Vcc.

Sounds like the regulator isn't able to give it 3.3v with only 3.x volts to work with - regulators have dropout, and many regulators have over 1v of dropout.

Thanks DrAzzy, I didn't have thought of any of these so far. For the record, this is the regulator on the microcontroller: http://www.micrel.com/_PDF/mic5205.pdf and this is the regulator on the accelerometer: http://www.mikrocontroller.net/attachment/54181/kb6206.pdf

At some point in the datasheet of the microcontroller's regulator it says:

VIN = VOUT + 1V;

However in the dropout voltage section VIN – VO is mentioned with a typical value of 110 mV at 50mA load (my load is much smaller).

Which one is the dropout voltage ?
More general question, would a higher voltage battery solve these problems for me?

nicktgr15:
The whole thing is powered by a 18650 battery which is connected to the RAW pin of the microcontroller

That is simply foolish. The maximum voltage in the battery would be 4.2V - whilst on charge. This is obviously within the working voltage of the microcontroller, and that is exactly what you need to be doing - connecting the battery to Vcc. The battery itself will be a far more stable reference than a regulator below its drop-out voltage.

If any other component - such as the accelerometer - cannot tolerate 4.2 V, then you need to make some arrangement to limit the supply voltage to that part only - an ultra-low drop-out regulator of some sort.

If the accelerometer signal is in fact, proportional to its supply voltage, then you simply connect Aref to whatever voltage is supplying the accelerometer so that both "track" together and your readings will be stable.

i agree it makes no sense to feed a 3.6v battery into a circuit designed for no less than 6.2v. as mentioned better to connect battery directly to vcc. avr works fine off that but sensors etc must tolerate 3-4v range. as battery drops reading can change slightly though.

if restricted to one cell then better to use one of the 50 cent ebay boosters to step the battery up to a stable 5v and feed that into vcc. switchers can generate noise so at least 1000mf should be added to filter.

with sensors involved best of all from a noise, and stability standpoint is simply feed 2 cells (7.2v) into raw.

anything but the way it is now.