Загрузка...

Lesson: 15 - How to Improve Arduino ADC Accuracy with the Internal 1.1V Reference

Lesson: 15 - How to Improve Arduino ADC Accuracy with the Internal 1.1V Reference

Hello and welcome to Electro Nerds Academy, In this tutorial, we explore how to improve Arduino ADC accuracy by using the built-in 1.1V internal voltage reference—without relying on external modules. Previously, we used the LM4040 reference, but this time we’ll unlock a hidden feature already inside the Arduino.

What you will learn in this video,
✅ We’ll start by looking at the Arduino ADC block diagram
✅ We''ll discuss its registers like, ADMUX, ADCSRA, ADCH and ADCL
✅ How the ADC selects input channels and reference voltages
✅ Why you should be careful with the AREF pin.
✅ How to use the internal 1.1V reference for calibration
✅ How to fix voltage measurement errors in your projects
✅ Why calibrated ADC values stay accurate even if the supply voltage changes

This is a must-watch if you want precise analog measurements in Arduino projects!

Code used in this video:
int adc_value;
float uncalibrated_voltage, calibrated_voltage, supply_voltage;
long result;

void setup()
{
Serial.begin(115200);
pinMode(A0, INPUT);
}

void loop()
{
// Read normal Arduino value (assuming 5V supply)
adc_value = analogRead(A0);
uncalibrated_voltage = adc_value * 5.0 / 1023.0;
Serial.print("Uncalibrated voltage: ");
Serial.print(uncalibrated_voltage);

// Measure actual supply voltage using internal 1.1V reference
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2); // wait for reference to settle
ADCSRA |= _BV(ADSC); // start conversion
while (bit_is_set(ADCSRA, ADSC));
result = ADCL;
result = ADCH ‹‹ 8; // change it into two less than signs

// Calculate supply voltage (in volts)
supply_voltage = (1.1 * 1023.0) / result;

// Now compute the calibrated voltage
calibrated_voltage = (supply_voltage * adc_value) / 1023.0;
Serial.print(", Calibrated voltage: ");
Serial.println(calibrated_voltage);

delay(500);
}

👉 Finally, don’t forget to like, share, and subscribe to Electro Nerds Academy for more Arduino tutorials and electronics deep-dives.
#ArduinoProjects #ElectronicsDIY #arduino #arduinotutorials #embeddedsystems #electronicsforbeginners #electronerdsacademy #arduinoprogramming #circuitbuilding #analog #voltagemeasurement #voltage #ADMUX #ADCSRA #ADCH #ADCL #adcblockdiagram #adc #accuracy #voltagereference #1.1VvoltageReference

Видео Lesson: 15 - How to Improve Arduino ADC Accuracy with the Internal 1.1V Reference канала Electro Nerds Academy
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять