Challenge - 5 Problems
ADC Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateWhat is the output of this ADC reading conversion?
Given a 10-bit ADC reading of 512 on a 5V Arduino board, what voltage does this code print?
Arduino
int adcValue = 512; float voltage = (adcValue / 1023.0) * 5.0; Serial.println(voltage, 2);
Attempts:
2 left
💡 Hint
Remember the ADC range is 0 to 1023, so divide by 1023, not 1024.
✗ Incorrect
The voltage is calculated by (512 / 1023) * 5 = approximately 2.5024, which rounds to 2.50 with two decimals.
🧠 Conceptual
intermediateHow many distinct values can a 10-bit ADC produce?
A 10-bit ADC converts analog signals into digital values. How many unique digital values can it output?
Attempts:
2 left
💡 Hint
Think about how many values can be represented with 10 bits.
✗ Incorrect
A 10-bit ADC can represent 2^10 = 1024 distinct values, ranging from 0 to 1023.
🔧 Debug
advancedWhy does this voltage calculation print 0.00?
This Arduino code reads an ADC value and calculates voltage, but always prints 0.00. What is the error?
Arduino
int adcValue = analogRead(A0); float voltage = (adcValue / 1023) * 5; Serial.println(voltage, 2);
Attempts:
2 left
💡 Hint
Check how division works between integers in Arduino C++.
✗ Incorrect
Integer division truncates the decimal part, so adcValue/1023 is zero for values less than 1023, making voltage zero.
📝 Syntax
advancedWhich code snippet correctly converts ADC reading to voltage?
Select the code snippet that correctly calculates voltage from a 10-bit ADC reading stored in adcValue.
Attempts:
2 left
💡 Hint
Make sure both division and multiplication use floats to avoid integer math.
✗ Incorrect
Option C uses floating point division and multiplication correctly, ensuring accurate voltage calculation.
🚀 Application
expertHow many millivolts per step does a 10-bit ADC with 3.3V reference have?
An Arduino uses a 10-bit ADC with a 3.3V reference voltage. What is the voltage increment per ADC step in millivolts?
Attempts:
2 left
💡 Hint
Divide the reference voltage by the number of steps (1024) and convert to millivolts.
✗ Incorrect
Voltage per step = 3.3V / 1024 = 0.00322265625 V = 3.22 mV approximately.
