You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/IRObstacleAvoidance.adoc
+35-22Lines changed: 35 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,31 +13,32 @@ endif::rootpath[]
13
13
https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/irObstacleAvoidanceSensor.adoc[Improve this doc]
14
14
15
15
===== Overview
16
-
This section provides the details of the IR Obstacle Avoidance Sensor, including its components, assembly instructions, and functionality.
16
+
This section provides details for the IR Obstacle Avoidance Sensor, including its components, assembly instructions, and functionality.
17
17
18
18
The IR (Infrared) Obstacle Avoidance Module is a proximity sensor that detects objects and obstacles within a short distance (2-30cm) using infrared reflection. It is commonly used in robotics for collision avoidance, object detection, and boundary sensing. The module features adjustable sensitivity via a potentiometer, digital output for easy integration, fast response time, low power consumption, and operates on 3.3V to 5V power supplies.
19
19
20
20
===== Components
21
-
* 1 x Raspberry Pi (Pi 3, 4, or Zero recommended)
21
+
* 1 x Raspberry Pi 4
22
22
* 1 x IR Obstacle Avoidance Module
23
-
* 3 x Jumper Wires (Female-to-Male or appropriate connectors)
24
-
* 1 x Breadboard (optional, for prototyping)
23
+
* 5 x Male-to-Male Jumper Wires
24
+
* 1 x Breadboard
25
25
* Power supply for Raspberry Pi
26
26
27
27
===== Assembly Instructions
28
-
* Place the IR Obstacle Avoidance Module onto the breadboard or connect directly to the Raspberry Pi.
29
-
* Connect the **VCC** pin of the IR module to **5V** on the Raspberry Pi (Physical Pin 2 or 4).
30
-
* Connect the **GND** pin of the IR module to **Ground** on the Raspberry Pi (Physical Pin 6, 9, 14, 20, 25, 30, 34, or 39).
31
-
* Connect the **OUT** (or **DO**) pin of the IR module to **GPIO 17** on the Raspberry Pi (Physical Pin 11).
28
+
* Place the IR Obstacle Avoidance Module onto the breadboard.
29
+
* Connect the **VCC** pin of the IR module to **3.3V** on the Raspberry Pi.
30
+
* Connect the **GND** pin of the IR module to **Ground** on the Raspberry Pi.
31
+
* Connect the **OUT** (or **DO**) pin of the IR module to **GPIO 17** on the Raspberry Pi.
32
+
* Use the remaining two jumper wires to secure the module to the breadboard, following the provided circuit diagram.
32
33
* Verify connections to ensure no loose wires or short circuits.
33
-
* Adjust the potentiometer (small blue or orange screw) to set detection sensitivity:
34
-
- Turn **clockwise** to increase sensitivity (detect closer objects).
35
-
- Turn **counter-clockwise** to decrease sensitivity (detect farther objects).
34
+
* Adjust the potentiometer to set detection sensitivity:
35
+
- Turn **clockwise** to increase sensitivity.
36
+
- Turn **counter-clockwise** to decrease sensitivity.
36
37
37
-
> **Tip**: Use 5V for better detection range and performance, though 3.3V is supported. Ensure the module's IR LEDs face forward.
38
+
> **Tip**: Use 3.3V for compatibility with Raspberry Pi GPIO. Ensure the module's IR LEDs face forward.
38
39
39
40
===== Circuit Diagram
40
-
image::irObstacleAvoidance-CD.png.png[]
41
+
image::irObstacleAvoidance-CD.png[]
41
42
42
43
===== Schematic Diagram
43
44
image::irObstacleAvoidance-SD.png[]
@@ -50,27 +51,39 @@ Use the following commands to test the component:
* `/wait/{timeoutMillis}` - Waits for obstacle detection within the specified timeout (in milliseconds) and returns `true` if detected, `false` otherwise.
75
+
76
+
[source, bash]
77
+
----
78
+
$curl http://localhost:8080/ir-obstacle/init
79
+
----
80
+
* `/init` - Initializes the sensor and adds an event listener to print `"Obstacle Detected"` or `"No Obstacle"` to the console when the sensor state changes.
68
81
69
82
===== Troubleshooting
70
83
**Sensor Always Reports Obstacle Detected**:
71
84
* Adjust potentiometer counter-clockwise to decrease sensitivity.
72
85
* Ensure the module is not facing a reflective surface.
0 commit comments