top of page
  • Writer's pictureQuan Sheng

Ultrasonic sensor with PIR sensor Project (RPi)

Another cool project that i have done was making use of the PIR sensor to trigger the ultrasonic sensor to get the distance that the object is away.



Ultrasonic sensor with PIR Sensor

Let's first understand the component of the Ultrasonic Sensor


Ultrasonic Sensor

A brief explanation what is a ultrasonic sensor

Ultrasonic sensors are designed to sense object proximity or range using ultrasound reflection, similar to radar, to calculate the time it takes to reflect ultrasound waves between the sensor and a solid object.


It consist of 4 different pins Ground (GND), Echo Pulse Output (ECHO), Trigger Pulse Input (TRIG), and 5V Supply (Vcc).


The sensor detects return waves and measures the time between the trigger and returned pulse, and then sends a 5V signal on the ECHO pin.


ECHO will be “low” (0V) until the sensor is triggered when it receives the echo pulse. Once a return pulse has been located ECHO is set “high” (5V) for the duration of that pulse. Pulse duration is the full time between the sensor outputting an ultrasonic pulse, and the return pulse being detected by the sensor receiver.



Next the Passive Infrared Sensor (PIR)

PIR Sensor

A brief explanation what is a PIR Sensor


It is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view. It is most often used for motion sensor.


The sensor in the PIR detects or reads infrared radiation emitted from the objects around.


PIR Sensor

In the PIR Sensor, there are 2 potentiometers to tune sensitivity (Sx) and delay time (Dx).


The most important pins are of course Power supply (Vcc 3 to 5 Volts – this can be up to 12V) and GND (Ground).

The OUTPUT pin is the switching pin.

 

Now after understanding the two device, i connected each device the Pi Cobbler.


My Connection Plan:

Ultrasonic Sensor

VCC to 5V

GND to GND

TRIG to GPIO18

ECHO to GPIO20


PIR Sensor

VDC Power to 5V

Ground to GND

Digital Output to GPIO4



Program coded such that when the PIR Sensor sense any motion, it will trigger the ultrasonic to sensor to sense the between two things.


Project accomplish

As you can see when i put my hand over the PIR Sensor, it sense a movement and runs the GPIO where the LED is connected to.


Stay Tune For More project coming up!!!!!!

3 views

Comentários


bottom of page