Ultrasonic Tape Measure
Group 19
Temitayo Akinrefon
Erlande Janvier
Wendy Nguyet Nguyen
July 22, 2002
Advisor: Dr. Samuel Richie
What is UTM?
The Ultrasonic Tape Measure (UTM)
is a device that will measure distances
between objects using ultrasonic sound
(or ultrasound).
Presentation Outline
• Project Specifications
• Research
• Hardware Design & Key Components
• Software Design
• Administrative Tasks
• Project to Date
Specifications & Requirements
• 95% accurate
• Measurement range: 2 feet to 25 feet (0.6m - 7.6m)
• Physical dimension: 6.5” x 2.5” x 1.5”
• Receive and display geographical altitude input
• Measure and display temperature
• Not designed to measure object dimensions
• Not at peak performance when measuring
diagonal distances
• Not designed to work in „cluttered‟ areas
Research
What is sound?
• Sound - Radiant energy that is transmitted in
longitudinal waves that consist of compression
and refraction in its medium
• 3 basic classes of sound
– Infrasonic: below human hearing
– Audible (20 Hz-20kHz)
– Ultrasonic: above human hearing
Encyclopedia Britannica
What Affects Sound?
• Two factors that affect sound:
– Altitude
– Temperature
• Speed of sound is directly dependent on
temperature and altitude
– altitude inversely proportional temperature
(to a point)
– temperature is directly proportional Vsound
Sound Equations: Altitude & Temperature
• Three atmospheres:
– Troposphere
– Lower Stratosphere
– Upper Stratosphere
• In most climates, altitude will determine temperature and
temperature will determine speed of sound
• Equation of temperature with altitude dependency
• From surface to 11019.3 m: T=59-.00356*h---troposphere
• 11019.3 m to 25099.1 m: temperature remains constant
• Equation of speed with temperature dependency
• Speed = 331*(1+T/273)^0.5
www.grc.nasa.gov/www/K-12/airplane/sound.html
Sound Equations: Altitude & Temperature
• Altitude has no great effect on sound waves in the
troposphere
Altitude
(m)
Temperature
(C)
Speed
(m/s) Comments
0 15 340
5000 -17 320 Increasing the altitude by 5000m
only decreased the speed by 6%
8580 -40 305 Highest recorded hiking of
Mount Everest
10000 -49 299 Increasing the altitude by 1420m
only decreased the speed by 2%
In total the final decrease in speed in the troposphere is 12%
Sound Equations: Altitude & Temperature
• Since there is no need to account for altitude, there
is no need to use first equation.
• Equation of speed with temperature dependency is
useful:
– Air conditioning
– Drastic regional climate differences (ie. Florida)
Original System Block Diagram
LCD
Display
Ultrasonic 40 kHz Pulse
Transmit Oscillator Generator
INIT
Transducer
Micro
Controller
Threshold Detector
Ultrasonic
Receive Amplifier Comparator
ECHO
Transducer
Temperature Altitude
Power To All Sensor Input
Supply
Components
Piezo Transducers
• Types of Ultrasonic Transducers
– Piezoelectric Transducers
– Electrostatic Transducers
LCD
Display
INIT Ultrasonic 40 kHz Pulse
Transmit Oscillator Generator
Transducer
Micro
Controller
Threshold
ECHO Ultrasonic Detector
Receive Amplifier Comparator
Transducer
Temperature Altitude
Power To All Sensor Input
Supply Components
555 Timer: Pulse
• Pulse:
– Dinput causes the output to increase from 0 to Vcc
– Holds Vcc for a moment
– The output dissipates to 0
LCD
Display
INIT Ultrasonic 40 kHz Pulse
Transmit Oscillator Generator
Transducer Micro
Controller
Threshold Detector
ECHO Ultrasonic
Receive Amplifier Comparator
Transducer
Temperature Altitude
Power To All Components Sensor Input
Supply
555 Timer: Oscillation
• Oscillation:
– series of pulses
LCD
Display
INIT Ultrasonic 40 kHz Pulse
Transmit Oscillator Generator
Transducer Micro
Controller
Threshold Detector
ECHO Ultrasonic
Receive Amplifier Comparator
Transducer
Temperature Altitude
Power To All Components Sensor Input
Supply
555 timer: Pulse and Oscillation
Reprinted From Iguana Labs Reprinted From Iguana Labs
Pulse Oscillation
Output Output
VCC
VCC
Time Time
Varitronix S16264 Liquid Crystal Display
• Display size: 1.91" x 0.48“
• Module size: 2.6" x 1.46"
• Character size: 0.16" x 0.1“
• 16 pin serial input
• 5 x 8 dot format
• Blue digits on light blue Used with permission from all electronics Corp.
(near white) background.
LCD Display: Testing
• Parts used in testing LCD display:
– d.i.l switch, toggle switch, momentary action switch,
potentiometer, several 4.7Kohm resistors
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
LCD
LED R/
(-) LED (+) DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 E W RS Vo Vdd Vss
LCD Display: Testing
Reprinted with permission from Everyday Practical Electronics
MV 8515 Microcontroller
• AVR family
• ATMEL 8515 + Built-in BASIC interpreter
• Similar to BASIC stamp
• 512 bytes EEPROM
• Runs 10x‟s faster than the PIC Z80 or 8051 type controllers
• RS 232 port used -- Special development kits are not
required
• Intended for small, low-end applications
• 32 x 8 General Purpose Working Registers
MV 8515 Microcontroller
PB0 1 40 Vcc
PB1 2 39 PA0
ADCINPB2 3 38 PA1
PB3 4 37 PA2
PB4 5 36 PA3
PB5 6 35 PA4
PB6 7 34 PA5
PB7 8 33 PA6
RESETL 9 32 PA7
RX1/PD0 10 31 nc
TX1/PD1 11 30 nc
Reprinted from
RX2/PD2 12 29 nc http://www.akizuki.ne.jp/ashop/atmel-dev.htm
TX2/PD3 13 28 PC7
RX3/PD4 14 27 PC6
TX3/PD5 15 26 PC5
DACOUT/PD6 16 25 PC4
TX4/PD7 17 24 PC3
XIN 18 23 PC2
XOUT 19 22 PC1
GND 20 21 PC0
MV 8515 Microcontroller
PB0 1 40 Vcc
Ranging
PB1 2 39 PA0
Module
Temperaure
ADCINPB2 3 38 PA1
Sensor
PB3 4 37 PA2
PB4 5 36 PA3
PB5 6 35 PA4
PB6 7 34 PA5
PB7 8 33 PA6
RESETL 9 32 PA7
RX1/PD0 10 31 nc
TX1/PD1 11 30 nc
RX2/PD2 12 29 nc
TX2/PD3 13 28 PC7
LCD
RX3/PD4 14 27 PC6
TX3/PD5 15 26 PC5
DACOUT/PD6 16 25 PC4
TX4/PD7 17 24 PC3
XIN 18 23 PC2
XOUT 19 22 PC1
GND 20 21 PC0
LCD Test Code
• Used port C and Port A
(3 bits)
• 8-bit function
• Two line, non scrolling
input
• Subroutine used to
trigger the enable line
Temperature Sensor & Ranging Module
Test Code
• Temperature Sensor
– Used port A (3 pins)
• Toggle function makes it possible
– Had difficulties programming TLow and Thigh
• Ranging Module
– Used Port B
– Only 2 Pins are needed for ranging module to work
Key
Components
&
Hardware
Design
How does UTM work?
• User presses the button on the UTM for measurement
• Initial signal of ultrasound is sent out through the
transmitter of the transducer
• Ultrasound hits object and bounces back as ECHO, which is
then received by the receiver of the same transducer
• Time of flight for transmitting and receiving ultrasound is
then measured, calculated, and converted to distance
measurement.
Revised System Block Diagram
LCD
Display
Ranging Module
Ultrasonic 40 kHz Pulse
Transmit Oscillator Generator
INIT
Transducer
Micro
Controller
Ultrasonic
Receive Amplifier Filter
ECHO
Transducer
Temperature
Power To All Sensor
Supply
Components
Key Components
• Polaroid 6500 Ultrasonic Ranging Module
• BasicStamp2e Micro-Controller
• Polaroid Ultrasonic Transducer
• SEE-BPI-216 Liquid Crystal Display (LCD)
• DS1620 Temperature Sensor
• Parallax Carrier Board
Polaroid 6500 Ranging Module
Features:
• Accurate Sonar Ranging from 6
inches to 35 feet Dimension 2.222” x 1.778”
• Drives 50-kHz Electrostatic
Transducer with No Additional
Interface
• Operates from Power Supply of 4.5 –
6.8 Vdc
• Accurate Clock Output Provided for
External Use
• Selective Echo Exclusion
• Multiple Measurement Capability
• Uses TI TL851 and SN28784N Sonar
Ranging Integrated Circuits
• Convenient Terminal Connector
• Variable Gain Control
Potentiometer Permission pending from Acroname, Inc.
How Ranging Module Works
• Generates the drive signal for the transducer
• Controls timing functions
• Receives, amplifies and filters the returning echo
• Processes the signal and provides a TTL output
when the echo returns
• Measures the elapse time between INIT and ECHO
return
Polaroid Ranging Module Schematic
With Acroname’s permission
Functional Block Diagram of TL851
With Polaroid’s permission
Schematic of The SN28784N
With Polaroid’s permission
Example of Single-Echo-Mode Cycle
With Acroname’s permission
DS1620 Temperature Sensor
Features:
• Requires no external components
• Supply voltage range from 2.7V to 5.5V
• Measures temperature from
-55°C to +125°C in 0.5°C increments (-67°F to
+257°F in 0.9°F increments) in every second
• Converts temperature to digital word in 1 second
(max)
• 9-bit data reading
• Data is read from/written via a 3-wire serial With Dallas Semiconductor’s permission
interface (CLK, DQ, RSTLOW)
• Applications include thermostatic controls,
thermometers, and other thermally sensitive
systems
Temperature Measuring Circuitry
With Dallas Semiconductor’s permission
SEE-BPI216 Liquid Crystal Display
• 2 lines x 16 chars LCD Dimension 36 x 80 mm
• Display size: 13.8 x 64.5
mm
• Supply Power of 4.8 to
5.2Vdc at 3mA
• Connector pinout
+5 – GND – SER – GND – +5
• Serial input RS-232 at With Scott Edwards Electronics’ permission
2400 or 9600 baud rate
BPI-216 LCD Backpack
With Scott Edwards Electronics’ permission
Positioning the Cursor on LCD
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
LINE 1 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
LINE 2 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
To position the cursor, use the instruction-prefix byte, ASCII 254, followed by
the set-position byte value.
Example: will move the cursor to line 2, character 4.
BS2e Microcontroller
Dimension 1.2 in x 0.62 in
• 24 pin DIP Module
• Combination of surface mount
components including Scenix
SX28AC/SS
• 16K bytes of EEPROM
• 32 bytes of RAM
• 20MHz/4,000 instructions per
second
• 4,000 lines of PBASIC code
• RS 232 serial port – source
code downloaded via this port
With Parallax’s permission
BS2e Microcontroller Schematic
With parallax’s permission
Software Design &
Algorithm
Software Design and Algorithm
• PBASIC language
• Source code run and downloaded via RS-
232 port
Algorithm:
• Since temperature has some influence on
speed of sound, temperature is taken into
account for calculation of the distance
measurement
Software Design and Algorithm
• Equation used for speed of sound
depending on temperature
v = 331 * T/273 m/sec
(where T is in Kelvin and T = °C + 273.15)
• Timer uses 500KHz clock frequency (2usec
per clock tick)
• Max range of ranging module is 35 feet =
420 inches, roundtrip = 840 inches
Software Design and Algorithm
• Equation for conversion factor
840 * (time that sound travels 1 in) / 2usec
= # of ticks at max range
convfac (ticks/in) = # of ticks at max range / 420
• Equation for distance
d = (echo time + offset time) / convfac
Software Design and Algorithm
• DS1620 only reads temperature in °C.
Conversion to °F is implemented in code
F = (C * 1.8) + 32
• Code is written to allow temperature
sensor to read temperature every second.
• Display new readings of temperature and
distance measurement every second
Administrative
Tasks
Distribution of Work
Wendy Nguyen Erlande Janvier Temi Akinrefon
• Ranging module •Sound equations and • MV8515 Microcontroller
• Temperature sensor research • Software interface
• Software/Hardware •Ultrasonic transducers
interface •Temperature sensor
•LCD interface •
Basic Stamp 2e
research and
implementation
Milestone Chart
Budget & Financing
Part Quantity Price ($)
(including S/H)
Polaroid Ranging Module 1 46.00
Polaroid Transducer 2 24.00
BSe2 Microcontroller 2 144.00
Parallax Carrier Board 1 77.35
DS1620 Temp Sensor 5 Donated by Maxim
SEE LCD Module 1 77.00
9-volt Battery 2 4.86
AA Battery 4 3.97
Battery Holder 1 1.79
Total Cost 378.97
Difficulties
• Not on the same page
– Different goals for the project
– Different definitions of group work, individual work,
original work
– Changing the design once
– Improper communication
Questions or Comments?