4036

Analogue to digital converters can develop faults. Here's a self-testing method for the analogue input ports of the Arduino.

Our digital bathroom scale became faulty and indicated that I have only two possible weights: 39.4 or 70.7kg. Some data bits seem to be latched high or low. The fault recalled a similar but more serious incident of 2 decades ago, when electromagnetic interference from a nearby building caused digital errors in laboratory instruments of a particular model.

It's known that analogue to digital converters (ADC), such as those built in to microcontrollers, are or were sensitive to interference, and we should not assume they're reliable. We show how to test all the bits of a microcontroler's ADC by reading the voltage across a capacitor that's being charged and discharged via a resistor connected to a digital port.