Skip to content
Snippets Groups Projects
Commit a29a8bd6 authored by Gauthier HEISS's avatar Gauthier HEISS
Browse files

Merge branch 'chevignard-main-patch-41985' into 'main'

HC-SR04 sensor

See merge request !2
parents da8cecfc c7ceb5d6
No related branches found
No related tags found
1 merge request!2HC-SR04 sensor
docs/source/understand/HC-SR04/Circuit.png

179 KiB

docs/source/understand/HC-SR04/HC-SR04.png

58.3 KiB

Distance Sensor
===============
You have received HC-SR04 ultrasonic distance sensors. This module, which measures distances using ultrasonic waves, consists of four pins:
.. image:: HC-SR04.png
:width: 500
:align: center
- VCC: sensor power supply (5V)
- Trig: trigger pin
- Echo: echo reception pin
- GND: ground
Input and Output Voltages
-------------------------
- Power supply voltage (VCC): 5V
- Output voltage (Echo): 5V
Operation
---------
1. **Triggering**: To initiate a measurement, a 10-microsecond signal must be sent to the Trig pin. This triggers the emission of a burst of 8 ultrasonic pulses at 40 kHz.
2. **Reception**: The sensor then waits to receive the echo of these pulses. When the echo is detected, the Echo pin goes high.
3. **Time Measurement**: The duration for which the Echo pin remains high corresponds to the time taken by the ultrasonic wave to travel to the obstacle and back.
Reminder: The speed of sound in air is approximately 343 m/s.
Connection to the Raspberry Pi
------------------------------
.. warning::
Since the sensor's output voltage is 5V, a voltage divider is required to lower this voltage to a level acceptable for the Raspberry Pi's GPIO pins (3.3V).
Creating the voltage divider:
.. figure:: Circuit.png
:width: 500
:align: center
*vertical resistor: 1K ohm, horizontal resistor: 2K ohm*
- Connect the sensor's VCC pin to a 5V pin on the Raspberry Pi.
- Connect the sensor's GND pin to a GND pin on the Raspberry Pi.
- Connect the sensor's Trig pin to a GPIO pin on the Raspberry Pi (e.g., GPIO 10).
- Connect the sensor's Echo pin to another GPIO pin on the Raspberry Pi (e.g., GPIO 9).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment