Height Measurement Using Ultrasonic Sensor and Dot Matrix on Maker UNO

Let's do a height measurement!


Height is the measurement of someone or something from head to foot or from base to top. Before this, we measure our height using a scale or measuring tape or ruler. Now, let’s try to make something that can measure our height in easiest way.


This video will show you how to make a height measurement using ultrasonic sensor and dot matrix on Arduino.

Hardware Preparation

This is the components needed.

Sample Code

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
#define scrollSpeed 70 // scroll speed
#define scrollPause 0 // ms of pause after finished displaying message
// Hardware SPI connection
// Arbitrary output pins
// sets scrolling direction if slider in middle at start
textEffect_t scrollEffect = PA_SCROLL_LEFT;
textPosition_t scrollAlign = PA_LEFT; // how to align the text
#define BUF_SIZE 75 // Maximum of 75 characters
#define trigPin A0
#define echoPin A1
char testStr[10] = { "" };
String heightStr = "";
long duration;
int distance;
int height;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
void loop() {
if (distance > 60) {
P.displayText("TINGGI", PA_LEFT, 0, 0, PA_PRINT, PA_NO_EFFECT);
} else {
height = 180 - distance;
heightStr = String(height, DEC) + "cm";
heightStr.toCharArray(testStr, 75);
P.displayText(testStr, PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
void measure() {
digitalWrite(trigPin, LOW);
digitalWrite(trigPin, HIGH);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.017;
view raw Height.ino hosted with ❤ by GitHub

References :

  1. Displaying on MAX7219 Dot Matrix Using Arduino

Thank you

Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.

8 thoughts on “Height Measurement Using Ultrasonic Sensor and Dot Matrix on Maker UNO”

  1. Hi. Very nice proyect. It only detects me if I move, I think it is related to material density. Is there a way to improve that? Thank you.

  2. Fuad Bin Samsudin

    Boleh bagi penuh code untuk height measurement. saya dah ikut contoh code yang diberi tapi tidak berfungsi.

  3. Hi 🙂 it’s very useful and amazing project …can u perhaps share the schematic diagram?thank youu in advance

  4. Do we need to connect any power source to this project?
    Others project I saw battery as require item.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

DIY Interactive Robot Using REKA:BIT With Micro:bit
BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
DIY Automated Vacuum Cleaner Using REKA:BIT With Micro:bit
Rainbow Spark in Mini House using Maker Uno.
Tutorials of Cytron Technologies Scroll to Top