TCS Pune

Arduino: Read Sensors with ADC

Practical lesson

Arduino: Read Sensors with ADC

Read an analogue sensor, convert the ADC value and inspect it over Serial.

◷ 40 min

Parts and tools

  • Arduino Uno
  • 10 kΩ potentiometer
  • Breadboard

Lesson

Learning objective

Read an analogue sensor, convert the ADC value and inspect it over Serial.

Procedure

  1. Review the circuit and confirm the board voltage.
  2. Build and inspect the wiring before applying power.
  3. Upload the example, observe the result and record your readings.
  4. Change one parameter, predict the result and test again.

Troubleshooting

Check power, ground, pin selection, polarity, compiler target and serial output. Use a multimeter or logic analyser where appropriate.

Example code

void setup(){ Serial.begin(9600); }
void loop(){ int raw=analogRead(A0); Serial.println(raw); delay(100); }

Knowledge check

What is the Uno ADC range by default?

Ready when you are

Need help with your laptop or computer?

Send us the model and fault details. Start your repair request online or contact TCS Pune directly.

WA