Arduino Parking Sensor

by makaylajohnson2 in Circuits > Arduino

134 Views, 0 Favorites, 0 Comments

Arduino Parking Sensor

IMG_5370.jpg

For this project, I made a parking sensor. In my parking lot, I keep hitting my bumper on the stairs at the end of my parking spot, and I wanted something to help me know how far to pull in. So I made this parking sensor to tell me when to stop.


I used this instructable for help with my code and wires :)

https://www.instructables.com/Circuit-Playground-Express-and-Ultrasonic-Distance/

Supplies

IMG_5337.jpg
IMG_5336.jpg
IMG_5338.jpg
IMG_5339.jpg
IMG_5340.jpg
resistors.jpeg
IMG_5354.jpg

For this project, you'll need

  • arduino circuit playground express
  • battery pack (I used one with three AAA batteries)
  • HC-SR04 ultrasonic sensor
  • piezo buzzer
  • wire (any size will do)
  • two 2.2 kohm resistors
  • a box (I spray pained mine silver)
  • hot glue
  • soldering iron

MakeCode

Screenshot 2024-04-18 at 21.43.40.png

First thing I did was to code my arduino. I used makecode adafruit circuit playground express (makecode.adafruit.com). I made this so that the lights will always be green. Once the car is within 31cm (approximately 1ft), the light will change to be red and will send out a beeping sound.

Solder Wires to Sensors

IMG_5350.jpg
IMG_5351.jpg
IMG_5352 2.jpg

First thing that I did was solder the wires to the Vcc, Trig, and Gnd, parts of the ultrasonic sensor. I also soldered wires to both of the metal parts of the piezo buzzer. This way I could connect them to the arduino a little easier.

Any wires will work, but I found that the thinner wires were a little easier to connect with the solder.

Next, I soldered one of the resistors to a wire and then I soldered the wire to the echo connection.

Measure and Cut Holes in Box

IMG_5353.jpg
IMG_5362.jpg

I wanted all the wires to be inside the box so that you wouldn't see them. So I measured out where the sensors were going to be and where I would need to cut so that you could connect the wires underneith.

On the top, I put the ultrasonic sensor. I traced it with a pencil and then traced a square of where I would need to cut so that the wire connections would be inside the box.

I traced the arduino and then traced where the holes are on the side and then where the battery connection would be on the bottom.

I then traced a hole for the piezo buzzer so that it could slide in there.


I then cut the holes out but also left room where the ultrasonic sensor and arduino could be glued and connected to the box.

Attach Sensors to Box

IMG_5356.jpg
IMG_5357.jpg
IMG_5358.jpg
IMG_5359.jpg

Next, I hot glued the ardino to the box. I stuck the wires in from the ultrasonic sensor and the piezo buzzer and then glued those on to the box. All of the wires are inside of the box


Note : I had my resistors hooked up wrong at first. They should not be connected, but one should be hooked up to the wire and the other will be on its own.

Attach Wires to Arduino

IMG_5381.jpg
IMG_5361.jpg
IMG_5366.jpg

I attached all of the wires to the arduino

ULTRA SONIC SENSOR :

Vcc --> Vout

Echo --> (first) resistor --> A1

A1 --> (second) resistor --> ground

Trig --> A2

Gnd --> ground


PIEZO BUZZER :

one wire to A0

one wire to ground


after I put the wires where they need to go, I soldered them down to the arduino


** you could put the wires on the outside of the box, I just didn't want to see them

Glue Down Battery Pack

IMG_5363.jpg
IMG_5364.jpg
IMG_5365.jpg
IMG_5366.jpg

Next, I hot glued the battery pack into the box. For this, I put hot glue around the sides and made sure that the on / off switch was outside for easy access to turn it on and off. I also made sure that I wasn't gluing the top on so that I could take off the top to change out the batteries when needed.

Then, I plugged in the battery pack to the arduino

Enjoy Your Parking Sensor!

IMG_5367.jpg

Test out your parking sensor and enjoy!