Welcome to Arduino Level 2 where you move beyond blinking LEDs to reading the real world with sensors and the Serial Monitor. This is where Arduino projects become truly interesting — your board starts responding to temperature, light, distance, and motion. Each project builds on the previous one, giving you a structured learning path.
Table of Contents
- Understanding Serial Monitor
- Analog vs Digital Sensors
- Project 1: Temperature Monitoring
- Project 2: Light Level Detection
- Project 3: Ultrasonic Distance Meter
- Project 4: Humidity and Temperature Logger
- Frequently Asked Questions
- Conclusion
Understanding Serial Monitor
The Serial Monitor is your window into what the Arduino is doing. It displays text data sent from the Arduino to your computer over USB at a specified baud rate (typically 9600 or 115200). Learning to use Serial.println() for debugging is one of the most valuable skills in embedded programming.
Basic usage:
void setup() {
Serial.begin(9600); // Start serial at 9600 baud
Serial.println("Arduino started!");
}
void loop() {
int sensorValue = analogRead(A0);
Serial.print("Sensor: ");
Serial.println(sensorValue);
delay(500);
}
Analog vs Digital Sensors
Arduino reads two types of sensor signals:
- Analog sensors (e.g., LDR, potentiometer, LM35) output a variable voltage. Read with analogRead() which returns 0-1023 (10-bit ADC). The Uno has 6 analog pins (A0-A5)
- Digital sensors (e.g., DHT22, HC-SR04, IR sensor) communicate using protocols like one-wire, I2C, or timed pulses. Read with digitalRead() or library functions
Project 1: Temperature Monitoring with LM35
The LM35 is a simple analog temperature sensor that outputs 10mV per degree Celsius:
const int lm35Pin = A0;
void setup() { Serial.begin(9600); }
void loop() {
int raw = analogRead(lm35Pin);
float voltage = raw * (5.0 / 1024.0);
float tempC = voltage * 100.0;
Serial.print("Temperature: ");
Serial.print(tempC);
Serial.println(" C");
delay(1000);
}
This project teaches analog reading, voltage-to-temperature conversion, and formatted Serial output.
Project 2: Light Level Detection with LDR
An LDR (Light Dependent Resistor) changes resistance based on light intensity. Use a voltage divider circuit with a 10K resistor to create an auto-brightness sensor or day/night detector.
Project 3: Ultrasonic Distance Meter
The HC-SR04 measures distance using ultrasonic pulses. It sends a 40kHz pulse and measures the echo time to calculate distance:
const int trigPin = 7;
const int echoPin = 8;
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
digitalWrite(trigPin, LOW); delayMicroseconds(2);
digitalWrite(trigPin, HIGH); delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long duration = pulseIn(echoPin, HIGH);
float distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(200);
}
Project 4: DHT22 Temperature and Humidity Logger
The DHT22 provides both temperature and humidity readings over a single data wire. Install the DHT library via Arduino IDE Library Manager, then read data in a structured format for logging.
Frequently Asked Questions
Why does my Serial Monitor show garbage characters?
The baud rate in Serial Monitor must match Serial.begin() in your code. If you use 9600 in code, set the Serial Monitor dropdown to 9600 too.
Can I use multiple sensors at once?
Yes. Each analog sensor uses one analog pin, and digital sensors use digital pins. The Uno supports 6 analog and 14 digital inputs simultaneously.
How accurate are cheap sensors?
The LM35 is accurate to ±0.5 degrees C. The DHT22 is ±0.5 degrees C and ±2% humidity. For hobby projects, this is more than sufficient.
Conclusion
Arduino Level 2 transforms your board from a simple LED controller into a real-world data collector. Mastering sensors and Serial Monitor gives you the foundation for every advanced project that follows — from IoT dashboards to autonomous robots. Practice each sensor individually, then combine them into a multi-sensor monitoring station.
Get sensor kits and boards from our Arduino collection.
Add comment