emphiasarmlorn
Published © GPL3+

Instant Human Height Detector Gadget

A gadget which instantly detects and displays the height of the object placed under it.

IntermediateShowcase (no instructions)4
Instant Human Height Detector Gadget

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
RGB LCD Shield Kit, 16x2 Character Display
RGB LCD Shield Kit, 16x2 Character Display
×1
9V battery (generic)
9V battery (generic)
×1
9V Battery Clip
9V Battery Clip
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Double Sided
Tape, Double Sided
Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Schematics

Instant Human Height Detector Gadget Connections

Code

Instant Human Height Detector Gadget

Arduino
// Instant Human Height Detector Gadget
//created by aarav_barnwal
//created on 29th May 2020

#include <LiquidCrystal.h>;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define echoPin 8
#define trigPin 9

long duration;
int height;

void setup() {
  pinMode(trigPin,OUTPUT);
  pinMode(echoPin,INPUT);
  
  lcd.begin(16, 1);
  
  lcd.println("Calculating...  ");
  }

void loop() {
  digitalWrite(trigPin,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin,LOW);

  duration = pulseIn(echoPin,HIGH);

  delay(200);

  height =  182.88 - ((duration * 0.034) / 2);

  if(height < 0)
    height = 100;

  lcd.println("   Height:");
  if(height < 10)
    lcd.print("  ");
  if(height < 100 & height >= 10)
    lcd.print(" ");
  
  lcd.print(height);
  lcd.print(" cm  ");
  delay(250);
 


}

Credits

emphiasarmlorn

emphiasarmlorn

1 project • 0 followers

Comments