In this project, we will learn how to make a height measuring device. The height measuring device is a simple device used to measure the height of a person who stands under it. The device will be installed at a certain height and when anyone stands under the device, the height measuring device will measure the height of the person by subtracting the distance between the device and the person under it from the height at which the device is installed.


Components needed
- Arduino Uno board
- Jumper cables
- 9 volts battery
- I2C LCD
- HC-SR04 Ultrasonic Sensor
- Buzzer
- Breadboard
Completed Circuit

The Code
//Include LCD library
#include <LiquidCrystal_I2C.h>
#include <HCSR04.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal_I2C lcd(0x27,16,2);
UltraSonicDistanceSensor distanceSensor(A0,A1);
float distance;
float boxHeight = 185.0;
int buzzerPin= 8;
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
pinMode(buzzerPin, OUTPUT);
printInstructions();
}
void loop() {
distance = distanceSensor.measureDistanceCm();
Serial.println(distance);
delay(1000);
/*
lcd.clear();
lcd.setCursor(0,0);
lcd.print(distance);
*/
if (distance < 65 ) {
printHeight();
delay(1000);
tone(buzzerPin, 1000);
delay(1000);
noTone(buzzerPin);
delay(5000);
} else {
printInstructions();
}
}
void printInstructions() {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Stand under the");
lcd.setCursor(0,1);
lcd.print("box!");
}
void printHeight() {
int heightInCm = boxHeight - distance;
int heightInInches = heightInCm/2.54;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Height:");
lcd.setCursor(8,0);
lcd.print(heightInInches);
lcd.setCursor(11,0);
lcd.print("IN");
lcd.setCursor(0,1);
//lcd.print(distance);
}
Hi can you help with full code to measure length breadth and height of object
LikeLike
Hi can you help me with the full write up im a form project for a final year student?
LikeLike