By Marco Ventimiglia on July 26, 2022
As we all know, Arduino Uno features a 10-bit ADC (analog-to-digital converter) inside its ATmega328p, which takes a sign between 0 and 5V and produces a digital worth that varies from 0 to 1023. Nevertheless, attempting to measure any voltage above 5V will trigger some lower than fascinating outcomes, comparable to creating magic smoke and destroying the microcontroller. To get round this, some makers add a voltage divider that divides the enter voltage by a predetermined issue. This answer reduces the decision of the ADC, as a single step of the digital worth corresponds to a better voltage variation. To unravel this drawback, the YouTuber often known as Techoyaki has provide you with a brand new answer that may measure the whole vary of values with out lowering the decision.
The circuit divides the 0V-20V vary into 4 ranges (0V-5V, 5v-10V, 10V-15V and 15V-20V) translating all of them into the 0-5V vary. After that, these 4 obtained alerts arrive on the Arduino’s 4 analog inputs, which add up the values to supply the equal of an ADC of almost 12 bits, thus resulting in values that fall between 0 and 4092 (1023 x 4 ).
The circuit consists of 4 rail-to-rail operational amplifiers, and varied resistors, which permit to restrict the voltage obtained within the 0v-5v vary and subtract a DC voltage worth to impact the interpretation within the desired vary.