JUSTAWAKE | HOME | | Rahul's WORKSPACE | | CONTACT US |

ARDUINO PROJECTS (Part 1)

Explore a collection of foundational and exciting Arduino projects, complete with code snippets and descriptions. Perfect for ATL Lab students to kickstart their hardware journey!

2. Rainbow Spectrum

Code

int redPin = 9;
int greenPin = 10;
int bluePin = 11;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {
  // Red
  setColor(255, 0, 0);
  delay(1000);
  // Green
  setColor(0, 255, 0);
  delay(1000);
  // Blue
  setColor(0, 0, 255);
  delay(1000);
}

void setColor(int red, int green, int blue) {
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);
}

Info

"Rainbow Spectrum" - RGB LED controller that cycles through different colors, demonstrating PWM (Pulse Width Modulation) for color mixing.

3. TempGuard

Code

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int tempPin = A0;

void setup() {
  lcd.begin(16, 2);
  lcd.print("Temp Monitor");
}

void loop() {
  int reading = analogRead(tempPin);
  float voltage = reading * 5.0 / 1024.0;
  float tempC = voltage * 100; // Convert to Celsius
  lcd.setCursor(0, 1);
  lcd.print("Temp: ");
  lcd.print(tempC);
  lcd.print("C");
  delay(1000);
}

Info

"TempGuard" - Temperature monitoring system that reads ambient temperature and displays it on an LCD, useful for environmental tracking.

4. Sonic Radar

Code

#define trigPin 7
#define echoPin 6

void setup() {
  Serial.begin(9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

void loop() {
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  delay(500);
}

Info

"Sonic Radar" - Distance measurement tool using an ultrasonic sensor to detect objects and display distance in centimeters.

5. Light Tracker

Code

int ldrPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int ldrValue = analogRead(ldrPin);
  Serial.print("Light Intensity: ");
  Serial.println(ldrValue);
  delay(1000);
}

Info

"Light Tracker" - LDR-based light intensity monitor that measures ambient light levels, useful for automatic lighting systems.

6. Pressure Alert

Code

int pressurePin = A0;
int buzzerPin = 8;
int threshold = 500;

void setup() {
  pinMode(buzzerPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int pressureValue = analogRead(pressurePin);
  Serial.print("Pressure: ");
  Serial.println(pressureValue);
  
  if (pressureValue > threshold) {
    tone(buzzerPin, 1000);
    delay(500);
    noTone(buzzerPin);
  }
  delay(100);
}

Info

"Pressure Alert" - Pressure-sensitive alarm that triggers a buzzer when pressure exceeds a threshold, ideal for weight detection.

7. Clap Switch

Code

int soundPin = A0;
int ledPin = 13;
int threshold = 500;

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int soundValue = analogRead(soundPin);
  Serial.print("Sound: ");
  Serial.println(soundValue);
  
  if (soundValue > threshold) {
    digitalWrite(ledPin, HIGH);
    delay(100);
    digitalWrite(ledPin, LOW);
  }
  delay(10);
}

Info

"Clap Switch" - Sound-activated LED that turns on when a loud noise (like clapping) is detected.