Thursday, June 3, 2010

ADC for arduino

From adafruit blog:  The analogRead(BANDGAPREF) trick has a lot of problems. I tried it for several applications and found it to be a pain and not very accurate. Here are a few of the things I ran into.

You need to calibrate each Arduino since the bandgap is only specified to be between 1.0 and 1.2 volts on the 168/328. It was only intended for brownout detection. It varies by about 5% on boards I tested which is better than the spec but there is no guarantee.

The value returned when you read it is around 220 so a two bit error results in a 1% error in the value of Vref. When you add zero offset errors in the Arduino ADC and bandgap noise and calibration problems you will likely have fluctuations of 2-3% in your readings.

Putting a cap on the Vref pin helps Vref noise some.

You will likely see the measured level in you tank fluctuate by 2-3% which is not what people expect.

To measure 4-20 ma I use a 100 ohm 0.05% resistor $4.83
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MR106-100-.05-ND

and a MCP3422 with an internal 0.05% reference $3.14
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MCP3422A0-E/SN-ND

This is all you need to get 0.1 - 0.2 % with no calibration and interchangeable parts.

The beauty of the MCP3422 is that it is a total sigma-delta system with amp, reference, filters, and oscillator so see the adafruit blog post about this useful chip

You just need to make a current vs volume table.

a 12-bit external ADC could be helpful ($28) and also a great thread on noisy numbers on adafruit

No comments:

Post a Comment