Garage Distance Sensor–genesis

image

In a previous post I provided an initial overview of my Garage distance sensor.

The aim of the project is to provide a way to report the distance of a vehicle as it parks in a garage. It does this by sensing and showing the distance from a wall in the garage.

Initially, I was simply going to display a distance reading in millimetres, but the I thought that this may be confusing and at times hard to read if you were sitting inside the vehicle trying to park.

I settled on 4 digit LED display Sparkfun Qwiic Alphanumeric Display – pink because it was already pre-wired, relatively large digits and easy to read from a distance. Would I have liked larger digits? Sure, but for now, in test mode, these are more than adequate.

I also added a set of 5 LEDs to act as distance indicators. They are:

Red – Large away distance

Yellow – Medium away distance

White – Paring zone distance

Yellow – Medium close distance

Red – Large close distance

The driver is ultimately aiming to be in the white LED zone when parking. Anything else let’s them know, too far or too close. The idea with these LEDs on top of the distance display is that it is easier for the driver to see a single LED colour rather than having to read and then comprehend a distance in millimetres. If you are worried about parking you car, the less you have to worry about the better I believe.

To actually measure and report the distance I opted for a Adafruit VL53L1X Time of Flight Distance Sensor because its range is from 30 to 4000mm and it uses a Qwiic connector, which means less soldering. Given that I have already built projects with the VL53L0X sensor (30 – 1000mm):

Displaying distance on LCD screen

I would be able to reuse a lot of knowledge and code. The VL53L1X will give me out to four metres, which is right on song for something in a garage.

I decided to use an original Arduino Uno R3 controller for this project as well to gain some experience with the board. There are certainly more powerful and featured controllers, but it is more than adequate for this project.

As I developed the project I realised that I would need to work out the required distance manually and then code that in to the controller. This would mean that any adjustment of that parameter would mean updating the controller. Thus, I added a potentiometer that could used to make slight distance adjustments if required. That is, using the potentiometer, you can make the optimal distance either closer or further away. This means the distance can be adjusted without reprogramming.

To make this adjustment in distance if required, I added a simple switch to put the things into a ‘debug mode’. When the switch is ‘active’ you can use the potentiometer to adjust the sensor optimal distance offset. This offset is then detected when the unit returns to ‘normal mode’, and added (or subtracted) from teh coded optimal distance. Also, while in ‘debug mode’ all the LEDs will light so you know they are all operating.

The idea is then that you mount the garage distance sensor on a wall. When the the sensor detects the car it will display a distance in millimetres as well as display the appropriate LED based on the distance. The coded optimal distance value can be adjusted via an offset that is configured in ‘debug mode’ when the switch is set.

Hopefully, that gives you a better idea of what I was trying to achieve with my Garage distance sensor. In upcoming articles, I’ll break down each component and how I built it.