Introduction

When you pull your car into the garage, it's always a bit of a guessing game to determine how far to pull in. You want to drive in far enough to close the garage door but not so far that you hit your bicycle or some other obstruction. This project uses ultrasound to help you park your car at a repeatable, predefined distance everytime you pull in. Note: this is just a concept project that utilizes a number of the components in the TINKERkit. We cannot be responsible for software, wiring, hardware, or user errors. So, be aware of this in the event you decide to make this a permanent installation in your garage.

Required Parts

The following parts are required for this project:

  • A TINKERplate attached to a preprogrammed Raspberry Pi
  • From a TINKERkit
    • the HC-SR04 Ultrasonic Sensor
    • the mini breadboard
    • the 74HCT125 IC chip
    • the 8 channel RGB LED module
    • the Beeper module
    • male to male jumper wires as required
    • optional: four male to female jumper wires if you choose to relocate the position of the ultrasonic sensor or LED strip.

Assembly

OK, there's a lot going on with this assembly so study the diagram below very closely and place the jumpers accordingly:

Note that to aid the wiring, we are showing the rear view of the LED strip and the ultrasonic sensor. These two items should face the front of the car low enough to detect the front of the hood but high enough so that the driver can see the LEDs. Depending on the model of the car, you might want to use some of the male to female jumper wires to position either the ultrasonic sensor or the LED strip to a more advantageous position.

Code

The above code can be downloaded from github by typing the following instructions on the command line:

  1. git clone https://github.com/pi-plates/TINKERplate-Projects.git
  2. cd TINKERplate-Projects
  3. python3 UltraParkingAid.py

The code breaks the distance measurement into different zone and performs a unique action for each:

Zone Low Distance High Distance LED color Blink Alarm
0 120" off FALSE FALSE
1 40" 120" green FALSE FALSE
2 30" 40" yellow FALSE FALSE
3 20" 30" red FALSE FALSE
4 0" 20" red TRUE TRUE

Operation

As you pull in, the LEDs go from off to a steady green. When you are between 30" and 40" the LEDs will switch to yellow indicating you are getting close. When you are between 20" and 30", the LEDs turn a steady red indicating you should stop. If you get closer than 10" the LEDs will start flashing and the alarm will sound. Again, these values can be modified to accommodate your garage and car.

 

Series Navigation<< LED Night LightAnalog Panel Voltmeter >>