Smart Garage
So, my idea for this week is a smart garage but in a simple version. What happens is that I have 2 IR sensors: one to check if there’s any car outside to open the door, and another sensor inside to check if there’s any car that wants to get out, so the door opens as well.
Tinkercad → A website where we can design and simulate electronic circuits, allowing us to test and make sure they work before applying them in real life!!
Arduino → The big boss, used as our brain for control.
Breadboard → The playground for connecting and testing components 😎.
Jumper Wires → Used to connect components together.
Servo Motors 180 degreses→ Control the angle of the door(Output component).
IR Sensor → Checks if something is cutting the radiation(Input component).
Smart Garage Simulation Circuit
✨ Step 1: Bringing players to the playground
I gathered all my electronic “players” onto the breadboard: 2 PIR sensors, a servo motor, and an Arduino Uno. Time for the match to begin!
✨ Step 2: Connectionssss
First, I started by connecting the Arduino 5V to the red line of the breadboard and the GND to the black line.
Then I wanted to connect the IR sensor, but in Tinkercad the one that works is the PIR sensor—same idea and everything. I connected the signal pins to digital pins 2 and 3, GND to the black line, and power to the red line.
Finally, I connected the servo motor: the signal to digital pin 4, GND to the black line, and power to the red line.
✨ Step 3: Coding
For the code, it was quite simple logic: if one of the sensors reads (using the OR condition) → turn the servo 90 degrees. By default, it stays at 0 degrees as mentioned in the first line.
I started by connecting the wires as mentioned in Tinkercad, and placing the 2 sensors separately so I could test them. And as you can see in the video below, it worked just perfect.
At first on Tinkercad I wrote the condition as if the sensor is HIGH, and in the simulation it worked just fine. But when testing it on the real circuit, it didn’t work the way I expected. My instructor helped me by explaining that the IR sensor’s default is HIGH, so instead I needed to write the condition as if LOW, which means the sensor is actually reading.
Title of Media
Title of Media
Title of Media