Вы находитесь на странице: 1из 34

Abstract

The project is based on Sonar technology using an Ultrasonic Sensor to


determine the presence of any object in a particular range. Ultrasonic Sensors
measure the distance to the target by measuring the time between the emission
and reception. Arduino is an open-source electronics platform based on easy-to-
use hardware and software. Using these open source Arduino hardware and
software components this project is done and it is more of a visual project than it
is a circuit implementation. Hardware components like Arduino UNO, HC-SR04
Ultrasonic Sensor and a Servo Motor are used to present the visual representation
in the Processing Application. This project could be helpful for object
avoidance/ detection applications. This project could easily be extended and
could be used in any systems may need it.

1
Contents
1. Introduction
2. Microcontrollers
2.1 Introduction
2.2 Microcontrollers vs. microprocessors
2.3 Types of microcontrollers
3. Arduino Electronics Platform
3.1 Introduction
3.2 Pin diagram
3.3 Pin configuration
3.4 Memory General Pin functions
3.5 Properties of Pins
4. Ultrasonic sensor
4.1 Introduction
4.2 HC-SR04 Ultrasonic Sensor
4.3Source Codes
5. Servo Motor SG-90
5.1 Selecting Servo Motor
5.2 Wire Configuration
5.3 Servo Motor Operation
6. Circuit Design
7. Advantages of the Arduino Radar Sensor
8. Disadvantages and Limitations
9. Conclusions
10. References

2
1. Introduction

Radar is a long-range object detection system that uses radio waves


to establish certain parameters of an object like its range, speed and position. Radar
technology is used in aircrafts, missiles, marine, weather predictions and
automobiles. Even though the title says Arduino Radar Project, technically the
project is based on Sonar technology using an Ultrasonic Sensor to determine the
presence of any object in a particular range.

Ultrasonic sensors measure distance by using ultrasonic waves. The sensor


head emits an ultrasonic wave and receives the wave reflected from the target.
Ultrasonic Sensors measure the distance to the target by measuring the time
between the emission and reception. An optical sensor has a transmitter and
receiver, whereas an ultrasonic sensor uses a single ultrasonic element for both
emission and reception. In a reflective model ultrasonic sensor, a single oscillator
emits and receives ultrasonic waves alternately. This enables miniaturisation of the
sensor head.

While radar and ultrasonic sensors can be used for some of the same
purposes, sound-based sensors are readily available—they can be had for just a
couple dollars in some cases—and in certain situations, they may detect objects
more effectively than radar. For instance, while radar, or even light-based sensors,
have a difficult time correctly processing clear plastic, ultrasonic sensors have no
problem with this. In fact, they’re unaffected by the color of the material they are
sensing. On the other hand, if an object is made out of a material that absorbs
sound or is shaped in such a way that it reflects the sound waves away from the
receiver, readings will be unreliable.
3
The Arduino Radar Project is more of a visual project than it is a circuit
implementation. Hardware components like Arduino UNO, HC-SR04 Ultrasonic
Sensor and a Servo Motor are used to present the visual representation in the
Processing Application. Based on the information received from the Ultrasonic
Sensor with the help of Arduino and the details are passed and processed where a
simple Graphics application is implemented to mimic a Radar Screen.

4
2. Microcontrollers

2.1 Introduction
A microcontroller is a compact integrated circuit designed to govern a specific
operation in an embedded system. A typical microcontroller includes a processor,
memory and input/output (I/O) peripherals on a single chip.

Sometimes referred to as an embedded controller or microcontroller unit (MCU),


microcontrollers are found in vehicles, robots, office machines, medical devices,
mobile radio transceivers, vending machines and home appliances among other
devices.

Microcontroller features

A microcontroller's processor will vary by application. Options range from the


simple 4-bit, 8-bit or 16-bit processors to more complex 32-bit or 64-bit processors.
In terms of memory, microcontrollers can use random access memory (RAM), flash
memory, EPROM or EEPROM. Generally, microcontrollers are designed to be
readily usable without additional computing components because they are
designed with sufficient on board memory as well as offering pins for general I/O
operations, so they can directly interface with sensors and other components.

Microcontroller architecture can be based on the Harvard architecture or von


Neumann architecture, both offering different methods of exchanging data
between the processor and memory. With a Harvard architecture, the data bus and

5
instruction are separate, allowing for simultaneous transfers. With a Von Neumann
architecture, one bus is used for both data and instructions.

Microcontroller processors can be based on complex instruction set computing


(CISC) or reduced instruction set computing (RISC). CISC generally has around 80
instructions while RISC has about 30, as well as more addressing modes, 12-24
compared to RISC's 3-5. While CISC can be easier to implement and has more
efficient memory use, it can have performance degradation due to the higher
number of clock cycles needed to execute instructions. RISC, which places more
emphasis on software, often provides better performance than CISC processors,
which place more emphasis on hardware, due to its simplified instruction set and,
therefore, increased design simplicity, but because of the emphasis it places on
software, software can be more complex. Which ISC is used varies depending on
application. When they first became available, microcontrollers solely used
assembly language. Today, the C programming language is a popular option.

Overview of microcontrollers

MCUs feature input and output pins to implement peripheral functions. Such
functions include analog-to-digital converters, liquid crystal display (LCD)
controllers, real-time clock (RTC), synchronous/asynchronous receiver transmitter
(USART), timers, universal asynchronous receiver transmitter (UART) and universal
serial bus (USB) connectivity. Sensors gathering data related to humidity and
temperature among others are also often attached to microcontrollers.

6
Microcontroller applications

Microcontrollers are used in multiple industries and applications, including in the


home and enterprise, building automation, manufacturing, robotics, automotive,
lighting, smart energy, industrial automation, communications and internet of
things (IoT) deployments.

The simplest microcontrollers facilitate the operation of electromechanical systems


found in everyday convenience items, such as ovens, refrigerators, toasters, mobile
devices, key fobs, video games, televisions and lawn-watering systems. They are
also common in office machines such as photocopiers, scanners, fax machines and
printers, as well as smart meters, ATMs and security systems.

More sophisticated microcontrollers perform critical functions in aircraft,


spacecraft, ocean-going vessels, vehicles, medical and life-support systems, and
robots. In medical scenarios, microcontrollers can regulate the operations of an
artificial heart, kidney or other organ. They can also be instrumental in the
functioning of prosthetic devices.

2.2 Microcontrollers vs. microprocessors

The distinction between microcontrollers and microprocessors has gotten less clear
as chip density and complexity has become relatively cheap to manufacture and
microcontrollers have thus integrated more "general computer" types of

7
functionality. On the whole, though, microcontrollers can be said to function
usefully on their own, with direct connection to sensors and actuators, where
microprocessors are designed to maximize compute power on the chip, with
internal bus connections (rather than direct I/O) to supporting hardware such as
RAM and serial ports. Simply put, coffee makers use microcontrollers; desktop
computers use microprocessors.

Microcontrollers are less expensive and use less power than microprocessors.
Microprocessors do not have built in RAM, read-only memory (ROM) or other
peripherals on the chip, but rather attach to these with their pins. A microprocessor
can be considered the heart of a computer system, whereas a microcontroller can
be considered the heart of an embedded system.

2.3 Types of microcontrollers

Common MCUs include the Intel MCS-51, often referred to as an 8051


microcontroller, which was first developed in 1985; the AVR microcontroller
developed by Atmel in 1996; the programmable interface controller (PIC) from
Microchip Technology; and various licensed ARM microcontrollers.

A number of companies manufacture and sell microcontrollers, including NXP


Semiconductor, Renesas Electronics, Silicon Labs and Texas Instruments.

8
Different type of microcontrollers

1.MSP430 Launchpad

MSP430 Launchpad LaunchPad is a low-cost, low-power-consumption


microcontroller from Texas Instruments, the manufacturer of BeagleBone. The
Value Line LaunchPad is available for Rs.1500 in a kit that comes with a second chip.
The MSP430 chip also offers a power-saving mode that awakens almost instantly,
which may be perfect for remote sensors. At a fraction of the price of Arduino,
LaunchPad looks like a good alternative, at least for relatively simple projects.
However, it packs 512 bytes of RAM compared with Arduino Uno's 2 kB, so Arduino
might still win out for more complicated work.

2.Nanode

Nanode is designed to work like an Arduino, but is made specifically for Internet-
connected projects. It features the same ATmega328 processor that the Arduino
Uno uses, and you can program it with the Arduino IDE. Nanode uses the open-data
API Cosm to connect to the Web for tasks including sending data to the cloud,

9
following online feeds, or acting as the server for a small, simple website. It makes
a good development tool for Web-connected sensors, monitors, or controls. The
Nanode RF sells for Rs.5000, a higher price than Arduino. And some assembly is
required, so get your soldering iron ready.

3.Pinguino PIC32
This is a solid prototyping tool originally designed for art students. The Pinguino
is the same size and shape as the Arduino Uno, and like Arduino, Pinguino has
open-source hardware to run an open-source IDE. Despite the similarities,
though, Arduino and the Arduino forums do not provide support for Pinguino,
and the company advises buyers that Pinguino may not work with Arduino
libraries or sketches. Pinguino sells for Rs.2500, but the company recommends
that buyers ensure they are experienced and comfortable with the technology
first—Pinguino is not a microcontroller for beginners.

10
4.5STM32 Discovery
STM32 Discovery from STMicroelectronics is another low-cost alternative; it
sells for about Rs.1000. This one packs a bit more power than the other budget
microcontroller on our list, however; Discovery features a 32-bit ARM Cortex
M3 core running at 24 MHz with 8 kB of RAM. Be prepared for a smaller user
community and less documentation to help you along, however.

11
5.Teensy 2.0

Teensy 2.0 and its counterpart, Teensy++ 2.0, run Arduino software and can
support Arduino libraries and sketches, making them a good fit for experienced
users who are making a transition from Arduino. Speaking of fit, the Teensy
microcontrollers live up to their names; Teensy 2.0 is roughly the size of a
quarter, with 25 I/O pins, and Teensy++ 2.0 is only slightly larger.

12
3. Arduino Electronics Platform

3.1 introduction

Arduino is an open-source electronics platform based on easy-to-use hardware and


software. Arduino boards are able to read inputs - light on a sensor, a finger on a
button, or a Twitter message - and turn it into an output - activating a motor,
turning on an LED, publishing something online. We can tell your board what to do
by sending a set of instructions to the microcontroller on the board. To do so we
use the Arduino programming language (based on Wiring), and the Arduino
Software (IDE), based on Processing.

Over the years Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. A worldwide community of makers -
students, hobbyists, artists, programmers, and professionals - has gathered around
this open-source platform, their contributions have added up to an incredible
amount of accessible knowledge that can be of great help to novices and experts
alike.

Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and
programming. As soon as it reached a wider community, the Arduino board started
changing to adapt to new needs and challenges, differentiating its offer from simple
8-bit boards to products for IoT applications, wearable, 3D printing, and embedded

13
environments. All Arduino boards are completely open-source, empowering users
to build them independently and eventually adapt them to their particular needs.
The software, too, is open-source, and it is growing through the contributions of
users worldwide.

Thanks to its simple and accessible user experience, Arduino has been used in
thousands of different projects and applications. The Arduino software is easy-
touse for beginners, yet flexible enough for advanced users. It runs on Mac,
Windows, and Linux. Teachers and students use it to build low cost scientific
instruments, to prove chemistry and physics principles, or to get started with
programming and robotics. Designers and architects build interactive prototypes,
musicians and artists use it for installations and to experiment with new musical
instruments. Makers, of course, use it to build many of the projects exhibited at the
Maker Faire, for example. Arduino is a key tool to learn new things. Anyone -
children, hobbyists, artists, programmers - can start tinkering just following the

14
step by step instructions of a kit, or sharing ideas online with other members of the
Arduino community. There are many other microcontrollers and microcontroller
platforms available for physical computing. Parallax Basic Stamp, Net media’s BX-
24, Phidgets, MIT's Handyboard, and many others offer similar functionality. All of
these tools take the messy details of microcontroller programming nd wrap it up in
an easy-touse package. Arduino also simplifies the process of working with
microcontrollers, but it offers some advantage for teachers, students, and
interested amateurs over other systems:

• Inexpensive - Arduino boards are relatively inexpensive compared to other


microcontroller platforms. The least expensive version of the Arduino module can
be assembled by hand, and even the pre-assembled Arduino modules cost less than
Rs 1000/-

• Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh


OSX,and Linux operating systems. Most microcontroller systems are limited to
Windows.

• Simple, clear programming environment - The Arduino Software (IDE) is easy-


touse for beginners, yet flexible enough for advanced users to take advantage of as
well. For teachers, it's conveniently based on the Processing programming
environment, so students learning to program in that environment will be familiar
with how the Arduino IDE works.

• Open source and extensible software - The Arduino software is published as open
source tools, available for extension by experienced programmers. The language
can be expanded through C++ libraries, and people wanting to understand the
technical details can make the leap from Arduino to the AVR C programming
15
language on which it's based. Similarly, you can add AVR-C code directly into your
Arduino programs if you want to.

Open source and extensible hardware - The plans of the Arduino boards are
published under a Creative Commons license, so experienced circuit designers can
make their own version of the module, extending it and improving it. Even relatively
inexperienced users can build the breadboard version of the module in order to
understand how it works and save money.

3.2 Pin diagram

16
3.3 Pin configuration

Pin Category Pin Name Details


Vin: Input voltage to Arduino when using an external
power source.

5V: Regulated power supply used to power


Power Vin, 3.3V, 5V, GND
microcontroller and other components on the board.
3.3V: 3.3V supply generated by on-board voltage
regulator. Maximum current draw is 50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.

Analog Pins A0 – A5 Used to provide analog input in the range of 0-5V

Input/output Pins Digital Pins 0 - 13 Can be used as input or output pins.

Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.

External Interrupts 2, 3 To trigger an interrupt.

PWM 3, 5, 6, 9, 11 Provides 16-bit PWM output.

10 (SS), 11 (MOSI), 12
SPI Used for SPI communication.
(MISO) and 13 (SCK)

Inbuilt LED 13 To turn on the inbuilt LED.

TWI A4 (SDA), A5 (SCA) Used for TWI communication.

AREF AREF To provide reference voltage for input voltage.

17
3.4 Memory General Pin functions

 LED: There is a built-in LED driven by digital pin 13. When the pin is HIGH value,
the LED is on, when the pin is LOW, it's off.
 VIN: The input voltage to the Arduino/Genuino board when it's using an external
power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage
via the power jack, access it through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 20V), the USB
connector (5V), or the VIN pin of the board (7-20V). Supplying voltage via the 5V
or 3.3V pins bypasses the regulator, and can damage the board.
 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
 GND: Ground pins.
 IOREF: This pin on the Arduino/Genuino board provides the voltage reference
with which the microcontroller operates. A properly configured shield can read
the IOREF pin voltage and select the appropriate power source or enable voltage
translators on the outputs to work with the 5V or 3.3V.
 Reset: Typically used to add a reset button to shields which block the one on the
board.

18
3.5 Properties of pins
Input Pins
Arduino (Atmega) pins default to inputs, so they don't need to be explicitly
declared as inputs with pin Mode () when you're using them as inputs. Pins
configured this way are said to be in a high-impedance state. Input pins
make extremely small demands on the circuit that they are sampling,
equivalent to a series resistor of 100 megohm in front of the pin. This means
that it takes very little current to move the input pin from one state to
another and can make the pins useful for such tasks as implementing a
capacitive touch sensor, reading an LED as a photodiode, or reading an
analog sensor with a scheme such as RCTime. This also means however, that
pins configured as pinMode (pin, INPUT) with nothing connected to them,
or with wires connected to them that are not connected to other circuits,
will report seemingly random changes in pin state, picking up electrical
noise from the environment, or capacitive coupling the state of a nearby
pin.

There is a mapping between Arduino pins and ATmega328P port. Each of


the 14 digital pins on the Uno can be used as an input or output, using pin
Mode, digital Write, and digital Read functions. They operate at 5 volts. Each
pin can provide or receive 20 mA as recommended operating condition and
has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A
maximum of 40mA is the value that must not be exceeded on any I/O pin to
avoid permanent damage to the microcontroller.
In addition, some pins have specialized functions:
19
• Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2
USB-to-TTL Serial chip.
• External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.
• PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog
Write function.
• SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
• LED: 13. There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
• TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide
10 bits of resolution (i.e. 1024 different values). By default they measure
from ground to 5 volts, though is it possible to change the upper end of their
range using the AREF pin and the analog Reference function. There are a
couple of other pins on the board.
• AREF. Reference voltage for the analog inputs. Used with analog
Reference.
• Reset. Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.

20
4. Ultrasonic Sensor

4.1 Introduction

Ultrasonic sound vibrates at a frequency above the range of human hearing.


Ultrasonic sensors use a single transducer to send a pulse and to receive the echo.
The sensor determines the distance to a target by measuring time lapses between
the sending and receiving of the ultrasonic pulse. Ultrasonic Sensors measure the
distance to the target by measuring the time between the emission and reception.
An optical sensor has a transmitter and receiver, whereas an ultrasonic sensor uses
a single ultrasonic element for both emission and reception. In a reflective model
ultrasonic sensor, a single oscillator emits and receives ultrasonic waves
alternately. This enables miniaturization of the sensor head. The distance can be
calculated with the following formula: Distance L = (1/2 × T × C) where L is the
distance, T is the time between the emission and reception, and C is the sonic
speed. Ultrasonic sensing is one of the best ways to sense proximity and detect
levels with high reliability.

4.2 HC-SR04 Ultrasonic Sensor

HC-SR04 Ultrasonic Sensor emits an ultrasound at 40 000 Hz which travels


through the air and if there is an object or obstacle on its path It will bounce back
to the module. Considering the travel time and the speed of the sound you can
calculate the distance.

21
The HC-SR04 Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and
the VCC pins of the module needs to be connected to the Ground and the 5 volts
pins on the Arduino Board respectively and the trig and echo pins to any Digital I/O
pin on the Arduino Board.

In order to generate the ultrasound you need to set the Trig on a High State for
10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound
and it will be received in the Echo pin. The Echo pin will output the time in
microseconds the sound wave travelled.

Picture

4.3 Source Codes

First the Trig and Echo pins are defined. In this case they are the pins number 9 and
10 on the Arduino Board and they are named trigPin and echoPin. Then a Long
variable, named “duration” for the travel time that will be got from the sensor and
an integer variable for the distance.

In the setup we have to define the trigPin as an output and the echoPin as an Input
and also start the serial communication for showing the results on the serial
monitor.

In the loop first we have to make sure that the trigPin is clear so you have to set
that pin on a LOW State for just 2 µs. Now for generating the Ultra sound wave we
have to set the trigPin on HIGH State for 10 µs. Using the pulseIn() function you

22
have to read the travel time and put that value into the variable “duration”. This
function has 2 parameters, the first one is the name of the echo pin and for the
second one you can write either HIGH or LOW. In this case, HIGH means that the
pulsIn() function will wait for the pin to go HIGH caused by the bounced sound wave
and it will start timing, then it will wait for the pin to go LOW when the sound wave
will end which will stop the timing. At the end the function will return the length of
the pulse in microseconds. For getting the distance we will multiply the duration by
0.034 and divide it by 2 as we explained this equation previously. At the end we
will print the value of the distance on the Serial Monitor.

1. /*
2. * Ultrasonic Sensor HC-SR04 and Arduino Tutorial
3. *
4. * by Dejan Nedelkovski,
5. * www.HowToMechatronics.com
6. *
7. */
8.
9. // defines pins numbers
10. const int trigPin = 9;
11. const int echoPin = 10;
12.
13. // defines variables
14. long duration;
15. int distance;
16.
17. void setup() {
18. pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
19. pinMode(echoPin, INPUT); // Sets the echoPin as an Input
20. Serial.begin(9600); // Starts the serial communication
21. }
22.
23. void loop() {
24. // Clears the trigPin
25. digitalWrite(trigPin, LOW);
26. delayMicroseconds(2);
27.
28. // Sets the trigPin on HIGH state for 10 micro seconds
29. digitalWrite(trigPin, HIGH);
30. delayMicroseconds(10);
31. digitalWrite(trigPin, LOW);
32.
33. // Reads the echoPin, returns the sound wave travel time in microseconds

23
34. duration = pulseIn(echoPin, HIGH);
35.
36. // Calculating the distance
37. distance= duration*0.034/2;
38.
39. // Prints the distance on the Serial Monitor
40. Serial.print("Distance: ");
41. Serial.println(distance);

To display the results from the HC-SR04 Ultrasonic Sensor on an LCD we can use
the following source code:

/*

1. * Ultrasonic Sensor HC-SR04 and Arduino Tutorial


2. *
3. * by Dejan Nedelkovski,
4. * www.HowToMechatronics.com
5. *
6. */
7.
8. #include <LiquidCrystal.h> // includes the LiquidCrystal Library
9.
10. LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
11.
12. const int trigPin = 9;
13. const int echoPin = 10;
14.
15. long duration;
16. int distanceCm, distanceInch;
17.
18. void setup() {
19. lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of
the display
20.
21. pinMode(trigPin, OUTPUT);
22. pinMode(echoPin, INPUT);
23. }
24.
25. void loop() {
26. digitalWrite(trigPin, LOW);
27. delayMicroseconds(2);
28.
29. digitalWrite(trigPin, HIGH);
30. delayMicroseconds(10);
31. digitalWrite(trigPin, LOW);
32.
33. duration = pulseIn(echoPin, HIGH);
34. distanceCm= duration*0.034/2;

24
35. distanceInch = duration*0.0133/2;
36.
37. lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed
38. lcd.print("Distance: "); // Prints string "Distance" on the LCD
39. lcd.print(distanceCm); // Prints the distance value from the sensor
40. lcd.print(" cm");
41. delay(10);
42. lcd.setCursor(0,1);
43. lcd.print("Distance: ");
44. lcd.print(distanceInch);
45. lcd.print(" inch");
46. delay(10);
47. }

25
5. Servo Motor SG-90
5.1 Selecting Servo Motor

There are lots of servo motors available in the market and each one has its
own speciality and applications. Most of the hobby Servo motors operates from
4.8V to 6.5V, the higher the voltage higher the torque we can achieve, but most
commonly they are operated at +5V. Almost all hobby servo motors can rotate
only from 0° to 180° due to their gear arrangement so make sure you project can
live with the half circle if no, you can prefer for a 0° to 360° motor or modify the
motor to make a full circle. The gears in the motors are easily subjected to wear
and tear, so if your application requires stronger and long running motors you can
go with metal gears or just stick with normal plastic gear. The torque at which the
motor operates is another important parameter. Based on the load which you use
in the project you can select the motor with proper torque.

The features of the TowerPro SG-90 motor are as follows:

Operating Voltage is +5V typically

Torque: 2.5kg/cm

Operating speed is 0.1s/60°

Gear Type: Plastic

Rotation : 0°-180°

Weight of motor : 9gm

26
5.2 Wire Configuration

Wire Wire
Number Colour
Description

1 Brown Ground wire connected to the ground of system

2 Red Powers the motor typically +5V is used

3 Orange PWM signal is given in through this wire to drive the motor

5.3 Servo Motor Operation

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 colour wire. Hence we need
something that could generate PWM signals to make this motor work. This has
been done with Arduino Platform

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°.

27
28
6. Circuit Design

The design of the circuit for this project is very simple. The control pin of the
servo is connected to Pin 11 of the Arduino while the TRIG and ECHO Pins of the
Ultrasonic Sensor are connected to Pins 9 & 10 of Arduino respectively. A separate
5V power supply (with common GND) is given to the Servo Motor and the
Ultrasonic Sensor.

Code

There are two codes for this project: one for the Arduino UNO and the other for
the Processing.

Arduino Code The code for Arduino UNO is given below.

Processing Code The code for Processing Application is given below

Working
Initially, upload the code to Arduino after making the connections.
You can observe the servo sweeping from 00 to 1800 and again back to 00.

29
Since the Ultrasonic Sensor is mounted over the Servo, it will also
participate in the sweeping action.
Now, open the processing application and paste the above given
sketch. In the Processing Sketch, make necessary changes in the COM Port
selection and replace it with the COM Port number to which your Arduino
is connected to.

If you note the Processing Sketch, I have used the output display size
as 1280×720 (assuming almost all computers now-a-days have a minimum
resolution of 1366×768) and made calculation with respect to this
resolution.

In the future, I will upload a new Processing sketch where you can
enter the desired resolution (like 1920×1080) and all the calculations will be
automatically adjusted to this resolution.

Now, run the sketch in the Processing and if everything goes well, a
new Processing window opens up like the one shown below.

A Graphical representation of the data from the Ultrasonic Sensor is


represented in a Radar type display. If the Ultrasonic Sensor detects any
object within its range, the same will be displayed graphically on the screen.

30
7.Advantages of the Arduino Radar Sensor

1. It is not affected by color or transparency. Basically, the Ultrasonic


Sensors transmit the sound off of the object, hence the color and
transparency have no effect on the radar reading.

2. Any dark environments have no effect on this Arduino radar sensor’s


detection procedure. So, it can also use at night.

3. Easy to design and low price. The ultrasonic sensors are available at the
market with very cheap price.

4. It has high frequency, high sensitivity, therefore, it can easily detect the
external or deep objects.

5. This radar sensor is not affected by dust, rain, snow, and many more.

6. It has a self-cleaning system to continue running and less downtime.

7. The Arduino Radar Sensor is easy to use. Also, it is completely safe during
the operation to nearby objects, human or equipment.

8. The Ultrasonic sensor can easily interface with any types of the
microcontroller.

31
8. Disadvantages and Limitations

1. The Arduino Radar Sensor conduct sound to continue the work. So, it is
not working in a vacuum as there is no air for the sound to travel through.

2. A very soft fabric can absorb more sound waves. Therefore, it is hard to
detect objects which are covered with soft fabric.

3. If temperature changes of 5 to 10 degree or more then it is the effect on


the sensing accuracy. Although this is true that there have many more
temperature compensated sensors available.

4. Another limitation is the detection range. This depends on which


Ultrasonic sensor have used to make the Arduino Radar Sensor.

5. While the radar using for inspection purpose, make sure it should be
water resistive. Otherwise highly chances of damage.

The Arduino Radar Sensor reveals the existence of a phenomenon of


objects. Today in modern science use it for a different purpose. This
technology can make the world better.

32
9. Conclusion

Ultrasonic waves, in this technical project, are used to determine


velocity, range, and position of an object. The distance and angles of
detected objects are read in order to convert these data into visual
information. The performance of our project is so good. It works smoothly
to detect objects within the designed range. The screen shows the
information clearly with enough delay for the user to read it. This project
could be helpful for object avoidance/ detection applications. This project
could easily be extended and could be used in any systems may need it.

33
10. References

1. https://howtomechatronics.com/projects/arduino-radar-project/

2. https://i.ytimg.com/vi/RSAj_ydbg48/maxresdefault.jpg

3.https://hackster.imgix.net/uploads/attachments/208605/radar.jpg?auto
=compress%2Cformat& w=900&h=675&fit=min

4.https://www.engineersgarage.com/sites/default/files/styles/normalimag
es/public/circuitdiagra m/UDM-and-arduino-Radar.jpg?itok=lqbDNALF

5.https://www.arrow.com/en/research-and-events/articles/ultrasonic-
sensors-how-they-work-and-how-to-use-them-with-arduino

6.https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-
sr04/

7.https://components101.com/servo-motor-basics-pinout-datasheet

8.https://www.maxbotix.com/articles/how-ultrasonic-sensors-work.htm

34

Вам также может понравиться