Home Guestbook Quadrature Encoder version
Section Top Operation How It Works Parts Construction Enclosures Dot Matirx Display Micro Switch Schematic Vero Boards 3D Printer Files Code
ARDUINO DIGITAL STADIOMETER
HC-SR04 ULTRASONIC VERSION click for Quadrature Encoder version
Measure height in Meters/Feet & Inches using an Arduino NANO, HC-SR04 and 8 MAX2719 Dot Matrix Displays
|
||
Main Functions Measures height on a conventional commercially available height chart Sliding and locking height bar for accurate readings Height can be recorded on the height chart manually in pen using a 3D printed pen slot on the height bar Digital measurement using an HC-SR04 module Display height in meters and feet & inches on a scrolling dot matrix display Any measurement can be saved and can be compared to the latest reading Matrix display Brightness control |
Operation
Release the height bar using the locking lever and slide the height bar up out of the way.
Stand on the platform at the base of the stadiometer and slide the height bar down to your head.
Keeping your feet flat to the platform and the height bar released straighten your body to get you max height.
You will feel the height bar move slightly as you adjust to your position correctly.
Once in position lock he height bar in position by pulling the lever down.
You can now step away from the stadiometer and press the measure button.
Height in millimeters and feet and inches will be displayed.
The height can be stored by pressing the Save Height button.
On next measurement pressing the height change button displays the change of height in mm.
If you want to record the measurement on the printed height chart use a marker pen to draw a line using the pen guide fixed to the height bar.
Baby photo created by wuttichai1983 - www.freepik.com
Hand written dates next to marked line from the marker pen guide.
Marker Pen Guide 3D printed and is fixed to the height bar.
Note if you are measuring a small child keep clear of the stadiometer when pressing measure so as not to effect the readings.
Use the remote measure button in this case.
The wired remote is any button wired across the measure switch in this case an old camera remote shutter release.
How It Works
The stadiometer uses the HC-SR04 Ultrasonic distance sensor module. This consists of two ultrasonic transducers.
One acts as a transmitter which converts electrical signal into 40 KHz ultrasonic sound pulses and the other a receiver listens for the transmitted pulses.
If it receives them it produces an output pulse whose width can be used to determine the distance the pulse travelled.
The sensor is small and offers excellent non-contact range detection between 2 cm to 400 cm /13ft with an accuracy of 3mm.
It operates on 5 volts and can be hooked directly to an Arduino or any other 5V logic microcontrollers.
Extract and animations below from https://lastminuteengineers.com/
How Does HC-SR04 Ultrasonic Distance Sensor Work?
It all starts, when a pulse of at least 10 µS (10
microseconds) in duration is applied to the Trigger pin.
In response to that the sensor transmits a sonic burst of eight pulses at 40 KHz. This 8-pulse pattern makes the “ultrasonic signature” from the device unique,
allowing the receiver to differentiate the transmitted
pattern from the ambient ultrasonic noise.
The eight ultrasonic pulses
travel through the air away from the transmitter. Meanwhile the Echo pin goes
HIGH to start forming the beginning of the echo-back signal.
In case, If
those pulses are not reflected back then the Echo signal will timeout after 38
mS (38 milliseconds) and return low. Thus a 38 mS pulse indicates no obstruction
within the range of the sensor.
If those pulses are reflected back the Echo pin goes low as soon as the signal is received.
This produces a pulse whose width varies between 150 µS
to 25 mS, depending upon the time it took for the signal to be received.
The width of the received pulse is then used to calculate the distance to the
reflected object.
In the animation above we have an object in front of the sensor at an unknown distance and we received a pulse of width 500 µS on the Echo pin.
To calculate how far the object from the sensor is. We
will use the equation below.
Distance = Speed x Time
We have the
value of Time i.e. 500 µs and we know the speed as the sound pulses travel
at the speed of sound.
Sound at ground level travels at 340 m/s or 340000 mm per second.
Distance in mm = 340000mm x 500 µs
or Distance in mm = 340000mm x 0.0005s
Distance = 170mm
The pulse indicates the time it
took for the signal to be sent out and reflected back so to get the distance so,
you’ll need to divide the result in half.
Distance = 170mm/2
Distance = 85mm
So, now we know that the object is 85mm away from the
sensor.
HC-SR04 Stadiometer example The example on the left shows a HC-SR04 module used in this stadiometer. The HC-SR04 module is housed in the top of the stadiometer firing downwards. The transmitted sound pulses hit the sliding height bar and are reflected back to the receiver. The time for the transmitted pulse to be received is 7940µs. Using the formulae above Distance = Speed x Time
Distance = 2700mm
This time to work out the child's height in the stadiometer we have to take the distance measured off the height of the sensor from the bottom of the measuring board. The sensor is 2000mm from the base of the stadiometer. The child's height is 2000mm - 1350mm = 650mm or 2ft 1.5" .
|
Increasing accuracy with temperature and humidity compensation
The speed of sound is not a constant and varies with temperature and humidity.
A DHT22 temperature and humidity sensor is added to the circuit to compensate for any changes in the speed of sound.
The Speed of sound with temperature & humidity compensation can be calculated as speed = 331.4 + (0.606 * temp) + (0.124 * hum) M/S
Parts Required
Timber
The structure of the stadiometer is build from re-cycled timber. The main backing is 2 lengths of scrap oak engineered wood flooring joined together and braced with timber batons.
A length of timber fixed to the side provides strength and also provides support for the height bar slide.
Guide Clamp
I fixed the wooden height bar to an old wood workers guide clamp. This allows the height bar to be slid up and down to rest on the top of the subjects head.
A lever clamps the height bar in place and also lifts the the height bar by 4mm so your subject can walk out of the machine without having to raise the bar.
Height Chart
I used a standard height chart from Amazon. There there many types to choose from and come rolled up printed on a plastic canvas.
MAX7219 Dot Matrix Module 4 in 1
The display comprises of 2 x MAX7219 Dot Matrix Module. Each module has four 8x8 led matrixes each controlled by a seperate MAX7219 IC.
The modules are daisy chained length ways to make the full 8 matrix display.
HC-SR04 Sensor
Height is measured using an HC-SR04 Sensor
Ultrasonic pulses are sent from the transmitter on the left and the reflected pulses are picked up by the receiver on the right.
The pulses travel at the speed of sound and the time it takes for the pulse to be reflected off the height bar is used to calculate the height of the bar.
A mount is 3D printed to hold it in the case and also to space the components away from the case itself.
DHT22 Module
The speed of sound is not constant and varies with temperature and humidity so a DHT22 module is used to automatically compensate for these changes.
Control Panel
The control panel houses 6 buttons, 2 off push to make locking and 4 off push to make non locking.
There is also a remote push to make non locking that has the same function as the "Measure" button.
3D Printed Parts
Various 3D printed parts are used and I have included them is case a 3D printer is available.
These parts can be made up from locally sourced materials if a 3D printer is not available.
3D Printed Height Bar Bearing support
Sensor and PCB case 3D printed
A full list of 3D parts will be included at the end including a link to the parts on Thingiverse
Left & Right Hand Profiles
Construction
Dot Matrix Module Modification
Each of the 8 MAX2719 modules will need to be modified.
The data sheet calls for Supply Bypassing to minimize power-supply ripple due to the peak digit driver currents,
connect a 10µF electrolytic and a 0.1µF ceramic capacitor between V+ and GND as close to the device as possible.
The MAX7219/MAX7221 should be placed in close proximity to the LED display, and connections should be kept as short as possible to minimize the effects of wiring inductance and electromagnetic interference.
Also, both GND pins must be connected to ground.
My modules had a 0.1µF ceramic capacitor between V+ and GND but the 10µF electrolytic capacitor was not fitted.
I fitted these 10µF electrolytic capacitors to the front of every module by removing the dot matrix LED panel then soldering capacitors to the V+ and ground pins.
above and below Missing Bypass Capacitor soldered in place below the LED Matrix
Alternatively the capacitors can be soldered to the back of the modules. This is quicker and easier but increases the depth of the module.
Main Stadiometer Build
The Stadiometer is built from scrap timber left over from other projects.
The main timber is 2200mm x 18 hardwood engineered Oak flooring joined and braced at the rear.
Bracing and slide mount is 45x20m timber with 38x10mm sides.
Plan Views
Front and Rear Views
Height Bar
The height bar is cut from an off cut of hardwood flooring and is bolted the slide rail.
Height bar in position bolted to the sliding clamp. Plastic cover hide the sliding clamp.
The height bar is supported by a support bearing that runs off the wooden back panel.
Plastic end caps hide the modified end stops top and bottom.
Detail of 3D printed adjustable bearing support
Right side view
Detail of height bar fixing and slide clamp with 3D printed cover removed.
The height bar is bolted to the sliding clamp below.
The lever locks the slide in place when measuring.
The top and bottom stops of the guide clamp are modified by chopping the plastic stops flush with the alumnium channel.
Control Panel
The control panel is 3D printed from 2 parts the lower box and upper panel for the labels.
The upper box is printed in 2 layers white then black for the square button bounderies.
2 layer printing setup instructions can be viewed here Printing 2 colour layers
HC-SR04 Sensor/Vero Board Case
The HC-SR04 sensor module is mounted in a 3D printed case with the sensors pointing down the Stadiometer.
The case also holds the Vero Board.
Dot Matrix Display Case
The case for the Matrix display is cut from a solid piece of wood flooring.
A cutout is made the same size of the dot matrix display modules using a jigsaw.
Rear of case wish modules in place. Foam strips hole the LED Matrix modules in place against the Perspex from cover.
The rear cover plate is made from an off cut of plywood, the rear and sides are painted black.
Two wooden legs are fixed to the rear of the cover with screws.
The rear cover is fixed to the back of the case with M2 woodscrews.
The front of the display case is shown below without the neutral density Perspex cover in place.
Without the neutral density cover the display lacks contrast and is difficult to see in daylight.
The pic below shows the difference the neutral density Perspex makes with only the red LEDs showing once its in place.
Completed Matrix display in case. The Perspex sheet is fixed in place by 4 M2 screws and washers.
The display in position on the stadiometer. The display case legs are screwed in place through the back of the stadiometer.
Height Bar Stop & Micro Switch
Mounted on the side of the stadiometer the micro switch is adjusted in it's mount until it just operates before the height bar hits the stop.
The stop prevents the micro switch being damaged if the height bar is forced up too far.
A 3D printed plastic cap is fitted over the top and bottom stops.
The cutaway image below shows the lower end stop 3D printed cover in place.
The plastic cap is fixed to the timber baton below the guide rail.
Schematic
Measure remote is wired away from the stadiometer and allows measurement of small children away from the stadiometer without affecting the measurement
Vero board Layout
Vero board with NANO & DHT22 module in place
Vero board Rear view flipped up
A spacer for the Vero Board is 3D printed to hold it away rom the case.
3D Printer Files
Contains all the files to print in Cura as well as FreeCad files
Code
Arduino Files