ENGINEER_KI_DUKAN
[ OFFICIAL LAB COMPANION & CIRCUIT REPOSITORY ]

Pinouts, Schematics & Lab Codes

Step-by-step breadboard wiring tables, verified ASCII pinout schematics, ready-to-upload Arduino IDE codes, and syllabus viva preparation for your General Project Kit.

Select Lab Practical:4 AVAILABLE
DON'T HAVE THE HARDWARE YET?

Get the complete pre-tested breadboard, controller, sensors, and 40 M-F jumpers delivered to your college in 1 day.

Order General Project Kit (₹499)
SEMESTER LAB #01Controller: Arduino Uno R3 / Nano

Exp #01: Ultrasonic Distance Radar & Proximity Alarm

Measure exact distance in centimeters (2cm to 400cm) using high-frequency sound wave time-of-flight. Trigger LEDs and serial alerts when an obstacle approaches within 20cm.

[ 1. BREADBOARD PINOUT MATRIX ]
Component PinMicrocontroller PinSuggested WireEngineering Notes
VCC5VRed JumperRegulated 5V DC power rail
GNDGNDBlack JumperCommon system ground
TRIGPin D9Yellow Jumper10µs trigger pulse output
ECHOPin D10Green JumperPulse duration input
LED Anode (+)Pin D13 (via 220Ω)Blue JumperVisual proximity alert indicator
[ 2. REALISTIC COMPONENT WIRING DIAGRAM ]
Exp #01: Ultrasonic Distance Radar & Proximity Alarm realistic component wiring schematic
Color-Coded Jumper Routing Legend:
Red Line:Arduino 5V Power Pin ➔ HC-SR04 VCC
Black Line:Arduino GND Pin ➔ HC-SR04 GND
Blue Line:Arduino Pin D9 ➔ HC-SR04 TRIG
Yellow Line:Arduino Pin D10 ➔ HC-SR04 ECHO
[ 3. VERIFIED ARDUINO C++ FIRMWARE ]
// ============================================================
// EKD GENERAL PROJECT KIT - EXPERIMENT #01
// Title: Ultrasonic Distance Meter & Visual Threshold Alarm
// Microcontroller: Arduino Uno R3 / Arduino Nano
// ============================================================

const int trigPin = 9;
const int echoPin = 10;
const int alertLedPin = 13;

long duration;
int distanceCm;

void setup() {
  Serial.begin(9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(alertLedPin, OUTPUT);
  Serial.println(F("[EKD LAB ENGINE] HC-SR04 Distance Sensor Active."));
}

void loop() {
  // Clear trigger pin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  
  // Transmit 10 microsecond ultrasonic burst
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  
  // Measure echo pulse width (time taken in microseconds)
  duration = pulseIn(echoPin, HIGH, 30000); // 30ms timeout
  
  // Speed of sound = 343 m/s = 0.0343 cm/µs. Round-trip divided by 2
  distanceCm = duration * 0.034 / 2;
  
  if (distanceCm > 0 && distanceCm <= 400) {
    Serial.print(F("Distance: "));
    Serial.print(distanceCm);
    Serial.println(F(" cm"));
    
    // Proximity trigger (under 20cm)
    if (distanceCm < 20) {
      digitalWrite(alertLedPin, HIGH);
    } else {
      digitalWrite(alertLedPin, LOW);
    }
  } else {
    Serial.println(F("Sensor Out of Range!"));
    digitalWrite(alertLedPin, LOW);
  }
  
  delay(100); // Refresh rate
}
[ 4. SEMESTER VIVA & PRACTICAL EXAM DEFENSE ]

Q1:Why do we divide by 2 in the distance formula?

Model Answer: Because the pulse travels from the transmitter to the obstacle and then bounces back to the receiver. Dividing by 2 yields the one-way distance.

Q2:What is the blind spot of the HC-SR04?

Model Answer: Objects closer than ~2cm cannot be measured accurately because the receiver begins detecting before the transmitter has completely finished ringing down.

NEED CUSTOM EXPERIMENT CODES OR SENSOR LIBRARIES?

Building a Specific Capstone Project?

Message our student tech desk on WhatsApp. Send us your project problem statement, and we will recommend the exact sensor wiring and starter sketch.