Build garage door obstruction sensor
[email protected] 2026-07-23 21:04:36 72 Views1 Replies Hello,
In these tight garages, I wanted to know when my car is far enough in to close the door. I have built an obstruction sensor using Arduino UNO and the Infrared Laser distance sensor (SEN03666). It works some of the times but not all the times, and it has a slow response time. One of the cars is black and shiny and when there is sun beaming in the direction of the garage, the sensor becomes clueless. It works perfectly when it is dark but the response is a bit slow.
I am looking for suggestions how I can improve on this project and what other components I should consider.
Thanks
Hi there,
The Arduino UNO is probably not the main problem here. The SEN0366 is an optical single-point distance sensor, so strong sunlight and the reflectivity of the target can significantly affect its readings. A black glossy car is particularly difficult because it may absorb the light or reflect it away from the sensor.
You could first try:
1. Add a small shade or hood around the sensor to prevent direct sunlight from reaching it.
2. Aim the sensor at the license plate instead of the painted body, or attach a small matte/reflective target at the measuring point.
3. Use continuous measurement and apply a median filter to a few readings. It is also helpful to keep the previous valid result when the sensor temporarily returns an invalid reading.
4. Add some hysteresis around the stopping distance so the indicator does not switch rapidly near the threshold.
However, for simply detecting whether a car has moved far enough into a garage, I would recommend a narrow-beam ultrasonic distance sensor instead. It is generally less affected by the car’s color and sunlight. A narrow detection angle is important in a tight garage so that the sensor does not measure the side walls.
For this application, you could consider the DFRobot URM06-PULSE Narrow Beam Ultrasonic Distance Sensor (SEN0151).
It has a 15° detection angle and a measuring range of 20 cm to 10 m, so it is less likely to detect the side walls in a narrow garage. It uses a TTL pulse interface, which is also relatively straightforward to connect to an Arduino UNO.
Unlike the infrared sensor, its measurement will not be directly affected by sunlight or the black color of the vehicle. However, the mounting position and angle are still important, since curved or angled parts of the car may reflect the ultrasonic signal away from the sensor.
Please note that the URM06 is recommended to use a separate 6–12 V power supply rather than powering it directly from the Arduino 5 V pin. The sensor and Arduino should share a common ground.
Hinar.Joestar 

