SlideShare a Scribd company logo
1 of 26
EEE416
Microcontroller Based Ultrasonic
Radar
#1506037
Kallol Roy
#1506039
Md Tawsif Rahman Chowdhury
Microprocessor & Embedded Systems Laboratory
Tanvir Ahmed
#1506034
Md Sadman Sakib
#1506036
01 Introduction _ _ _ _ _ _ _ _ _ _ page 1
02
Components _ _ _ _ _ _ _ _ _ _ page 2
Simple brief to the used components
• ATMEGA 328P …………………………………… Page 2
• Sonar Sensor HC-SR04 ………………………. Page 5
• Servo Motor SG-90 ……………………………. Page 6
• 16 MHz Crystal Oscillator ……………….…. Page 8
• FTDI FT 232RL USB to Serial Adapter …. Page 8
03 The Project Overview _ _ _ _ _page 10
04 Schematic Circuit Diagram _ _ page 11
05 Project Setup _ _ _ _ _ _ _ _ _ page 12
06 Sample Output _ _ _ _ _ _ _ _ page 13
Table of Contents
07 Conclusion _ _ _ _ _ _ _ _ _ _ page 14
08 List of References_ _ _ _ _ _ _ page 15
09 Appendix _ _ _ _ _ _ _ _ _ _ _page 16
Page | 1
Introduction:
We come across situations where we need to keep a watch over prohibited areas to avoid
trespassing. Now keeping human labor for this purpose is costly and also not reliable for
keeping a watch over an area 24×7. So, for this purpose an ultrasonic radar project for
unauthorized human/animal or object detection system. The system can monitor an area of
limited range and alerts authorities.
For this purpose, we use a microcontroller circuit that is connected to an ultrasonic sensor
mounted on a servo motor for monitoring. We also interface an LCD screen (Laptop Monitor)
for monitoring the detection status. The radar keeps monitoring the environment checking
the ultrasonic sensor echo. As soon as an object is detected the data of detection is processed
and sent to authorities with an alert of where exactly the object was detected. Thus, ultrasonic
radar proves to be a very useful system for 24×7 monitoring of a particular area/region.
In this lab project, we tried to implement an ultrasonic radar. We did not use the conventional
easier methods, rather we used ATMEGA 328 microcontroller for programming and
instruction sets.
Page | 2
Components
● ATMEGA 328P
● Sonar Sensor (HC-SR04)
● Servo Motor (SG90)
● Breadboard
● FTDI FT 232RL USB to Serial Adapter
● 16 MHz Crystal Oscillator
● Capacitors (22pF)
● Resistance
● Push Button
● Jumper Wires
SIMPLE BRIEF TO THE USED COMPONENTS:
ATMEGA 328P
ATMEGA328P is high performance, low power controller from Microchip. ATMEGA328P is
an 8-bit microcontroller based on AVR RISC architecture. It is the most popular of all AVR
controllers as it is used in ARDUINO boards.
Page | 3
Where to Use ATMEGA328P
Although we have many controllers ATMEGA328P is most popular of all because of its
features and cost. ARDUINO boards are also developed on this controller because of its
features.
● With program memory of 32 Kbytes ATMEGA328P applications are many.
● With various POWER SAVING modes, it can work on MOBILE EMBEDDED
SYSTEMS.
● With Watchdog timer to reset under error it can be used on systems with minimal
human interference.
● With advanced RISC architecture, the controller executes programs quickly.
● Also, with in chip temperature sensor the controller can be used at extreme
temperatures.
These all features add together promoting ATMEGA328P further.
How to Use ATMEGA328P
ATMEGA328 is used similar to any other controller. All there to do is programming.
Controller simply executes the program provided by us at any instant. Without programming
controller simply stays put without doing anything.
As said, first we need to program the controller and that is done by writing the appropriate
program file in the ATMEGA328P FLASH memory. After dumping this program code, the
controller executes this code and provides appropriate response.
Entire process of using an ATMEGA328P goes like this:
⮚ List the functions to be executed by controller.
⮚ Write the functions in programming language in IDE programs.
⮚ ATMEGA328P programming can also be done in ARDUINO IDE.
⮚ After writing the program, compile it to eliminate errors.
⮚ Make the IDE generate HEX file for the written program after compiling.
⮚ This HEX file contains the machine code which should be written in controller flash
memory.
⮚ Choose the programming device (usually SPI programmer made for AVR controllers)
which establishes communication between PC and ATMEGA328. It can also be
programmed using ARDUINO UNO board.
⮚ Run the programmer software and choose the appropriate hex file.
⮚ Burn the HEX file of written program in ATMEGA328P flash memory using this
program.
⮚ Disconnect the programmer, connect the appropriate peripherals for the controller
and get the system started
How to Use ATMega328P using Arduino
Since ATmega328P is used in Arduino Uno and Arduino nano boards, an Arduino Uno board
can be directly replaced by a ATMega328P chip. For that first the Arduino bootloader needs
to be installed into the chip. This IC with bootloader can be placed on Arduino Uno board and
burn the program into it. Once Arduino program is burnt into the IC, it can be removed and
used in place of Arduino board, along with a Crystal oscillator and other components as
Page | 4
required for the project. Below is the pin mapping between Arduino Uno and ATmega328P
chip.
Applications
There are hundreds of applications for ATMEGA328P:
● Used in ARDUINO UNO, ARDUINO NANO and ARDUINO MICRO boards.
● Industrial control systems.
● SMPS and Power Regulation systems.
● Digital data processing.
● Analog signal measuring and manipulations.
● Embedded systems like coffee machine, vending machine.
● Motor control systems.
● Display units.
● Peripheral Interface system.
Sonar Sensor HC-SR04
The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats do. It
offers excellent non-contact range detection with high accuracy and stable readings in an
easy-to-use package. It comes complete with ultrasonic transmitter and receiver modules.
Page | 5
Features
Here’s a list of some of the HC-SR04 ultrasonic sensor features and specs:
● Power Supply :+5V DC
● Quiescent Current : <2mA
● Working Current: 15mA
● Effectual Angle: <15°
● Ranging Distance : 2cm – 400 cm/1″ – 13ft
● Resolution : 0.3 cm
● Measuring Angle: 30 degree
● Trigger Input Pulse width: 10uS
● Dimension: 45mm x 20mm x 15mm
How Does it Work
The ultrasonic sensor uses sonar to determine the distance to an object. Here’s what
happens:
1. The transmitter (trig pin) sends a signal: a high-frequency sound. 40Khz to be
precise. The signal duration is 10𝝁s.
2. When the signal finds an object, it is reflected and…
3. … the transmitter (echo pin) receives it.
Page | 6
The time between the transmission and reception of the signal allows us to calculate the
distance to an object. This is possible because we know the sound’s velocity in the air.
Pin-out
● VCC: +5VDC
● Trig : Trigger (INPUT)
● Echo: Echo (OUTPUT)
● GND: Gournd
Servo Motor SG-90
Features
● Operating Voltage is +5V typically
● Torque: 2.5kg/cm
● Operating speed is 0.1s/60°
● Gear Type: Plastic
● Rotation : 0°-180°
Page | 7
● Weight of motor : 9gm
How to use
After selecting the right Servo motor for the project, comes the question how to use it. As we
know there are three wires coming out of this motor. To make this motor rotate, we have to
power the motor with +5V using the Red and Brown wire and send PWM signals to the
Orange color wire. Hence, we need something that could generate PWM signals to make this
motor work, this something could be anything like a 555 Timer or other Microcontroller
platforms like Arduino, PIC, ARM or even a microprocessor like Raspberry Pie. Let us look
at this picture to understand the rotation clearly.
From the picture we can understand that the PWM signal produced should have a frequency
of 50Hz that is the PWM period should be 20ms. Out of which the On-Time can vary from
1ms to 2ms. So, when the on-time is 1ms the motor will be in 0° and when 1.5ms the motor
will be 90°, similarly when it is 2ms it will be 180°. So, by varying the on-time from 1ms to
2ms the motor can be controlled from 0° to 180°
Applications
● Used as actuators in many robots like Biped Robot, Hexapod, robotic
arm etc.
● Commonly used for steering system in RC toys
● Robots where position control is required without feedback
● Less weight hence used in multi DOF robots like humanoid robots
Page | 8
16 MHz Crystal Oscillator
Crystal oscillator, also called plug-ins passive crystal, is a passive component with
Piezoelectricity; When added voltage to a quartz crystal piece, its physical appearance will
change, providing stable and precise frequency as a result. A resonator could not vibrate itself
without clock signal in circuit system.
A crystal oscillator, particularly one using a quartz crystal, works by distorting the crystal with
an electric field, when voltage is applied to an electrode near or on the crystal. This property
is known as electrostriction or inverse piezoelectricity. When the field is removed, the quartz
- which oscillates in a precise frequency - generates an electric field as it returns to its previous
shape, and this can generate a voltage. The result is that a quartz crystal behaves like an RLC
circuit, but with a much higher Q.
Quartz crystals are manufactured for frequencies from a few tens of kilohertz to hundreds of
megahertz. More than two billion crystals are manufactured annually. Most are used for
consumer devices such as wristwatches, clocks, radios, computers, and cellphones. Quartz
crystals are also found inside test and measurement equipment, such as counters, signal
generators, and oscilloscopes.
FTDI FT 232RL USB to Serial Adapter
Page | 9
The USB to TTL serial adapter is based on the high quality and very popular FTDI FT232RL
chipset and is an excellent way to connect TTL serial devices to a PC through a USB port.
This USB to TTL serial adapter is ideal for many uses, including:
● Programming microprocessors such as ARM, AVR, etc
● Working with computing hardware such as routers and switches
● Serial communication with many devices such as GPS devices
● Serial terminals on devices like the Raspberry Pi
Unlike most USB to TTL serial adapters, this adapter supports both 5V AND 3.3V operation.
The adapter comes with a right-angle connector fitted allowing you to use it straight away. If
anyone needs to access any of the other inputs or outputs of the FT232RL, all the useful
signals are provided as through-hole solder pads - ideal for use with straight headers into a
breadboard, for example.
● DTR: Data Terminal Ready - an output used for flow control
● RX: Serial data Receive pin
● TX: Serial data Transmit pin
● VCC: Positive voltage output - this is controlled by the jumper. If the jumper is set to
5V, this will provide a 5V output. If the jumper is set to 3.3V, this will provide a 3.3V
output.
● CTS: Clear to Send - an input used for flow control
● GND: Ground or 0V
For most uses,
● RX on this board goes to the TX pin of the device
● TX on this board goes to the RX pin on the device
● GND on this board goes to GND on the device
So, these are the main components used in this project. We also used some regular
components like breadboard, connector wires, capacitors, push button etc.
Page | 10
The Project Overview
The following block diagram represents the whole working procedure of this project.
Page | 11
Schematic Circuit Diagram
How does it work
The microcontroller sends signal to the servo and rotates it by 1◦
The servo motor rotates the two sonars (Each sonar covers 180◦)
In case of echo, the ATMEGA measures the distance and the angular distance is
measured via the rotation of servo.
These data are sent to computer via a Serial Adapter.
Data are then processed to show output using Processing3 software.
Page | 12
Project Setup
Page | 13
Sample Output
Page | 14
Conclusion
Since it was a model project, the Radar’s range is limited to 40-80 cm. For better range and
results more powerful sonar sensors could be used. And in real applications microwave
sensors could be used.
Another drawback of our project is we didn’t consider temperature differences. So, in
different temperatures we will get slightly different results.
Also, our Radar can’t give any idea of objects shape but only the angle and distance. so, there’s
a good scope for improvement but that will require huge amount of image processing which
is out of our course syllabus.
Page | 15
List of References
1.http://wiki.sunfounder.cc/index.php?title=FT232RL_FTDI_Mod
ule
2. https://www.microchip.com/wwwproducts/en/ATmega328p
3. https://components101.com/ultrasonic-sensor-working-pinout-
datasheet
4.https://components101.com/servo-motor-basics-pinout-
datasheet
5. https://learn.sparkfun.com/tutorials/connecting-arduino-to-
processing/all
6. https://maker.pro/arduino/tutorial/how-to-make-arduino-and-
processing-ide-communicate
Page | 16
Appendix
This is the “Processing” code to show continuous radar output on screen.
import processing.serial.*;
import processing.opengl.*;
import toxi.geom.*;
import toxi.processing.*;
ToxiclibsSupport gfx;
Serial port;
String serialAngle;
String serialDistance1,serialDistance2;
String serialData;
float objectDistance1,objectDistance2;
int radarAngle, radarDistance1, radarDistance2;
int index1=0,index2=0;
//int sz=650,la=600,hl=310,nl=8,na=5,hcm=40;//sz=size,la=last arc distance,hl=highest line
distance,nl=number of line,na=number of arc,hcm= hightest cm
int sz=700,nl=8,na=5,hcm=40;
int la=sz-50;
int hl=la/2+10;
PFont f;
void setup()
{
size (700, 700);
gfx = new ToxiclibsSupport(this);
smooth();
Page | 17
println(Serial.list());
f = createFont("Arial",20,true);
String portName = Serial.list()[0];
//String portName = "COM7";
port = new Serial(this, portName, 9600);
//port = new Serial(this,"COM4", 9600);
port.bufferUntil('.');
fill(0,0,0);
rect(0, 0, sz, sz);
}
void draw()
{
//fill(10,255,10);
noStroke();
fill(0,4);
rect(0, 0, sz, sz);
fill(10,255,10);
//Radar Arcs and Lines
pushMatrix();
translate(sz/2,sz/2);
noFill();
Page | 18
strokeWeight(2);
stroke(10,255,10);
for(int i=1;i<=na;i=i+1)
{
arc(0,0,floor(i*la/na),floor(i*la/na),0,TWO_PI);
}
strokeWeight(4);
for(int i=0;i<nl;i=i+1)
{
int a,b;
a=floor(hl*cos(radians(i*180/nl)));
b=floor(hl*sin(radians(i*180/nl)));
line(-a,-b,a,b);
}
popMatrix();
//Ultrasonic Lines
pushMatrix();
strokeWeight(5);
stroke(10,255,10);
translate(sz/2,sz/2);
line(-hl*cos(radians(-radarAngle)),-hl*sin(radians(-radarAngle)),hl*cos(radians(-
radarAngle)),hl*sin(radians(-radarAngle)));
popMatrix();
//Object Detection Lines
pushMatrix();
Page | 19
translate(sz/2,sz/2);
strokeWeight(5);
stroke(255,10,10); // red color
objectDistance1 = radarDistance1*hl/hcm;
objectDistance2 = radarDistance2*hl/hcm;
if(radarDistance1<hcm)
{
line(objectDistance1*cos(radians(-radarAngle)),objectDistance1*sin(radians(-
radarAngle)),hl*cos(radians(-radarAngle)),hl*sin(radians(-radarAngle)));
}
if(radarDistance2<hcm)
{
line(-objectDistance2*cos(radians(-radarAngle)),-objectDistance2*sin(radians(-radarAngle)),-
hl*cos(radians(-radarAngle)),-hl*sin(radians(-radarAngle)));
}
fill(0,0,0);
noStroke();
rect(sz/2-190, sz/2-50, 190, 50);
rect(-sz/2, -sz/2, 190, 50);
textFont(f);
fill(255, 255, 255);
textAlign(RIGHT);
text("Distance : "+nf(min(radarDistance2,40),2)+" cm",sz/2,sz/2-30);
text("Angle : "+nf(radarAngle+180,3)+" degree",sz/2,sz/2-10);
textAlign(LEFT);
text("Distance : "+nf(min(radarDistance1,40),2)+" cm",-(sz/2),-(sz/2-40));
text("Angle : "+nf(radarAngle,3)+" degree",-(sz/2),-(sz/2-20));
Page | 20
popMatrix();
}
void serialEvent (Serial port)
{
serialData = port.readStringUntil('.');
serialData = serialData.substring(0,serialData.length()-1);
index1 = serialData.indexOf(",");
index2 = serialData.indexOf("*");
serialAngle= serialData.substring(0, index1);
serialDistance1= serialData.substring(index1+1, index2);
serialDistance2= serialData.substring(index2+1, serialData.length());
radarAngle = int(serialAngle);
radarDistance1 = int(serialDistance1);
radarDistance2 = int(serialDistance2);
}
The following is the Arduino Code uploaded to the ATMEGA 328P:
#include <Servo.h>
const int trigPin1 = 7;
const int echoPin1 = 8;
const int trigPin2 = 9;
const int echoPin2 = 10;
long duration;
Page | 21
int distinCM1,distinCM2;
Servo radarServo;
void setup()
{
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
Serial.begin(9600);
radarServo.attach(11);
}
void loop()
{
for(int i=0;i<180;i++)
{
radarServo.write(i);
delay(50);
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);
duration = pulseIn(echoPin1, HIGH);
distinCM1 = duration*0.034/2;
Page | 22
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);
duration = pulseIn(echoPin2, HIGH);
distinCM2 = duration*0.034/2;
Serial.print(i);
Serial.print(",");
Serial.print(distinCM1);
Serial.print("*");
Serial.print(distinCM2);
Serial.print(".");
}
for(int i=178;i>0;i--)
{
radarServo.write(i);
delay(50);
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);
duration = pulseIn(echoPin1, HIGH);
distinCM1 = duration*0.034/2;
Page | 23
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);
duration = pulseIn(echoPin2, HIGH);
distinCM2 = duration*0.034/2;
Serial.print(i);
Serial.print(",");
Serial.print(distinCM1);
Serial.print("*");
Serial.print(distinCM2);
Serial.print(".");
}
}

More Related Content

What's hot

FREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATOR
FREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATORFREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATOR
FREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATOR SwgwmsaBoro
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
7 segment led interfacing with 8051
7 segment led interfacing with 80517 segment led interfacing with 8051
7 segment led interfacing with 8051Sam Patel
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacingdeval patel
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
Difference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor ArchitectureDifference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor ArchitectureVarunGautam40
 
Serial Communication
Serial CommunicationSerial Communication
Serial CommunicationUshaRani289
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversionPraveen Kumar
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...NimeshSingh27
 
8051 data types and directives
8051 data types and directives8051 data types and directives
8051 data types and directivesSARITHA REDDY
 
Relay interfacing with 8051
Relay interfacing with 8051Relay interfacing with 8051
Relay interfacing with 8051Pratik Phadte
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051ssuser3a47cb
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
Arduino and its hw architecture
Arduino and its hw architectureArduino and its hw architecture
Arduino and its hw architectureZeeshan Rafiq
 
Microprocessor architecture-I
Microprocessor architecture-IMicroprocessor architecture-I
Microprocessor architecture-IDr.YNM
 

What's hot (20)

FREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATOR
FREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATORFREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATOR
FREQUENCY ENTRAINMENT IN A WIEN BRIDGE OSCILLATOR
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
7 segment led interfacing with 8051
7 segment led interfacing with 80517 segment led interfacing with 8051
7 segment led interfacing with 8051
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
Difference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor ArchitectureDifference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor Architecture
 
Op amps
Op ampsOp amps
Op amps
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 
Memory interfacing
Memory interfacingMemory interfacing
Memory interfacing
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
8051 data types and directives
8051 data types and directives8051 data types and directives
8051 data types and directives
 
Relay interfacing with 8051
Relay interfacing with 8051Relay interfacing with 8051
Relay interfacing with 8051
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Arduino and its hw architecture
Arduino and its hw architectureArduino and its hw architecture
Arduino and its hw architecture
 
Op amp
Op ampOp amp
Op amp
 
Bjt amplifiers
Bjt amplifiersBjt amplifiers
Bjt amplifiers
 
Microprocessor architecture-I
Microprocessor architecture-IMicroprocessor architecture-I
Microprocessor architecture-I
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 

Similar to Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems Laboratory EEE 416)

Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsPallavi Bharti
 
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...IRJET Journal
 
Short Range Radar System using Arduino Uno
Short Range Radar System using Arduino UnoShort Range Radar System using Arduino Uno
Short Range Radar System using Arduino UnoIRJET Journal
 
IRJET- Design & Implementation of Black Box in Automobiles System
IRJET-  	  Design & Implementation of Black Box in Automobiles SystemIRJET-  	  Design & Implementation of Black Box in Automobiles System
IRJET- Design & Implementation of Black Box in Automobiles SystemIRJET Journal
 
Smart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likharSmart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likharShivnaresh Likhar
 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial AutomationIRJET Journal
 
AUTOMATIC INTELLIGENCE BASED CAR
AUTOMATIC INTELLIGENCE BASED CARAUTOMATIC INTELLIGENCE BASED CAR
AUTOMATIC INTELLIGENCE BASED CARPrabal Singh
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARHarshit Jain
 
major project ppt 27-4-16
major project ppt 27-4-16major project ppt 27-4-16
major project ppt 27-4-16rafiya begum
 
Shiv smart door ppt
Shiv smart door pptShiv smart door ppt
Shiv smart door pptMahesh Patil
 
Tachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor controlTachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor controlSushil Mishra
 
Fire Fighting Robot
Fire Fighting RobotFire Fighting Robot
Fire Fighting RobotSaadullah74
 
IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...
IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...
IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...IRJET Journal
 
IRJET- Items’ Filling System Prototype with Sorting System According to the C...
IRJET- Items’ Filling System Prototype with Sorting System According to the C...IRJET- Items’ Filling System Prototype with Sorting System According to the C...
IRJET- Items’ Filling System Prototype with Sorting System According to the C...IRJET Journal
 
Designing and Controlling of Motor by Interfacing RS232 with Microcontroller
Designing and Controlling of Motor by Interfacing RS232 with MicrocontrollerDesigning and Controlling of Motor by Interfacing RS232 with Microcontroller
Designing and Controlling of Motor by Interfacing RS232 with MicrocontrollerIRJET Journal
 
Digital tachometer using pic18
Digital tachometer using pic18Digital tachometer using pic18
Digital tachometer using pic18Muhammad Usman
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGVKUNJBIHARISINGH5
 
AUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROLAUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROLshiv kapil
 

Similar to Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems Laboratory EEE 416) (20)

Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and robotics
 
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
 
JamesEndl
JamesEndlJamesEndl
JamesEndl
 
Rangefinder ppt
Rangefinder pptRangefinder ppt
Rangefinder ppt
 
Short Range Radar System using Arduino Uno
Short Range Radar System using Arduino UnoShort Range Radar System using Arduino Uno
Short Range Radar System using Arduino Uno
 
IRJET- Design & Implementation of Black Box in Automobiles System
IRJET-  	  Design & Implementation of Black Box in Automobiles SystemIRJET-  	  Design & Implementation of Black Box in Automobiles System
IRJET- Design & Implementation of Black Box in Automobiles System
 
Smart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likharSmart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likhar
 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial Automation
 
AUTOMATIC INTELLIGENCE BASED CAR
AUTOMATIC INTELLIGENCE BASED CARAUTOMATIC INTELLIGENCE BASED CAR
AUTOMATIC INTELLIGENCE BASED CAR
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CAR
 
major project ppt 27-4-16
major project ppt 27-4-16major project ppt 27-4-16
major project ppt 27-4-16
 
Shiv smart door ppt
Shiv smart door pptShiv smart door ppt
Shiv smart door ppt
 
Tachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor controlTachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor control
 
Fire Fighting Robot
Fire Fighting RobotFire Fighting Robot
Fire Fighting Robot
 
IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...
IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...
IRJET- Autonomous Adjustable Pesticide Spraying Device for Agricultural Appli...
 
IRJET- Items’ Filling System Prototype with Sorting System According to the C...
IRJET- Items’ Filling System Prototype with Sorting System According to the C...IRJET- Items’ Filling System Prototype with Sorting System According to the C...
IRJET- Items’ Filling System Prototype with Sorting System According to the C...
 
Designing and Controlling of Motor by Interfacing RS232 with Microcontroller
Designing and Controlling of Motor by Interfacing RS232 with MicrocontrollerDesigning and Controlling of Motor by Interfacing RS232 with Microcontroller
Designing and Controlling of Motor by Interfacing RS232 with Microcontroller
 
Digital tachometer using pic18
Digital tachometer using pic18Digital tachometer using pic18
Digital tachometer using pic18
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
 
AUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROLAUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROL
 

Recently uploaded

Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems Laboratory EEE 416)

  • 1. EEE416 Microcontroller Based Ultrasonic Radar #1506037 Kallol Roy #1506039 Md Tawsif Rahman Chowdhury Microprocessor & Embedded Systems Laboratory Tanvir Ahmed #1506034 Md Sadman Sakib #1506036
  • 2. 01 Introduction _ _ _ _ _ _ _ _ _ _ page 1 02 Components _ _ _ _ _ _ _ _ _ _ page 2 Simple brief to the used components • ATMEGA 328P …………………………………… Page 2 • Sonar Sensor HC-SR04 ………………………. Page 5 • Servo Motor SG-90 ……………………………. Page 6 • 16 MHz Crystal Oscillator ……………….…. Page 8 • FTDI FT 232RL USB to Serial Adapter …. Page 8 03 The Project Overview _ _ _ _ _page 10 04 Schematic Circuit Diagram _ _ page 11 05 Project Setup _ _ _ _ _ _ _ _ _ page 12 06 Sample Output _ _ _ _ _ _ _ _ page 13 Table of Contents
  • 3. 07 Conclusion _ _ _ _ _ _ _ _ _ _ page 14 08 List of References_ _ _ _ _ _ _ page 15 09 Appendix _ _ _ _ _ _ _ _ _ _ _page 16
  • 4. Page | 1 Introduction: We come across situations where we need to keep a watch over prohibited areas to avoid trespassing. Now keeping human labor for this purpose is costly and also not reliable for keeping a watch over an area 24×7. So, for this purpose an ultrasonic radar project for unauthorized human/animal or object detection system. The system can monitor an area of limited range and alerts authorities. For this purpose, we use a microcontroller circuit that is connected to an ultrasonic sensor mounted on a servo motor for monitoring. We also interface an LCD screen (Laptop Monitor) for monitoring the detection status. The radar keeps monitoring the environment checking the ultrasonic sensor echo. As soon as an object is detected the data of detection is processed and sent to authorities with an alert of where exactly the object was detected. Thus, ultrasonic radar proves to be a very useful system for 24×7 monitoring of a particular area/region. In this lab project, we tried to implement an ultrasonic radar. We did not use the conventional easier methods, rather we used ATMEGA 328 microcontroller for programming and instruction sets.
  • 5. Page | 2 Components ● ATMEGA 328P ● Sonar Sensor (HC-SR04) ● Servo Motor (SG90) ● Breadboard ● FTDI FT 232RL USB to Serial Adapter ● 16 MHz Crystal Oscillator ● Capacitors (22pF) ● Resistance ● Push Button ● Jumper Wires SIMPLE BRIEF TO THE USED COMPONENTS: ATMEGA 328P ATMEGA328P is high performance, low power controller from Microchip. ATMEGA328P is an 8-bit microcontroller based on AVR RISC architecture. It is the most popular of all AVR controllers as it is used in ARDUINO boards.
  • 6. Page | 3 Where to Use ATMEGA328P Although we have many controllers ATMEGA328P is most popular of all because of its features and cost. ARDUINO boards are also developed on this controller because of its features. ● With program memory of 32 Kbytes ATMEGA328P applications are many. ● With various POWER SAVING modes, it can work on MOBILE EMBEDDED SYSTEMS. ● With Watchdog timer to reset under error it can be used on systems with minimal human interference. ● With advanced RISC architecture, the controller executes programs quickly. ● Also, with in chip temperature sensor the controller can be used at extreme temperatures. These all features add together promoting ATMEGA328P further. How to Use ATMEGA328P ATMEGA328 is used similar to any other controller. All there to do is programming. Controller simply executes the program provided by us at any instant. Without programming controller simply stays put without doing anything. As said, first we need to program the controller and that is done by writing the appropriate program file in the ATMEGA328P FLASH memory. After dumping this program code, the controller executes this code and provides appropriate response. Entire process of using an ATMEGA328P goes like this: ⮚ List the functions to be executed by controller. ⮚ Write the functions in programming language in IDE programs. ⮚ ATMEGA328P programming can also be done in ARDUINO IDE. ⮚ After writing the program, compile it to eliminate errors. ⮚ Make the IDE generate HEX file for the written program after compiling. ⮚ This HEX file contains the machine code which should be written in controller flash memory. ⮚ Choose the programming device (usually SPI programmer made for AVR controllers) which establishes communication between PC and ATMEGA328. It can also be programmed using ARDUINO UNO board. ⮚ Run the programmer software and choose the appropriate hex file. ⮚ Burn the HEX file of written program in ATMEGA328P flash memory using this program. ⮚ Disconnect the programmer, connect the appropriate peripherals for the controller and get the system started How to Use ATMega328P using Arduino Since ATmega328P is used in Arduino Uno and Arduino nano boards, an Arduino Uno board can be directly replaced by a ATMega328P chip. For that first the Arduino bootloader needs to be installed into the chip. This IC with bootloader can be placed on Arduino Uno board and burn the program into it. Once Arduino program is burnt into the IC, it can be removed and used in place of Arduino board, along with a Crystal oscillator and other components as
  • 7. Page | 4 required for the project. Below is the pin mapping between Arduino Uno and ATmega328P chip. Applications There are hundreds of applications for ATMEGA328P: ● Used in ARDUINO UNO, ARDUINO NANO and ARDUINO MICRO boards. ● Industrial control systems. ● SMPS and Power Regulation systems. ● Digital data processing. ● Analog signal measuring and manipulations. ● Embedded systems like coffee machine, vending machine. ● Motor control systems. ● Display units. ● Peripheral Interface system. Sonar Sensor HC-SR04 The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats do. It offers excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package. It comes complete with ultrasonic transmitter and receiver modules.
  • 8. Page | 5 Features Here’s a list of some of the HC-SR04 ultrasonic sensor features and specs: ● Power Supply :+5V DC ● Quiescent Current : <2mA ● Working Current: 15mA ● Effectual Angle: <15° ● Ranging Distance : 2cm – 400 cm/1″ – 13ft ● Resolution : 0.3 cm ● Measuring Angle: 30 degree ● Trigger Input Pulse width: 10uS ● Dimension: 45mm x 20mm x 15mm How Does it Work The ultrasonic sensor uses sonar to determine the distance to an object. Here’s what happens: 1. The transmitter (trig pin) sends a signal: a high-frequency sound. 40Khz to be precise. The signal duration is 10𝝁s. 2. When the signal finds an object, it is reflected and… 3. … the transmitter (echo pin) receives it.
  • 9. Page | 6 The time between the transmission and reception of the signal allows us to calculate the distance to an object. This is possible because we know the sound’s velocity in the air. Pin-out ● VCC: +5VDC ● Trig : Trigger (INPUT) ● Echo: Echo (OUTPUT) ● GND: Gournd Servo Motor SG-90 Features ● Operating Voltage is +5V typically ● Torque: 2.5kg/cm ● Operating speed is 0.1s/60° ● Gear Type: Plastic ● Rotation : 0°-180°
  • 10. Page | 7 ● Weight of motor : 9gm How to use After selecting the right Servo motor for the project, comes the question how to use it. As we know there are three wires coming out of this motor. To make this motor rotate, we have to power the motor with +5V using the Red and Brown wire and send PWM signals to the Orange color wire. Hence, we need something that could generate PWM signals to make this motor work, this something could be anything like a 555 Timer or other Microcontroller platforms like Arduino, PIC, ARM or even a microprocessor like Raspberry Pie. Let us look at this picture to understand the rotation clearly. From the picture we can understand that the PWM signal produced should have a frequency of 50Hz that is the PWM period should be 20ms. Out of which the On-Time can vary from 1ms to 2ms. So, when the on-time is 1ms the motor will be in 0° and when 1.5ms the motor will be 90°, similarly when it is 2ms it will be 180°. So, by varying the on-time from 1ms to 2ms the motor can be controlled from 0° to 180° Applications ● Used as actuators in many robots like Biped Robot, Hexapod, robotic arm etc. ● Commonly used for steering system in RC toys ● Robots where position control is required without feedback ● Less weight hence used in multi DOF robots like humanoid robots
  • 11. Page | 8 16 MHz Crystal Oscillator Crystal oscillator, also called plug-ins passive crystal, is a passive component with Piezoelectricity; When added voltage to a quartz crystal piece, its physical appearance will change, providing stable and precise frequency as a result. A resonator could not vibrate itself without clock signal in circuit system. A crystal oscillator, particularly one using a quartz crystal, works by distorting the crystal with an electric field, when voltage is applied to an electrode near or on the crystal. This property is known as electrostriction or inverse piezoelectricity. When the field is removed, the quartz - which oscillates in a precise frequency - generates an electric field as it returns to its previous shape, and this can generate a voltage. The result is that a quartz crystal behaves like an RLC circuit, but with a much higher Q. Quartz crystals are manufactured for frequencies from a few tens of kilohertz to hundreds of megahertz. More than two billion crystals are manufactured annually. Most are used for consumer devices such as wristwatches, clocks, radios, computers, and cellphones. Quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes. FTDI FT 232RL USB to Serial Adapter
  • 12. Page | 9 The USB to TTL serial adapter is based on the high quality and very popular FTDI FT232RL chipset and is an excellent way to connect TTL serial devices to a PC through a USB port. This USB to TTL serial adapter is ideal for many uses, including: ● Programming microprocessors such as ARM, AVR, etc ● Working with computing hardware such as routers and switches ● Serial communication with many devices such as GPS devices ● Serial terminals on devices like the Raspberry Pi Unlike most USB to TTL serial adapters, this adapter supports both 5V AND 3.3V operation. The adapter comes with a right-angle connector fitted allowing you to use it straight away. If anyone needs to access any of the other inputs or outputs of the FT232RL, all the useful signals are provided as through-hole solder pads - ideal for use with straight headers into a breadboard, for example. ● DTR: Data Terminal Ready - an output used for flow control ● RX: Serial data Receive pin ● TX: Serial data Transmit pin ● VCC: Positive voltage output - this is controlled by the jumper. If the jumper is set to 5V, this will provide a 5V output. If the jumper is set to 3.3V, this will provide a 3.3V output. ● CTS: Clear to Send - an input used for flow control ● GND: Ground or 0V For most uses, ● RX on this board goes to the TX pin of the device ● TX on this board goes to the RX pin on the device ● GND on this board goes to GND on the device So, these are the main components used in this project. We also used some regular components like breadboard, connector wires, capacitors, push button etc.
  • 13. Page | 10 The Project Overview The following block diagram represents the whole working procedure of this project.
  • 14. Page | 11 Schematic Circuit Diagram How does it work The microcontroller sends signal to the servo and rotates it by 1◦ The servo motor rotates the two sonars (Each sonar covers 180◦) In case of echo, the ATMEGA measures the distance and the angular distance is measured via the rotation of servo. These data are sent to computer via a Serial Adapter. Data are then processed to show output using Processing3 software.
  • 17. Page | 14 Conclusion Since it was a model project, the Radar’s range is limited to 40-80 cm. For better range and results more powerful sonar sensors could be used. And in real applications microwave sensors could be used. Another drawback of our project is we didn’t consider temperature differences. So, in different temperatures we will get slightly different results. Also, our Radar can’t give any idea of objects shape but only the angle and distance. so, there’s a good scope for improvement but that will require huge amount of image processing which is out of our course syllabus.
  • 18. Page | 15 List of References 1.http://wiki.sunfounder.cc/index.php?title=FT232RL_FTDI_Mod ule 2. https://www.microchip.com/wwwproducts/en/ATmega328p 3. https://components101.com/ultrasonic-sensor-working-pinout- datasheet 4.https://components101.com/servo-motor-basics-pinout- datasheet 5. https://learn.sparkfun.com/tutorials/connecting-arduino-to- processing/all 6. https://maker.pro/arduino/tutorial/how-to-make-arduino-and- processing-ide-communicate
  • 19. Page | 16 Appendix This is the “Processing” code to show continuous radar output on screen. import processing.serial.*; import processing.opengl.*; import toxi.geom.*; import toxi.processing.*; ToxiclibsSupport gfx; Serial port; String serialAngle; String serialDistance1,serialDistance2; String serialData; float objectDistance1,objectDistance2; int radarAngle, radarDistance1, radarDistance2; int index1=0,index2=0; //int sz=650,la=600,hl=310,nl=8,na=5,hcm=40;//sz=size,la=last arc distance,hl=highest line distance,nl=number of line,na=number of arc,hcm= hightest cm int sz=700,nl=8,na=5,hcm=40; int la=sz-50; int hl=la/2+10; PFont f; void setup() { size (700, 700); gfx = new ToxiclibsSupport(this); smooth();
  • 20. Page | 17 println(Serial.list()); f = createFont("Arial",20,true); String portName = Serial.list()[0]; //String portName = "COM7"; port = new Serial(this, portName, 9600); //port = new Serial(this,"COM4", 9600); port.bufferUntil('.'); fill(0,0,0); rect(0, 0, sz, sz); } void draw() { //fill(10,255,10); noStroke(); fill(0,4); rect(0, 0, sz, sz); fill(10,255,10); //Radar Arcs and Lines pushMatrix(); translate(sz/2,sz/2); noFill();
  • 21. Page | 18 strokeWeight(2); stroke(10,255,10); for(int i=1;i<=na;i=i+1) { arc(0,0,floor(i*la/na),floor(i*la/na),0,TWO_PI); } strokeWeight(4); for(int i=0;i<nl;i=i+1) { int a,b; a=floor(hl*cos(radians(i*180/nl))); b=floor(hl*sin(radians(i*180/nl))); line(-a,-b,a,b); } popMatrix(); //Ultrasonic Lines pushMatrix(); strokeWeight(5); stroke(10,255,10); translate(sz/2,sz/2); line(-hl*cos(radians(-radarAngle)),-hl*sin(radians(-radarAngle)),hl*cos(radians(- radarAngle)),hl*sin(radians(-radarAngle))); popMatrix(); //Object Detection Lines pushMatrix();
  • 22. Page | 19 translate(sz/2,sz/2); strokeWeight(5); stroke(255,10,10); // red color objectDistance1 = radarDistance1*hl/hcm; objectDistance2 = radarDistance2*hl/hcm; if(radarDistance1<hcm) { line(objectDistance1*cos(radians(-radarAngle)),objectDistance1*sin(radians(- radarAngle)),hl*cos(radians(-radarAngle)),hl*sin(radians(-radarAngle))); } if(radarDistance2<hcm) { line(-objectDistance2*cos(radians(-radarAngle)),-objectDistance2*sin(radians(-radarAngle)),- hl*cos(radians(-radarAngle)),-hl*sin(radians(-radarAngle))); } fill(0,0,0); noStroke(); rect(sz/2-190, sz/2-50, 190, 50); rect(-sz/2, -sz/2, 190, 50); textFont(f); fill(255, 255, 255); textAlign(RIGHT); text("Distance : "+nf(min(radarDistance2,40),2)+" cm",sz/2,sz/2-30); text("Angle : "+nf(radarAngle+180,3)+" degree",sz/2,sz/2-10); textAlign(LEFT); text("Distance : "+nf(min(radarDistance1,40),2)+" cm",-(sz/2),-(sz/2-40)); text("Angle : "+nf(radarAngle,3)+" degree",-(sz/2),-(sz/2-20));
  • 23. Page | 20 popMatrix(); } void serialEvent (Serial port) { serialData = port.readStringUntil('.'); serialData = serialData.substring(0,serialData.length()-1); index1 = serialData.indexOf(","); index2 = serialData.indexOf("*"); serialAngle= serialData.substring(0, index1); serialDistance1= serialData.substring(index1+1, index2); serialDistance2= serialData.substring(index2+1, serialData.length()); radarAngle = int(serialAngle); radarDistance1 = int(serialDistance1); radarDistance2 = int(serialDistance2); } The following is the Arduino Code uploaded to the ATMEGA 328P: #include <Servo.h> const int trigPin1 = 7; const int echoPin1 = 8; const int trigPin2 = 9; const int echoPin2 = 10; long duration;
  • 24. Page | 21 int distinCM1,distinCM2; Servo radarServo; void setup() { pinMode(trigPin1, OUTPUT); pinMode(echoPin1, INPUT); pinMode(trigPin2, OUTPUT); pinMode(echoPin2, INPUT); Serial.begin(9600); radarServo.attach(11); } void loop() { for(int i=0;i<180;i++) { radarServo.write(i); delay(50); digitalWrite(trigPin1, LOW); delayMicroseconds(2); digitalWrite(trigPin1, HIGH); delayMicroseconds(10); digitalWrite(trigPin1, LOW); duration = pulseIn(echoPin1, HIGH); distinCM1 = duration*0.034/2;
  • 25. Page | 22 digitalWrite(trigPin2, LOW); delayMicroseconds(2); digitalWrite(trigPin2, HIGH); delayMicroseconds(10); digitalWrite(trigPin2, LOW); duration = pulseIn(echoPin2, HIGH); distinCM2 = duration*0.034/2; Serial.print(i); Serial.print(","); Serial.print(distinCM1); Serial.print("*"); Serial.print(distinCM2); Serial.print("."); } for(int i=178;i>0;i--) { radarServo.write(i); delay(50); digitalWrite(trigPin1, LOW); delayMicroseconds(2); digitalWrite(trigPin1, HIGH); delayMicroseconds(10); digitalWrite(trigPin1, LOW); duration = pulseIn(echoPin1, HIGH); distinCM1 = duration*0.034/2;
  • 26. Page | 23 digitalWrite(trigPin2, LOW); delayMicroseconds(2); digitalWrite(trigPin2, HIGH); delayMicroseconds(10); digitalWrite(trigPin2, LOW); duration = pulseIn(echoPin2, HIGH); distinCM2 = duration*0.034/2; Serial.print(i); Serial.print(","); Serial.print(distinCM1); Serial.print("*"); Serial.print(distinCM2); Serial.print("."); } }