My final project for this class was to make a robot that could turn left and or right by sensing walls and a flame to put it out. This robot had to sense the track’s walls, which could be flipped to the left and right to test for both left and right turns. Said track was made with two parts, one part was an L-shape, and the other was an incomplete square. When you connect them, the robot will make 3-4 turns. The students with a partner had to use some code that was used throughout the semester and create the turn functions for the robot. The students also had to 3D print the wheels and a ping pong ball holder to be the third wheel for the robot. Some of the code used was our motor mounts though my partner and I had to tweak the size and thickness to make it work for our robot. We also used our stepper motors and the ultrasonic sensor to sense the walls on the track to make the wheels turn the right way without the servo motor. We also used a flame sensor to detect the flame or phone light since we didn’t have lighters. Aside from creating my wheel, I also made the music function, the robot didn’t need it, but my partner and I added it just for fun. This is what my partner did for the project.

We used a piezo buzzer, and I made a function with the note definitions and frequencies starting at B0-DS8 (lowest note possible to D sharp eight lines above the staff) and used the notes present from the Mario fire flower theme. I used this website to help me calculate the note duration. And I discovered the calculations could be the same for all the notes involved. According to the website, to find out how many milliseconds one note can take is ms(millisecond)=60,000/BPM*T. There is 60,000 ms in a minute, BPM is how many beats per minute the said song is going, and T stands for tempo. Tempo for this site means how many of these beats are there, so for example, if the song had a BPM of 165 and you needed a half note, you would do 60,000/165*2. But I didn’t want the do two steps for each note duration. I wanted it to be a one-stop shop, so I figured out that if you wanted to make an eighth note, you have to double the BPM, meaning in the example, it would be 60,000/330, which gets the same result as 60,000/165*0.5 and 60,000/83 gets the same effect as 60,000/165*2, Now it only gets complicated if you have triplets which are a quarter note split into three parts. Still, you can get the hang of it quickly.

Victory_song

After all the code was finished, we started to make the robot we affectionately named “Eggy” We tried our best to shape it like an egg; by outlining in pencil and pen and drawing out the holes that we would drill for the motor mounts and the fan that would be used to put out the “fire.” After screwing the mounts and the fan in on Eggy, we lined up how we wanted the breadboard, Arduino, and battery pack to be on the Eggy and kept it down with an elastic tap. We also zip-tied the wires so it looks neat.

If given more time, my partner and I would try to make it so that Eggy could do a zero-point turn instead of turning in small steps. And it also doesn’t take so long to complete the track. When doing the track that requires left turns, it takes 2:24 and 1:30 for the track that requires right turns, respectively. But other than that, there isn’t much that I would want to change to Eggy because of how well it turned out Eggy did a great job. But here’s our first test run and successful right and left turn runs.