Does your bathroom scale tell you your correct weight?

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.
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.
Discussie (2 opmerking(en))
crlMIDI 4 jaar geleden
Test procedure : I proposed that, when designing a project, we shouldn't assume the ADC built in to the microcontroler is working as specified. Apart from straightforward failure (as in this case), analog-digital interfaces are notoriously sensitive to EMI. I demonstrated that monotonicity can be verified at startup using no external active components. Logically, testing for accuracy would require a voltage reference independent of the chip. You can tell by looking at the complexity of this aspect of the ATmega328 datasheet that the subject is important and worthy of an article in Elektor.
ElektorLabs 4 jaar geleden