Ardunio Height Measuring Device

Back in 2012 I began taking a class in robotics where I only had programming experience and zero electronics experience. During the class my teacher introduced me to the Arduino and asked me to stop by the engineering club after school to work on something new. This project would be the height sensor, my first Arduino project which would be the gateway to electrical engineering for myself.

The purpose of this project was, to create a device which could measure a person’s height and display it back to them. So after some research, I came up with the solution to use a sonar sensor to measure distance between the user and then compared it to the distance of the ground. For the display, we decided to use a LoL shield which the club had lying around and an Arduino uno to do all the computing.

Overall, the project was a success and was even a winner of the Innovation Award at NYIT’s first engineering showcase. Looking back at the project now, it was simple by design but I still remember the difficulty it was for a 15 year old version of me who never even soldered or stripped a wire. I would like to also mention that this project was not completed by myself and my group mates Matt Smith and Mei Schienbaum deserve credit too. Mei helped test the device and did all the documentation and graphs, while Matt was the genius behind the wooden structure you see below.

I hope you enjoyed looking at my first project, below are some pictures from the NYIT fair and the production of the height sensor. I also listed the basic materials and the code attached for you to take a look.

Materials Used

  • Arduino uno
  • LoL shield
  • Maxbotics Ultrasonic sensor
  • Wire
  • Wood

Arduino Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//Code made by Daniel Lukach made for Arduino. You may use it if you credit me 
 
#include <Charliplexing.h> 
#include <Figure.h> 
#include <Font.h> 
#include <Myfont.h>
 
String inch = " inches"; 
int irPin = A4; 
int avgFactor = 10; 
double height; 
int yourHeight = 10; 
void setup() 
  {
 
    Serial.begin(9600); 
    Serial.println("Program Starting"); 
    delay(100); 
    LedSign::Init(); 
    calibrate(); 
    displayCal(); 
 
  } 
void loop() {
 
    check(); 
 
}
 
void calibrate(){
 
    double temp; for (int i = 0; i < 10; i++) {
 
        temp += analogRead(irPin); 
 
    } 
    temp = (temp / 10); temp = temp / 2; height = temp; 
 
} void getHeight() {
 
    float temp;
 
        for(int i = 0; i < 10; i++) {
 
            temp += analogRead(A4); 
 
        }
 
            temp = (temp / 10); temp = temp / 2; yourHeight = height - temp; if(yourHeight == 68)
 
                {
 
                    yourHeight = yourHeight + 1; 
 
                } 
 
            else {
 
                yourHeight = yourHeight + 1; 
 
            } displayNum(); 
 
} 
void displayNum(){ unsigned char tempText="Only way I can get this to work but needs to be longer than the total text displayed later in the code. Sloppy indeed. \0";
 
    int tLen=0; // Reset text length variable
 
        sprintf((char )tempText,"%d in",yourHeight); for(int i=0; ; i++){ //get the length of the text
 
            if(tempTexti==0){ tLen=i; break; } 
 
        } Myfont::Banner(tLen,tempText); 
 
} //displays calibration completed void displayCal() //displays that calibration is completed { unsigned char tempText="Only way I can get this to work but needs to be longer than the total text displayed later in the code. Sloppy indeed. \0";
 
    int tLen=0; // Reset text length variable
 
        sprintf((char )tempText,"cald"); for(int i=0; ; i++){ //get the length of the text
 
            if(tempTexti==0){ tLen=i; break; } 
 
        } Myfont::Banner(tLen,tempText); //Sends the text to LoL shield 
 
}
 
void check() //checks to see if person is there {
 
    int temp = analogRead(A4) / 2; 
 
    if( temp > 80) {
 
        calibrate(); displayCal(); 
 
    } else if( temp < 70) {
 
        getHeight(); 
 
    } 
 
} //End of Code

 

The Height Sensor during build phase.

The birdhouse looking box was on a hinge for easy access to the Arduino when the device was completed.

The height sensor during the NYIT fair, fully operational and into the ceiling!

The height sensor being used. Thanks Binoy!

Explaining the height sensor to the judges.

The judges seemed to like it!

Achieving the Innovation Award.From Left(Judith Murrah,Matt S, Daniel Lukach(My bushy hair days), Mei.S and Mr. Castrogivanni)

This entry was posted in Electronics, Portfolio. Bookmark the permalink.

4 Responses to Ardunio Height Measuring Device

  1. MINNITI says:

    Which Maxbotics Ultrasonic sensor do you used please? what was the precision of your system?

    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *