Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

How an ultrasonic distance sensor works

Let's see how the transmitter (TX) and receiver (RX) work together to measure distance. The basic operating principle of an ultrasonic sensor is illustrated in the following figure:

Figure 11.5 – Ultrasonic distance sensor operation

Here is what happens:

  1. First, the sensor sends out an ultrasonic pulse from the transmitter (TX).
  2. If there is an object in front of the sensor, this pulse is bounced off the object and returns to the sensor, and is detected by the receiver (RX).  
  3. By measuring the time between transmitting a pulse and receiving it back, we can calculate the distance between the sensor and the object.

With this high-level understanding of how the sensor works, next, we will go deeper and discuss how to use the TRIG and ECHO terminals on the HC-SR04 together in a process to estimate distance.

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461