Rear View Infrared Sensor W/ Arduino in Tinkercad

by TJ Jean Augustine in Circuits > Arduino

451 Views, 1 Favorites, 0 Comments

Rear View Infrared Sensor W/ Arduino in Tinkercad

Screenshot (326).png

Welcome, this instructable is a tutorial on how to build a rearview infrared sensor for a car using an Arduino in Tinkercad. This project also uses the program Logisim to create the schematics for the logic gate portion of the sensor, and schematics for the actual build were done using Circuit-Diagram.org.

Supplies

The materials that are needed to build this project are:

  • 1 Arduino Uno R3
  • 1 Large Breadboard
  • 2 1.5v AA batteries
  • 1 74HC08 gate or Quad AND gate
  • 1 74HC04 gate or Hex Inverter
  • 1 DIP switch SPSTx4
  • 1 Buzzer/Piezo
  • 1 Infrared Sensor
  • 1 Infrared Remote
  • 1 4 pin Ultrasonic Distance Sensor
  • 5 Red LED's5 100 Ohm Resistors
  • 3 1k Ohm Resistors

All materials can be found in Tinkercad

If you would like to build this circuit IRL, here is a price list for the parts that are used in the circuit. All prices are in CAD. Prices may differ depending on the location and time of purchase.

Total cost: $79.39

All materials can be found in Tinkercad

Logic

Screenshot (296).png
Screenshot (298).png
Screenshot (294).png

When viewing this project one might wonder how the project works and the logic involved. The first step in understanding the logic behind the project is to understand all the different components that are being used in the project. We can see the use of logic gates and sensors/led's as our 2 main components. Logic gates take more than 1 input and produce 1 output with it, however, multiple logic gates used together can create more than 1 output. Essentially logic gates take input values and use them to produce output values, the specific values are up to the truth table and the user, a combination of inputs can be used to produce a combination of outputs and it is all done in binary. Binary is the base 2 number system meaning that there are only 2 values that can be used to represent different numbers those 2 values are 1 and 0, they can essentially be mimicked by an on/off power switch 1 represents when the switch is on and 0 when off. When using logic gates a truth table must be produced to demonstrate the different combinations of input values and their outputs. When you believe that you have created a truth table that suits your needs you can create an equation from the truth table. Then simplify the equation and design the logic gates in your circuit to replicate the equation, thus replicating your truth table in a circuit. When breaking down the second half of the circuit we focus a lot more on the components and what they mean to the circuit. The sensors and LEDs are the heart of the circuit, they are the reason that circuit is able to receive most of its inputs and where the circuit will display most of its outputs. Each sensor plays its part in the circuit, for example, the distance sensor gathers the distance the button is from the sensor and the infrared sensor gathers the infrared rays that are being displayed by the infrared remote. This is where both pieces come together these inputs are then mixed with code and logic gates and produce outputs, as the LEDs and buzzer will turn on depending on the conditions of the distance, infrared sensor and the logic gates.

Initial Assembly and Wiring

Screenshot (294).png
Screenshot (320).png
Screenshot (324).png

When Initially creating the circuit you wanna follow the schematic of your logisim circuit to wire your logic gates correctly. If you would like to use my exact circuit the schematic and logisim diagram along with the final edition will be provided. When wiring your project you should always space the wires out as to not overlap and only do so when necessary. Separate the components into sides on the breadboard, 1 side for the logic gates and the other side for the other components. This will provide some organization to your breadboard and make it easy to understand. Make sure to also place the sensors far away from each other to not overlap the chips and evenly space the LEDs. The resistors that I have used in my project may not be the resistors that work the best for you, always make sure to change the components based on your own observation, if you believe that a 500-ohm resistor would work better than the 100-ohm resistors then use the 500-ohm resistor. This project is supposed to be used as a guideline and the components and layout should be experimented with to produce the desired result.

Code

Screenshot (312).png
Screenshot (313).png
Screenshot (314).png
Screenshot (322).png
Screenshot (317).png

Coding is a very large part of this project as the sensors will not be able to function correctly without properly written code. The code that I use may be very different from the one that you may use as the pins that I attached to my sensors and LEDs may be different from yours. I have taken pictures of the code and attached a file for reference.

Downloads

Homie Check

Screenshot (324).png

Use this step to re-check your wiring and sensors to make sure that everything is working correctly, a photo of the fully-functioning circuit along with a video of how it is supposed to work has been posted above.

Finish

Screenshot (324).png

Make sure to look over all the aspects of your project one final time. Then begin testing and see how it works, if you were able to create a fully working rear view infrared sensor, congratulations, however, if you were not able to create a working sensor then keep trying and check the other steps again and experiment until you are able to get it right. Hopefully, you enjoyed this project as much as I did. Thanks for using my instructable and have a great day!!