In the last video I used a trick to enhance the accuracy of the analog to digital converter in the Arduino. I thought this is worth a small video for all the guys which just want to solve this particular issue. Arduino have a built in 10, bit analog to digital converter, abbreviated ADC. They can be used to read analog values on pin a 0 to a 7. A DC’s need an exact reference voltage to be precise. Unfortunately, the Arduino s use the supply voltage as their reference, because supply voltage voltage can vary. The reading of the ADC also varies to show this. I supply an Arduino with a variable supply voltage and measure a fixed voltage of 3 volts. The measured value is displayed on the TFT screen. You see the supply voltage on the yellow multimeter and the measured voltage on the red one. I start with a supply voltage of exactly 5 volts as foreseen. The reading of the Arduino is correct. If I change the supply voltage to 4.8 volt, the Arduino measures a higher value, it is imprecise. The same applies if I change the supply voltage to 5.2 volt. It is quite clear that this is not acceptable if you need precise measurements. This is, for example, true. If you want to measure any sensors with analog outputs as the ampere meter in my last video, fortunately, a trick exists to correct this value. Arduino have a right, precise, built in voltage reference of 1.
1 volt. If we measure this voltage with our imprecise ADC, we get, of course, a wrong value. We saw this in our last test, but because we know that the internal reference is really 1 point 1 volt. We can use the following formula to calculate the real supply voltage. Vcc equals one point one times, one thousand 23 times one thousand divided by the measured result. We see VCC gets bigger when the measured result get smaller, and this is exactly what we need by the way. The factors 1023 and 1000 are because the ADC has 10 bits, which means 1024. Distinctive values can be measured, let’s check in reality. Again i supply 5 volts arduino measures also 5 volts supply voltage. If i go to 5 point 3 volts, the reading of the arduino is quite correct. Of course, a 10 bit ADC is not completely accurate. If i go down to 4.5 volts, the reading is still correct, even with 4 volts, it stays correct. Now let’s use the measured VCC to correct our initial measurement. The formula is: corrected: measurement equals VCC divided by 5, multiplied times the value measured let’s check this. In reality, I can change the supply voltage between 4 and 5 point 3 volt and the reading stays correct at 3 volts much better than the original. The original value changes between two point: eight volts and 3.7 volts, which is a measuring error of minus 72 plus 23. The code to measure supply voltage is enclosed in the comment it uses some bit panning and works on most of the Arduino.
arduino reference Video
arduino reference news
Posted on Friday August 30, 2019Your Arduino SAMD21 ADC Is Lying To You HackadayOne of the great things about the Arduino environment is that it covers a wide variety of hardware with a common interface. Importantly, this isn’t just about … … Continue Reading »
Posted on Sunday September 01, 2019Force Sensitive Resistor Takes The Pain Out Of Bed Leveling HackadayHow do you know if your 3D printer bed is levelled? Oh, don’t worry – you’ll know. Without a level bed, filament won’t stick properly to the build surface and you’ll … … Continue Reading »
Posted on Thursday August 22, 2019Vintage LED display prototype revived with Arduino BlogdottvPatrick Hickey has been collecting retro LED indicators and displays for decades, and his rarest item is an HP 5082-7002—a 5×7 dot matrix LED display in a … … Continue Reading »
arduino reference Social
サンプルCentral – SensorTagButtonを動かす。