Electrical Review

Car Braking Alert System

The purpose of this project is to create a car that has a sensor and a Arduino that can detect how close an object in front of the car is.

Material list

Lego pieces, an Arduino Uno, an ultrasonic sensor, a breadboard, jumper wires, LEDs, and a piezo buzzer.

Material Use

Lego Pieces - The car body and its wheels

Arduino Uno - Stores the code, and powers the ultrasonic sensor, the piezo, and the LEDs.

Ultrasonic Sensor - Detects the distance from the sensor and then sends it to the Arduino and then you can view the distance in the serial monitor.

Breadboard - Holds the jumper wires, the LEDs, and the piezo buzzer. The breadboard powers the LEDs and the piezo buzzer.

Jumper Wires - The jumper wires transfer inputs and outputs of power and code to the other pieces of the circuit (Ultrasonic sensor and piezo buzzer.

LED's - Light up depending on how close an object is to the ultrasonic sensor.

Piezo buzzer - Outputs a sound that's pitch gets higher and higher depending on how close an object is to the ultrasonic sensor.

Daily Log

2/22 - On TINKERCAD I built a car braking alert circuit that would make a noise if the ultrasonic sensor detected something in its path.

2/23 - ON TINKERCAD I created and edited the code for the car braking alert so that the sound would change depending on how far away the object is.

2/24 - Using Lego pieces I helped build a Lego car that has enough room to fit the ultrasonic sensor, the Arduino, and a breadboard.

2/25 - Today I worked on the code so that the lights would turn on the closer it got, but I was not able to figure it out.

2/28 - I finish the code today, I tested the code with the circuit and it worked. Then I attached the circuit to the car.

Code

Parking Sensor Code

Car body

This is the car body. It's made out of Legos only. It uses 4 wheels that connect to a body by putting the black axles through a body piece that has circular holes which allows the axles to turn. There are 3 body pieces that are all connected together and the center one connects to the top of the car that holds the circuit.

A3160BEB-2310-438B-BB56-5BCCEBF677AF.MP4

tinkercad Video

In TINKERCAD I created the circuit and the code to make sure it would work before building the circuit. For the code, I had to edit the code so that the buzzer would function properly and so that the LEDs would work properly since all of them would light up at once instead of lighting up 1 by 1 depending on what the distance was according to the ultrasonic sensor.

arduino circuit

This is the physical circuit. In it, you can see the Arduino, the breadboard, the jumper wires, the ultrasonic sensor, the LEDs; however, in this photo is right before I took the video so we removed the piezo buzzer from the circuit because it was very loud and you can hear it in the TINKERCAD video.

59652950-F401-4E1B-8674-7CD36606F38D.MP4

Physical circuit Video

In this video, you can see the circuit reacting to my hand near the ultrasonic sensor. The LED's light up depending on how close my hand is to the circuit and the serial monitor shows how far away my hand is from the ultrasonic sensor. Again the buzzer was removed from this video because it was very loud.

In the end, my group and I were able to create a fully functioning car braking alert circuit that created a sound and light up LEDs depending on how close an object is and would send the distance from the ultrasonic sensor to the Arduino to the computer. We also created a lego car that could support the circuit and move around.

4-in-1 game

Soldering steps and pieces

The first pieces I soldered onto the board were the key switched and I put on the caps as well. These give inputs into the microcontroller that allow you to control the games.

Next, I soldered the microcontroller onto the board. What was hard with the microcontroller was that it didn't have any pins so I had to solder it directly to the board(I talk about this later).

Next, I soldered the USB port onto the board so that I could power it without needing batteries.

Next, I soldered the capacitor onto the board. It stores energy and can change the strength of energy in the circuit how.

Then I soldered the buzzer onto the board. This outputs sound when the board is turned on and when certain things happen in the games.

Next, I soldered the power switch onto the board. It has a red cap I just hadn't put it on yet.

Next, I soldered the timer/score board onto the board. It shows the high score of the game that your on before you start playing it and while display your score while your playing it.

Finally, I soldered the display screens onto the board. Each white circle will become red for the games if something is supposed to be there.

Problems and solutions

Microcontroller

As I said, the microcontroller didn't have any pins so soldering it was a challenge. I didn't check to make sure the soldering was right and connected to the board and I didn't relies until I tried to turn it on and nothing happened.

fixed

I went back and properly soldered the microcontroller to the board. What was a little hard about this was the fact that all the pieces where already on the board so I had much less space to work with adding the rest of the solder.

FBB2BDA2-C665-4E2D-A8E8-9FAA3DFA0335.MP4

Finished product

After re-soldering the microcontroller I had a problem where I had to keep pressing down on a button otherwise the code would reset. I went over everything under the microscope and added extra solder to areas that looked like they might need some and the problem wasn't fixed, and after asking my teachers we could not figure out the problem and a lot of my classmates had the same problem and no one could figure it out. In the video, I turn the game on and you can see Tetris start to play, I made an attempt to play but I lifted my finger off of the button so it reset the code.