Ad Code

Responsive Advertisement

Ticker

6/recent/ticker-posts

How To Make a Hands-free Hight measurement device using Ultrasonic sensor simple Circuit

 How To Make a Hands-free Hight measurement device using Ultrasonic sensor simple Circuit


o make a project using an ultrasonic sensor, an I2C LCD display, and Arduino to measure the height of a person standing under the sensor, follow these steps:

Components:

  1. Arduino UNO (or similar)
  2. Ultrasonic Sensor (HC-SR04)
  3. I2C LCD Display (16x2)
  4. Jumper Wires
  5. Breadboard (optional)
  6. Power supply (USB or battery)

Working Principle:

The ultrasonic sensor will be mounted on the roof. It will measure the distance from the sensor to the top of the person's head. Since you know the distance from the sensor to the floor, the height of the person will be calculated by subtracting the measured distance from the total height of the room.

Steps:

  1. Connect the Components:

    • Ultrasonic Sensor HC-SR04:
      • VCC to 5V
      • GND to GND
      • Trig to Arduino Pin 9
      • Echo to Arduino Pin 8
    • I2C LCD Display:
      • SDA to Arduino A4
      • SCL to Arduino A5
      • VCC to 5V
      • GND to GND

Video Link: - Click Here For Video

How To Make a Hands-free Hight measurement device using Ultrasonic sensor simple Circuit: -




How To Make a Hands-free Hight measurement device using Ultrasonic sensor Arduino Programming: -

Arduino IDE Program

#include <LiquidCrystal_I2C.h> // Include the I2C LCD library

#define TRIG_PIN 9 // Ultrasonic Sensor TRIG pin
#define ECHO_PIN 8 // Ultrasonic Sensor ECHO pin
#define MAX_DISTANCE 400 // Maximum distance to measure (in cm)

// Create an instance of the LCD
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C LCD address and size (0x27 is common)

// Constants
const int roomHeight = 400; // Height from the sensor to the floor in cm

void setup() {
  lcd.init(); // Initialize the LCD
  lcd.backlight(); // Turn on the backlight
  pinMode(TRIG_PIN, OUTPUT); // Set TRIG pin as output
  pinMode(ECHO_PIN, INPUT); // Set ECHO pin as input
  lcd.setCursor(0, 0); // Set the cursor to the first row
  lcd.print("Measuring..."); // Print initial message
  delay(1000);
}

void loop() {
  delay(50); // Small delay to prevent jitter

  // Trigger the ultrasonic sensor
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  // Read the echo pin
  long duration = pulseIn(ECHO_PIN, HIGH);

  // Calculate the distance in cm
  float distance = duration * 0.0344 / 2;

  if (distance > 0 && distance < roomHeight) {
    float height = roomHeight - distance; // Calculate the height
    float heightInFeet = height * 0.0328084; // Convert cm to feet
   
    // Display the height on the LCD
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Height:");
    lcd.setCursor(0, 1);
    lcd.print(height, 1); // Display height in cm with 1 decimal place
    lcd.print(" cm ");
    lcd.print(heightInFeet, 1); // Display height in feet with 1 decimal place
    lcd.print(" ft");
  } else {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("No Person");
  }

  delay(1000); // Refresh every second
}




-----------------------------------------------------------------------------------------------------------------------------

Explanation:

  1. Ultrasonic Sensor: Measures the distance from the sensor to the object (person). If someone is standing under the sensor, it returns a distance in cm.
  2. Room Height: Set the height from the sensor to the floor. When a person stands under the sensor, the height of the person is calculated by subtracting the measured distance from the total room height. Currently Kept: - 400 cm
  3. LCD Display: Shows the person's height in both centimeters and feet.

Circuit Simulation:

You can use Tinkercad to simulate this project by adding the ultrasonic sensor, buzzer, and Arduino. Run the simulation to check how it works! Let me know if you need more details or help setting up.

Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to #ArduinoProjects #UltrasonicSensor #HeightMeasurement #TechDIY #WeTechCreators

Post a Comment

0 Comments

Ad Code

Responsive Advertisement