Project tutorial
DIY Arduino Height Measuring Machine

DIY Arduino Height Measuring Machine © GPL3+

A practical device for automatic measuring human height.

  • 1,993 views
  • 4 comments
  • 10 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

When I noticed that my kids were measuring their height every day, I got the idea to make such a device. To find out your height, all you have to do is stand under the device and activate a sound that indicates that your height has been measured.

It is very easy to build and consist only a few components:

-Arduino Nano

-HC SR04 ultrasonic sensor

-LCD display

-Buzzer

-Battery

Now let's explain how it works:

First we need to install the device with the help of double-sided adhesive at a certain height, which is previously defined in the code, and is marked with the letter H on the picture

When someone stands under the device, the sensor measures the distance D. Next the code calculates the distance H-D which actually represents the height of the person under the device H1 and displays this value on the LCD. Library "LcdBarGraph" helps draw horizontal bargraph, where the length of the bar is proportional to the values provided. When there is no one under the device, the calculated value is zero because in this case H = D and H-D is zero. The device is mounted in a suitable box with the LCD on the front and the ultrasonic sensor on the bottom.

The required libraries, code and schematic are given below

Code

CODEArduino
// includes the LiquidCrystal Library
#include <LiquidCrystal.h> 

// includes the LcdBarGraph Library
#include <LcdBarGraph.h>

// Maximum distance we want to ping for (in centimeters).
#define max_distance 200

// Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 

LcdBarGraph lbg(&lcd, 16, 0, 1); // Creates an LCD Bargraph object.

const int trigPin = 9;
const int echoPin = 10;
long duration;
int distance;
int distance1;
int speakerPin = 8;
void setup() 
{
  lcd.begin(16,2); // Initializes the interface to the LCD screen
  
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

void loop() 
{
  // Write a pulse to the HC-SR04 Trigger Pin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  
  // Measure the response from the HC-SR04 Echo Pin
  duration = pulseIn(echoPin, HIGH);
  
  // Determine distance from duration
  // Use 343 metres per second as speed of sound
  distance= duration*0.034/2;
  distance1= 180 - distance ;
  // Prints "Distance: <value>" on the first line of the LCD

  if (distance1 > 100) {
   tone (speakerPin, 1000);
  
   } else {
    noTone (speakerPin);

  }
  lcd.setCursor(0,0);
  lcd.print("HEIGHT: ");
  lcd.print(distance1);
  lcd.print("  cm  ");

  // Draws bargraph on the second line of the LCD
  lcd.setCursor(0,1);
  lbg.drawValue(distance1, max_distance);
  delay(500);
}
LibrariesArduino
No preview (download only).

Schematics

Schematic
Untitled sketch bb 49bhlimfu1

Comments

Similar projects you might like

DIY Simple Measuring Wheel with Rotary Encoder

Project tutorial by Mirko Pavleski

  • 4,416 views
  • 1 comment
  • 15 respects

DIY Universal CNC Machine

Project tutorial by Arduino “having11” Guy

  • 31,850 views
  • 8 comments
  • 87 respects

DIY Si4730 All Band Radio (LW, MW, SW, FM)

Project tutorial by Mirko Pavleski

  • 22,365 views
  • 8 comments
  • 56 respects

DIY Quail Hatching Machine

Project showcase by Alexander Galilov

  • 3,464 views
  • 0 comments
  • 12 respects

DIY Air Quality Monitor with Sharp GP2Y1010AU0F Sensor

Project tutorial by Mirko Pavleski

  • 3,715 views
  • 2 comments
  • 8 respects

MobBob: DIY Arduino Robot Controlled by Android Smartphone

Project tutorial by Mirko Pavleski

  • 6,305 views
  • 6 comments
  • 42 respects
Add projectSign up / Login