Sensor Speedway

by natepitts in Circuits > Arduino

345 Views, 1 Favorites, 0 Comments

Sensor Speedway

DALL·E 2023-01-13 14.08.20 - cartoon confused toddler in operating room, digital art.png
IMG_8050.jpg
IMG_8049.jpg

Welcome to Team 21’s mini board game project that will teach students the basics of circuitry! In this project, we will be building a fun and interactive game where a mini car travels along a track and triggers various circuits to be closed. Along the way, the car will encounter different checkpoints that will activate inputs and cause sensors/outputs to be triggered. By working on this project, students will learn how to assemble a basic circuit, troubleshoot issues that may arise, and get a good grasp on how a basic circuit works. With a little creativity and experimentation, students can also customize the project and create new games and circuits. So, let's get started and have fun learning about circuits!

Supplies

Building the Frame

IMG_8031.JPG
  1. Obtain 1 Cardboard box, 12”x24”x6” and another (larger than the other box) cardboard box
  2. Cut off the top and bottom flaps from the smaller box, leaving just a rectangle with no bottom or top
  3. From the larger box, cut out the two largest sides, making sure they are at least slightly bigger than 12”by24” 
  4. Apply glue to the edges of the box, then connect it to one of the large singular pieces of cardboard making sure all edges connect with the other cardboard, this will be the bottom of the gameboard
  5. Before continuing, make sure the glue connecting the edge of the box to the base is dry, then line up the other singular piece of cardboard long side to longside on the open side of the box
  6. To connect the lid to the base frame of the gameboard, cut out multiple pieces of tape and attach them so the lid is securely attached 
  7. Make sure one of the long sides of the box only has two pieces of tape, each of them at the far edge of side of the box.
  8. Once these pieces of tape have attached to the long side of the board, cut out the cardboard between the two pieces of tape leaving a hole in the side of the box to view the components and wires.
  9. Make sure all connections are sturdy and not loose, if loose reapply glue and tape where needed to further strengthen the box.
  10. Next, mark out the track for the game on the lid of the box. 
  11. Once the track has been designated, mark where each component should go
  12. Once the layout has been finalized, begin cutting out holes for the components
  13. Cut out a hole for the large Push Button, making sure the hole is larger than the connection point but smaller than the overall button. 
  14. Cut slits into the cardboard where each of the LEDS will be placed.

Connecting the IR Sensor

IMG_8048.jpg
  1. Sensor 1
  2. Connect the red wire to the power supply
  3. Connect the black wire to the ground supply
  4. Connect the yellow wire to the input port from the arduino
  5. Sensor 2
  6. Connect the red wire to the power supply
  7. Connect the black wire to the ground supply
  8. Connect the yellow wire to the output port from the arduino


Connecting the Push-Buttons

IMG_8043.JPG
  1. Connect one end of the push button to an input port of the Arduino
  2. Connect the other end of the push button to a 22uF capacitor
  3. Connect the other end of the capacitor to common ground

Connecting the LEDs

IMG_8042.JPG
  1. Connect the ground end of the LED to common ground 
  2. Connect the positive end of the LED to one end of a 220Ω resistor
  3. Connect the other end of the 220Ω resistor to an output port of the Arduino

Connecting the Seven-Segment Display

IMG_8040.jpg
  1. Push the display down into the breadboard
  2. Connect a 220Ω resistor to each end of the LEDs in the display
  3. Connect the other end of the 220Ω resistors to the power supply
  4. Connect a wire to the other end of the LEDs from the display to the ground supply

Connecting the LCD Display

IMG_8039.jpg
  1. Connect LCD VDD(+5Volt) and LED Positive to +5V
  2. Connect LCD VSS(GND) and LED Negative to GND
  3. Connect pin 14 to Arduino digital pin 12
  4. Connect pin 13 to Arduino digital pin 11
  5. Connect LCD pin 12 to Arduino digital pin 10
  6. Connect LCD pin 11 to Arduino digital pin 9
  7. Add corresponding code to test LCD output

Connecting the Speaker

IMG_8038.JPG
  1. Solder the Speaker's V and GND wires
  2. Connect it to the breadboard
  3. GND passes through a 220 ohm resistor

Connecting the Ultrasonic Sensor

IMG_8036.jpg
  1. Connect a wire from GND on the sensor to ground
  2. Connect a wire from VCC to 5 volts
  3. Connect a wire from ECHO to PIN27
  4. Connect a wire from TRIG to PIN28

Connecting the Potentiometer

IMG_8035.jpg
  1. Connect a wire on the left or right pin to ground
  2. Connect a wire on the other left or right pin to power
  3. Connect a wire from the middle pin to A0

Proper Hardware Connection

IMG_8034.JPG
IMG_8051.JPG

Using the program software Arduino IDE, program the microcontroller to respond to the different inputs and outputs. Connect a cable from the computer to the Arduino Mega 2560. Copy the given code into the Arduino IDE software and choose the correct output port to load the code into.

Code

Click the link below and copy/paste the code into Arduino IDE


https://docs.google.com/document/d/1DKt8LLZRMGE_NEB-IeZQYwBk1QUnYsVgkuhR0oFQ2Fw/edit?usp=sharing


Customize and Enhance

customization-icon-from-business-bicolor-set-vector-5356624.jpeg

Use your creativity to customize the mini board game by adding new sensors, inputs, and outputs, or by modifying the track and car design. Make it yours!

References

[1] A. Ragab, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 07-Apr-2020. [Online]. Available:

https://grabcad.com/library/digital-metal-detector-med-solutions-1. [Accessed: 24-Mar-2023].

[2] A. Whitham, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 03-Jan-2014. [Online]. Available: https://grabcad.com/library/arduino-uno-r3-1. [Accessed: 24-Mar-2023].

F. Melges, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 24-Aug-2021. [Online]. Available: https://grabcad.com/library/mini-speaker-4ohm-3watt-1. [Accessed: 24-Mar-2023].

[3] “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 06-Oct-2017. [Online]. Available: https://grabcad.com/library/100mm-button-1. [Accessed: 24-Mar-2023].

“Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 20-Dec-2022. [Online]. Available:https://grabcad.com/library/mcd-8021-2-digit-7-segment-led-display-dp-0-8-1.

[Accessed: 24-Mar-2023].

[4] IA Cristóbal Rincón, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 05-Apr-2021. [Online]. Available: https://grabcad.com/library/led-5-mm-3. [Accessed: 24-Mar-2023].

[5] Jelger van de Ven, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 29-Nov-2020. [Online]. Available: https://grabcad.com/library/arduino-digital-display-1. [Accessed:

24-Mar-2023].

[6] M. Beltrán, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 12-Jan-2020. [Online]. Available: https://grabcad.com/library/dp3t-slider-switch-1. [Accessed: 24-Mar-2023].

[7] T. Mahé, “Free CAD designs, Files & 3D models: The grabcad community library,” Free CAD Designs, Files & 3D Models | The GrabCAD Community Library, 12-Jan-2020. [Online]. Available: https://grabcad.com/library/grove-ultrasonic-ranger-v2-0-1. [Accessed:

24-Mar-2023].