Rear Distance Detection with Ultrasonic Sensors Project Report

Similar documents
OBSTACLE DETECTION WITH BLUETOOTH CONTROLLED VEHICLE MOTION

A.U.R.A.S Autonomous Ultrasonic Robot for Area Scanning

ECE 271 Microcomputer Architecture and Applications University of Maine

Accelerometer-Based Musical Instrument

Profiler IV Feed Back Version DC Motor Control Board with Current Profiling Capability Variable travel length version

V1BOOST-STEPPER Unipolar Stepper Motor BoosterPack for the MSP430 LaunchPad. User s Guide

AUDIO AMPLIFIER PROJECT

Professional Radio GM Series. Controlhead Service Information

REX F-0-9 Standalone or Access Controller

Controlling and Monitoring Of Industrial Parameters by Using GSM

AQA GCSE Design and Technology 8552

Handson Technology. HC-SR04 Ultrasonic Sensor Module. 1

Final Design Report. Team Name: No Rest for the Weary

USB-4303 Specifications

VBattery 7 VCC V DD IRLED IS31SE5001 SDA SCL INTB SDB. Figure 1 Typical Application Circuit

TB6600 Stepper Motor Driver

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

Appendix F: Design Documentation for multisensory therapy system

Tic-Tac-Toe with mtouch. Version 1.0. June Cytron Technologies Sdn. Bhd.

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Goal: We want to build an autonomous vehicle (robot)

Academic Year Annexure I. 1. Project Title: Color sensor based multiple line follower robot with obstacle detection

Collision Detection Device

Technical Specification for Educational Robots

Blobo Clone Angry Birds Toy Upgrade. Requirement and implementation specification and test plan

DAQCplate Users Guide

E85: Digital Design and Computer Engineering Lab 1: Electrical Characteristics of Logic Gates

HP07 Digipot Interface Module

DC - Devices and Controller

DEV-1 HamStack Development Board

Simple Sounders and Sensors

University of Moratuwa

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

ECE 511 Project Group 11: MP3 Boombox 12/03/2013. Carlos R Araujo Divya Chinthalapuri Leegia S Jacob Brian D Jarvis Shawn Wilkinson

PR602LCD v1.0 Installer Manual Rev. A

09/05/2014. Engaging electronics for the new D&T curriculum. Geoff Hampson Managing Director of Kitronik. Presentation overview

Finite State Machine Lab

Mercury Baseboard Reference Manual

mi:node User Manual Element14 element14.com/minode 1 User Manual V3.1

Study of LED Electronic Writing Screen based on Single Chip Dengjin Wu 1

One Grove Base Shield board this allows you to connect various Grove units (below) to your Seeeduino board; Nine Grove Grove units, consisting of:

Grove - Buzzer. Introduction. Features

TROUBLESHOOT PROCEDURE SD-NAVI WITH ANC (version 1.00) - Front View -

Laboratory of Sensors Engineering Sciences 9 CFU

SENSOLIGHT SYSTEM FOR HUMP DETECTION IN MOTORCYCLE

GammaTron USB Module

Komando Dash Cam Pro with Night Vision

Arduino Smart Robot Car Kit User Guide

Arduino Internals. Dale Wheat. Apress

Nuvoton Touch Key Series NT1160 Datasheet

SILICON MICROSTRUCTURES

PCB Design for Capacitance Rain Sensor

MP3 Boombox ECE 511 PROJECT GROUP 11 12/03/2013 CARLOS R ARAUJO BRIAN D JARVIS SHAWN WILKINSON DIVYA CHINTHALAPURI LEEGIA S JACOB

IFC-OC04 Interface Free Controller Output Card

SK18A. 18 Pins PIC START-UP KIT. User s Manual V1.1. Dec 2007

Parallel Display Specifications Revision 1.0

SPDM Level 2 Smart Electronics Unit, Level 2

EasyPIC5 Development System

ARDUINO MINI 05 Code: A000087

PIC Dev 14 Surface Mount PCB Assembly and Test Lab 1

Features VCC MIC1810 RESET RESET

Strain gauge Measuring Amplifier GSV-1A8. Instruction manual GSV-1A8, GSV-1A8USB, GSV-1A16USB

FACULTY OF ENGINEERING LAB SHEET

BLACK BOX FOR CAR ACCIDENT

PVK40. User's manual. Feature Rich Development and Educational Kit for 40-pin Microchip PIC microcontrollers

BG1B Universal Gate Drive Prototype Board

TH2683 Insulation Resistance Meter. User s Mannual

EMBEDDED SYSTEMS COURSE CURRICULUM

MIC826. General Description. Features. Applications. Typical Application

Preliminary Design Report

AXE033 SERIAL/I2C LCD & CLOCK

BIG8051. Development system. User manual

Section 3 Board Experiments

Lecture (02) PIC16F84 (I)

Outline. A Computerbased. Instrument for Measuring Distance for a Soccer Free- Kick 10/16/2016. Andy Vongphachanh Matthew Weeks

BMS: Installation Manual v2.x - Documentation

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

DIRRS+ Digital Infra-Red Ranging System Ideal for robotics projects. Singles (SKU # Pack (SKU #35100)

Lab 2.2 Ohm s Law and Introduction to Arduinos

MP6500 Stepper Motor Driver, Digital Current Control

Altec Systems Inc 16 Goldpark Court Woodbridge, Ontario L4L 8V5. Monday October 22, 2007 Project Number

PIC Dev 14 Through hole PCB Assembly and Test Lab 1

GPS+CAMTM. User Manual VS55020

Wall-Follower. Xiaodong Fang. EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering

ASV 2008 Son of a Boatname. Group 1 Michael Podel Gor Beglaryan Kiran Bernard Christina Sylvia

PCI-FPGA-1B User Guide

Lost Item Pager. Project Description. Russ Kinley

HAND-HELD THERMOCOUPLE THERMOMETER SERVICE MANUAL. CATALOG NUMBERS , and , and PROPRIETARY

Automatic water level control using LabVIEW

Research on the Measurement Method of the Detection Range of Vehicle Reversing Assisting System

CAM-KIT6. User Manual. Connects2Vision. Mirror with DVR & Rear Camera PRODUCT FEATURES:

Locktronics PICmicro getting started guide

ACE803ND 3-Pin Microprocessor Reset Circuits

Freescale Semiconductor, I

Freeduino USB 1.0. Arduino Compatible Development Board Starter Guide. 1. Overview

THE WI-FI SEEKER GROUP 30 CHRISTINA LEICHTENSCHLAG ADRIAN MORGAN JIMMY WONG SPONSORS: LEIDOS DUKE ENERGY

Developement of Multi Interface Board for Educational Trainer Kit

RFID: Read and Display V2010. Version 1.1. Sept Cytron Technologies Sdn. Bhd.

Transcription:

Rear Distance Detection with Ultrasonic Sensors Project Report 11.29.2017 Group #6 Farnaz Behnia Kimia Zamiri Azar Osaze Shears ECE 511: Microprocessors Fall 2017

1 Table of Contents 1. Abstract 3 2. Motivation 3 3. Proposed Solution 3 4. Block Diagram 3 4.1 MSP430FR6989 Microcontroller Launchpad 4 4.2 Ultrasonic Sensors (HC-SR04) 4 4.3 LCD Display 5 4.4 RGB LED 6 4.5 Piezoelectric Speaker 7 4.6 Activation Button 8 5. Results 8 5.1 Implementation 8 5.2 Accuracy 9 5.3 Defects 9 6. Conclusions 10 7. Bibliography 10 8. Appendix 10 8.1 List of Team Member Tasks 10 8.2 Complete List of Parts 11 8.3 Full Schematic 11

2 List of Figures Figure 4.1: System Block Diagram. 3 Figure 4.2: Ultrasonic Sensor Timing Diagram. 5 Figure 4.3: LCD Segment Layout. 6 Figure 4.4: Common Anode RGB LED Circuit. 6 Figure 4.5: Piezo Speaker Interfacing with MSP430. 7 Figure 5.1: Implementation with MSP430 Included. 9 Figure 5.2: Implementation without MSP430. 9 Figure 8.1: System Schematic. 11

3 1. Abstract This project proposes a device for alerting the operator of a vehicle in reverse mode if an object is quickly approaching the rear of the vehicle while backing up. The device was developed with the capability to accurately determine the distance between the rear of the vehicle and an approaching object, and to inform the operator accordingly about the proximity of the object. Three proximity levels were derived for informing the user of the severity of the situation, altering the operator s perception as a result with various combinations of sounds and lights. The finalized design was optimized for low power consumption and tested to be fully operational with negligible defects. 2. Motivation The National Highway Traffic Safety Administration (NHTSA) reported close to 30,000 backing-related crashes in 2007 [1]. Of these crashes, 302 resulted in fatalities, and further, 35% of the victims were children. These crashes are caused by a variety of conditions that affect vehicle operators, including poor environmental lighting, congested parking lots and backing out of parking spaces. Recently there have been several innovations in parking sensor technology including the use of electromagnetic systems, visual camera feedback, ultrasonic sensors. While each approach has its own tradeoffs, this project aims to improve the quality of ultrasonic sensor detection systems due to their low cost and power consumption. 3. Proposed Solution The proposed solution to the problem presented is a rear distance detection system, implemented on an MSP430 microcontroller, that incorporates ultrasonic sensors to accurately determine the proximity between a vehicle and an object approaching its rear. The system performs the following operations: 1. Retrieves the distances between each of its three ultrasonic sensors. 2. Determines the shortest distance reported amongst the three sensors. 3. Reports the distance to the operator as well as a status message on a liquid crystal display (LCD) display. 4. Alerts the operator of the severity of the situation using a multi-colored light emitting diode (LED) and a piezoelectric speaker (a buzzer). The system further achieves low power by disabling the system clock at non-critical states and by recording ultrasonic sensor responses concurrently.

4 4. Block Diagram Featured below is a block diagram illustrating the primary components involved in this system. Figure 4.1: System Block Diagram. 4.1 MSP430FR6989 Microcontroller Launchpad As shown in the System Block Diagram (Figure 4.1) the MSP430 facilitated interactions between all of the components used in this project. The software algorithm developed for this project was programmed onto this device using the Code Composer Studio IDE. The power for this device is supplied by using a USB A to Micro USB cable which is connected to a power source. The launchpad was also responsible for providing supply voltages to each of the components connected to it. 4.2 Ultrasonic Sensors (HC-SR04) The ultrasonic sensors used in this project feature four terminals to interface with them. The VCC and Gnd pins are used to supply power to the sensor and are connected directly to the 5V and GND pins on the MSP430. The Trig pin is toggled high for approximately 10µs in order for the device to send an ultrasonic signal. This signal is again received by the sensor after it bounces off of an object and returns. The sensor keeps the Echo pin high until the signal returns (i.e., a pulse width modulated response). The amount of time that the echo pin is kept high indicates the distance of an object from the sensor. The timing for this process is noted in detail in Figure 4.2 below.

5 Figure 4.2: Ultrasonic Sensor Timing Diagram [2]. In this project, the Trig for each ultrasonic sensor was pin was interfaced with pin P1.4 on the MSP430. This pin was associated with timers A2 and A3 which controlled the amount of time for which it observed a logic-1 signal. The Echo pins for each of the three sensors were interfaced with pins P2.0, P2.1 and P2.2 on the MSP430 respectively. These pins were configured as inputs to timer B0 s capture and compare registers (CCRs) 4 through 6. The capture and compare registers were configured in capture mode and to trigger interrupts whenever there was a rising or falling edge on either of these pins. The interrupt service routine for timer B0 then utilized the timing information about the rising and falling edge of the echo signals (discerned using the CCR input bit (CCI) of each CCR) to effectively calculate the distance of an object from the device. 4.3 LCD Display Another component that is used to inform the driver about the distance of the object and back of the car is the LCD. If the distance between the object and back of the car is more than 70 centimeters, then the LCD will show OK beside the distance. When the distance is less than 70 centimeters and it is also greater than 40 centimeters then the LCD will show SLOW beside the current distance, to inform the driver that the object is getting close. At last, when the distance is less than 40 centimeters the LCD will show STOP beside the current distance, which advises the driver to stop in order to prevent a car accident. MSP430 offers several addresses for writing output to the LCD s segments. As shown in Figure 4.3, the MSP430FR6989 Launchpad has an on-board LCD that includes six full alpha-numeric character panels in addition to several symbols at the top for various modes or applications. Figure 4.3: LCD Segment Layout [4].

6 After configuring some registers (e.g., LCDCPCTL0, LCDCPCTL1, LCDCPCTL2, LCDCMEMCTL, ) and setting the clock, all LCDM registers were cleared and the write the bit values to the specified LCD addresses. 4.4 RGB LED In order to further inform the driver about the distance of the object and back of the car, the group used an RGB LED. If the distance between the object and back of the car is more than 70 centimeters, then the RGB LED shows constant green color, because it is a safe distance. When the distance is less than 70 centimeters and it is also more than 40 centimeters then the RGB LED starts blinking in a yellow color in order to inform the driver about the closing distance. For creating the yellow color, ground was applied to the red and green cathodes of the RGB LED simultaneously. At last, when the distance is less than 40 centimeters the RGB LED starts blinking in a red color, and the frequency of the blinking is greater than the blinking rate at the yellow color. In this project the group used a 5mm Triple Output LED RGB, that has 4 pins. Three of them are cathodes that correspond to the individual colors inside the LED, and the fourth pin, the common anode, acts as a VDD. As shown in Figure 4.4, a circuit was established for connecting the RGB LED to the MSP430. The forth pin, connected to the VDD of the MSP430 and each three other pins connected to the 1 KΩ resistor, and from there, to a specified pin of the MSP430. Figure 4.4: Common Anode RGB LED Circuit. For displaying a desired color on RGB LED, the group set pins P1.6 and pin P1.7 as outputs that correspond to the red and green color respectively. For example, for blinking red color BIT6 of P1 was toggled, which correspond to the red color (e.g., P1OUT ^= BIT6). Timer TA0 controlled the frequency of the blinking RGB LED within its interrupt service routine. As noted later, this timer also controlled the duration for which sound was being emitted from the piezo-speaker. For creating yellow color, the red and green colors were turned on simultaneously and then the P1OUT value at bits 6 and 7 were toggled in order to have a blinking yellow color (e.g., P1OUT ^= (BIT7 BIT6)). 4.5 Piezoelectric Speaker The group used a piezo speaker to produce beeping sounds in order to alarm the driver. The buzzer will not sound if the object is in a safe distance (more than 70 cm), will beep with a low frequency along with blinking yellow LED if the object is closer than 70 cm but further than 40 cm. Finally it will beep with a higher frequency if the object is closer than 40 cm. The group connected both the LED and the buzzer to the same timer in order to match the frequencies of beeping sound and blinking light. The piezo speaker has two pins. One of them acts as ground, the other one is for writing an alternating voltage signal to produce audio. The group connected this pin to timer TA1 (P3.3) on the msp430. The capture and compare register TA1CCR0 was used to modify the frequency. Another timer, TA0 was used to control when sound was

7 being emitted from the piezo-speaker, in addition to control when the LEDs were blinking or static. Figure 4.5 shows how the group interfaced buzzer with the MSP430. 4.6 Activation Button Figure 4.5: Piezo Speaker Interfacing with MSP430. The activation button in this system is used to acknowledge whether the system is in sleep mode (specifically low power mode 4) or active mode. The MSP430 s internal switch S1 was configured as an input on pin P1.1 with an internal pull up resistor, as well as with negative edge triggered interrupts enabled. When this button was pushed, the device would enter the Port 1 interrupt service routine and switch the state accordingly by modifying a state variable. Once it left this routine, the device would either continue operation or enter low power mode 4. 5. Results 5.1 Implementation Below are images of the final device developed and soldered to a PCB board. The connections with the MSP430 were established with removable wires in order to allow for easy modification or further improvements to the device. Figure 5.1: Implementation with MSP430 Included.

8 5.2 Accuracy Figure 5.2: Implementation without MSP430. It was observed that the device was able to detect object distances within approximately 5% accuracy of their actual location from the device. This detection accuracy was also influenced by both the speed at which the object was either approaching, or moving away from the device, as well as the size of the object. If an object was not directly in front of a sensor when it sent out its ultrasonic wave, then the distance detection would be skewed. 5.3 Defects The MSP430 s onboard LCD screen would at times seem to glitch out if no objects are within 1.5 to 2 meters of the device. This issue was found to be caused by the functioning of the ultrasonic sensors. Although the clear reason for this occurrence was not resolved, it appears that it could be caused by some degree of electromagnetic interference with the sensor. 6. Conclusions The group successfully achieved its goal of creating a fully operational ultrasonic sensor-based device for detecting the distance of objects approaching the rear side of a vehicle. The device was implemented and tested on both breadboard and PCB prototyping interfaces. From this project, the group learned several key concepts about the theory and application of microcontrollers. The MSP430 Launchpad proved to be a versatile device for implementing various projects, both simple and complex. The group further learned that the reliability of the ultrasonic sensors highly depends on the speed and size of the object within its proximity. From this project, the group hopes to do more work developing the accuracy and breadth of the ultrasonic sensors in order to provide more robust tracking capabilities.

9 7. Bibliography [1] Austin, R. (2008). Fatalities and Injuries in Motor Vehicle Backing Crashes: Report to Congress (No. DOT HS 811 144). Washington, DC: National Highway Traffic Safety Administration, US Department of Transportation. [2] ElecFreaks. Ultrasonic Ranging Module Datasheet. [3] Texas Instruments (2015). MSP430FR58xx, MSP430FR59xx, MSP430FR68xx, and MSP430FR69xx Family User's Guide (SLAU367F). [4] Texas Instruments (2015). MSP430FR6989 Programmer's Reference (SLAS789B).

10 8. Appendix 8.1 List of Team Member Tasks Team Member Tasks Farnaz Behnia Piezoelectric Speaker Interfacing Device Testing Kimia Zamiri Azar RGB LED Interfacing LCD Interfacing Device Testing Osaze Shears Ultrasonic Sensor Interfacing Activation Switch Interfacing Component Soldering 8.2 Complete List of Parts MSP430FR6989 Launchpad (1) Internal LCD (1) Internal Switch (1) HC-SR04 Ultrasonic Sensor (3) 5mm Triple Output RGB LEDs (1) Piezoelectric Sensor [Generic] (1) PCB Board [Generic] (1)

11 8.3 Full Schematic Figure 8.1: System Schematic.