0% found this document useful (0 votes)
3 views

Distance sensor part1(1)

The document outlines objectives for understanding and implementing SONAR sensors in robotics, including integration with Arduino and creating alert systems. It explains the working principle of SONAR, its applications, and provides a wiring guide along with programming challenges. Additionally, it includes tasks for creating a buzzer alert system and fading LEDs based on object proximity detected by the SONAR sensor.

Uploaded by

aabdelsalam
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Distance sensor part1(1)

The document outlines objectives for understanding and implementing SONAR sensors in robotics, including integration with Arduino and creating alert systems. It explains the working principle of SONAR, its applications, and provides a wiring guide along with programming challenges. Additionally, it includes tasks for creating a buzzer alert system and fading LEDs based on object proximity detected by the SONAR sensor.

Uploaded by

aabdelsalam
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Distance sensor

SONAR (Sound navigation and ranging)

2024 - 2025
Objectives

1. Understand the functionality and relevance of SONAR sensors in robotics.


2. Connect and integrate a SONAR sensor and buzzer with an Arduino board.
3. Create a buzzer alert system that responds to objects within a specified range.
4. Construct a radar-like display system using LEDs to indicate object proximity.
SONAR- Working principle

It detects the distance of the closest object in front of the


sensor (from 3 cm up to 400 cm). It works by sending out a
burst of ultrasound and listening for the echo when it bounces
off of an object

Info:
● Speed of sound= 340m/s
● distance= speed / time
● Divide distance by 2
Think & Answer

What tends LED to emit


light?
SONAR applications

Active sonar emits pulses of sound waves that


travel through the water, reflect off the target
and return to the ship. By knowing the speed
of sound in water and the time for the sound
wave to travel to the target and back, the
computers can quickly calculate distance
between the submarine and the target.
Any Guess??
SONAR applications

The Reverse Parking Sensors that are equipped in the car are basically
Ultrasonic Proximity Sensors i.e. they use Ultrasonic Sensors to measure the
distance
SONAR terminals

Trig
Arduino pin LED color

8 Red

9 Red
Arduino pin configuration

LEDs 10 Yellow

11 Yellow

12 Green

13 Green

5 Trig

4 Echo
SONAR
5V 5V

GND GND

3 Buzzer signal
Buzzer
Do you remember??
Top and bottom pins of
bread board are
connected _______
Buzzer

The piezo, also known as the buzzer, is a


component that is used for generating
sound. It is a digital component that can
be connected to digital outputs, and emits
a tone when the output is HIGH

Alternatively, it can be connected to an


analog pulse-width modulation output to
generate various tones and effects.
Schematic Diagram
Blocks to use
Operators in programming

Used to create conditional statements and produce Boolean results before


moving on

1. Less Than:
2. Greater Than:
3. Equal To:
4. And:
5. Or: Not:
Distance sensor block

Distance sensor block calculate distance in cm. To use this block you need to select trig and echo pins same
as you connected with arduino

Trig
Conditions in programming

Conditions are basic “if, else” logic statements that modify how code is executed. Conditions are a key part
of the decision-making process for computers.

Example
Add operators and distance block here to compare or
check condition

Blocks
Screenshot
● Press Shift + window+s keys together from
keyboard
● Save screenshot on desktop
● Turn-in

● Capture full screen along with


taskbar while taking screenshots of
your task otherwise there will be
zero scores for the task
1. Make your code in pictobox App and upload in robot to check.
2. Once you confirm your all tasks are working properly TURN IN for evaluation.

Challenge:1 Wiring SONAR

Connect Distance sensor (SONAR) with arduino by using


jumper wires

Hints:
Follow Pin configuration sheet in slide 9. After completing wiring show to your instructor
for grades
Tu
rn
In
1. Make your code in pictobox App and upload in robot to check.
2. Once you confirm your all tasks are working properly TURN IN for evaluation.

!!
Challenge:2 Buzzer alert system
Whenever distance will get closer, buzzer will start Conditions
giving beep with Red LED.

Task Video

Operators

Hint:
1. Use Conditions
2. Operators Dist
3. Distance sensor
https://drive.google.com/file/d/1gaELeISsCax4g5j8MwCIglyx0teHP
GS2/view?resourcekey
sensor
block
Tu
1. Make your code in pictobox App and upload in robot to check.
rn
2. Once you confirm your all tasks are working properly TURN IN for evaluation.
In
! !
Challenge:3 Make fading LEDs with SONAR
Whenever distance will get closer to the SONAR
sensor, red LEDs will get brighter.

Hint:
1. Use Conditions
2. Operators
3. Distance sensor
block
4. PWM Block

You might also like