Sample Project 1 – Traffic Light
1 x Arduino Uno R3
3 x LED (any color)
3 x Resistor
Jumper Wires
1 x Breadboard
1 x Ultrasonic Sensor HC-04
Wiring Guide:
- Connect the anode (longer leg) of each LED to a separate digital pin on the Arduino (pins 2, 3, and 4).
- Connect the cathode (shorter leg) of each LED to a separate resistor.
- Connect the other end of each resistor to the ground (GND) on the Arduino.
- Connect the ground (GND) of the Arduino to the ground rail of the breadboard.
- Connect the power (5V) of the Arduino to the power rail of the breadboard.
Code:
// Pin definitions
const int redPin = 2;
const int yellowPin = 3;
const int greenPin = 4;
// Time delays in milliseconds
const int redDelay = 5000; // 5 seconds for red
const int yellowDelay = 2000; // 2 seconds for yellow
const int greenDelay = 5000; // 5 seconds for green
void setup() {
// Set the LED pins as OUTPUT
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
// Red light
digitalWrite(redPin, HIGH);
digitalWrite(yellowPin, LOW);
digitalWrite(greenPin, LOW);
delay(redDelay);
// Yellow light
digitalWrite(yellowPin, HIGH);
delay(yellowDelay);
// Green light
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, LOW);
digitalWrite(greenPin, HIGH);
delay(greenDelay);
}
Sample Project 2 – Buzzer Music
1 x Arduino Uno R3
1 x Female to Male Jumper Wire
1 x Active Buzzer
Wiring Guide:
- Connect one leg of the buzzer to digital pin 9 on the Arduino.
- Connect the other leg of the buzzer to the ground (GND) on the Arduino using a jumper wire
Code:
Sample Project 3 – Temperature and Humidity Monitor
1 x Arduino Uno R3
Jumper Wires
1 x LCD1602 with I2C module
1 x Breadboard
Wiring Guide:
- Connect the I2C module to the Arduino board:
- Connect the SDA pin on the I2C module to the A4 pin on the Arduino.
- Connect the SCL pin on the I2C module to the A5 pin on the Arduino.
- Connect VCC on the I2C module to the 5V pin on the Arduino (or breadboard).
- Connect GND on the I2C module to the GND pin on the Arduino (or breadboard).
- Connect DHT11 to the Arduino Board:
- Connect the VCC pin of the DHT11 to 5V on the Arduino (or breadboard).
- Connect the data pin of the DHT11 to a digital pin 2 on the Arduino.
- Connect the GND pin of the DHT11 to GND on the Arduino (or breadboard).
Code:
Sample Project 4 – Buzzer Sonar
1 x Arduino Uno R3
Jumper Wires
1 x Buzzer
1 x HC-06
Wiring Guide:
- Connect the HC-SR04 Ultrasonic Sensor:
- Connect the VCC pin of the sensor to the 5V pin on the Arduino (or breadboard).
- Connect the GND pin of the sensor to the GND pin on the Arduino (or breadboard).
- Connect the TRIG pin of the sensor to digital pin 9 on the Arduino.
- Connect the ECHO pin of the sensor to digital pin 10 on the Arduino.
- Connect the Buzzer:
- Connect the positive (longer) leg of the buzzer to digital pin 8 on the Arduino.
- Connect the negative (shorter) leg of the buzzer to the GND pin on the Arduino (or breadboard).