Obstacle Detection and Warning System for a Pluto Drone
When flying a drone as a beginner, or even in a large open space where the drone is far away, it’s difficult to detect obstacles in the…
Obstacle Detection and Warning System for a Pluto Drone
When flying a drone as a beginner, or even in a large open space where the drone is far away, it’s difficult to detect obstacles in the drone's path. Colliding with these obstacles could not only cause damage to the drone but would also damage the objects that the drone flew into. To solve this, I created a project that would significantly improve the safety of a drone by alerting the pilot when an object is too close to the drone and allowing them to redirect to a safer route.
The solution is to alert the pilot when an obstacle is nearby by using both a sensor and an output signal. I began by attaching an IR sensor to my drone using the GPIO_2 pin on the drone's flight controller. I tested the sensor and adjusted the distance using the adjuster on the sensor to my preferred distance at which an object would be detected and flew the drone to ensure it worked successfully. Moreover, I monitored the sensor on my laptop and was able to see whether an object was detected (value = 0) or not (value = 1).
After this, I required an output signal. At first, I thought LEDs would be sufficient, as they can flash various colour combinations on the drone, which would indicate when an object was near the drone. However, upon testing, I learned that LEDs are small and not entirely visible from afar, which would make the signal small and not identifiable. Therefore, I chose to use a hooter, which produces a loud beeping sound that is easy to hear even when the drone is far away. The hooter was connected to the GPIO_1 pin on the flight controller. Using Pluto Blocks, I programmed the drone so that whenever the IR sensor detected an obstacle, the hooter would sound continuously until the drone moved back to a safe distance.
This system provides the pilot with an immediate warning, allowing them to identify when an object is too close and safely change the drone’s direction.
IR Sensor: An IR sensor is an infrared sensor; it is a distance detector between an obstacle or object and the drone. It is a digital input sensor, which means it only has two possible outcomes, which can be monitored on a computer: 0 and 1, which mean an object is detected, and the pathway is clear, respectively. The IR sensor has a manual adjuster which can be adjusted (using a screwdriver) and can change the range at that objects are being detected. It detects objects by continuously emitting beams of infrared light. When the drone flies near an obstacle like a wall, this invisible light hits the surface and bounces back toward a receiver on the drone, which allows the sensor to detect an object nearby.
Hooter: The hooter is an output device that produces a loud beeping sound when instructed to. It can be turned to low(off) or high(on) and can be used with input signals to indicate or verify various things. In this project, the hooter acts as a warning system. Whenever the IR sensor detects an obstacle (value = 0), the hooter switches on and continues beeping until the obstacle is no longer detected. This alerts the pilot that the drone is too close to an object and needs to change direction immediately.
CODE (on Plutoblocks):

How it works:
- The drone flies normally.
- The IR sensor continuously checks for obstacles in front of the drone.
- If no obstacle is detected (IR = 1), the hooter remains OFF.
- However, if an obstacle is detected (IR = 0), the hooter immediately turns on and starts beeping.
- The hooter continues beeping while the obstacle remains within the range of the IR detection.
- Once the drone moves back to a safe distance, the IR value changes back to 1, and the hooter turns off.

Challenges:
- Using LEDs instead of a Hooter: Initially, I used LEDs as the warning device; however, they weren’t bright enough and didn’t emit any sound, making them unreliable. Replacing them with a hooter made the alert much more noticeable.
- Incorrect pin connections: I connected the attachments to the wrong pins on the flight controller, which prevented the project from working.
- Using wrong coding blocks: At first, I tried to read the IR sensor using an ADC block because I didn’t understand the difference between digital and analogue. After changing it to a GPIO because the IR sensor is digital, the project worked successfully.
Key learnings:
- Digital input sensors and analogue input sensors are read using different pins
- How to connect components correctly using the GPIO pins on the drone’s flight controller.
- How to program logical conditions using if-else statements in Pluto Blocks.
- The importance of testing and improving a design when the first solution is not working properly.
Tips:
- When connecting the IR and Hooter to the Flight Controller, use the GPIO pins (1&2), and when coding on Plutoblocks, ensure that the IR and Hooter pins correspond to which ones they were connected to.
- Test the sensors individually with the drone before using them together.
- Ensure the sensors are fully connected to the FC
- Monitor the IR sensor on the laptop.
- Ensure you have practised flying the drone before flying it among obstacles.
메타데이터
- post_id
- 3dfe2f2e78a7
- slug
- obstacle-detection-and-warning-system-for-a-pluto-drone-3dfe2f2e78a7
- url
- https://medium.com/@aditiponugoti/obstacle-detection-and-warning-system-for-a-pluto-drone-3dfe2f2e78a7
- canonical_url
- https://medium.com/@aditiponugoti/obstacle-detection-and-warning-system-for-a-pluto-drone-3dfe2f2e78a7
- author_url
- https://medium.com/@aditiponugoti
- status
- ok
- fetched_at
- 2026-08-16 18:49:06