Security is something we often take for granted—until an incident reminds us of its importance. That’s why the idea of a smart burglar alarm resonates with me. It’s not just a project; it’s a response to a real need for safety, inspired by personal experiences. (Yup, we were robbed several times).
This burglar alarm system uses an ultrasonic sensor to detect movement. If an object or person comes too close to a protected area (like a door or window), the system activates a buzzer and flashes an LED as an alert.
If no motion is detected: The system remains in standby mode.
If an intruder approaches within a set distance (30 cm): The buzzer sounds and the LED blinks in an alternating movement, warning of unauthorized access.
I used TINKERCAD to simulate my circuit and make sure that the circuit I was designing is working well.
Used A breadboard, jumper wires (male male).
Buzzer: Output; to make a sound when the distance is too close.
Red LED: Output; to blink, making sure that it is clear a burglar came in.
Arduino Uno: to code all components.
Arduino IDE software to transfer the code to the Arduino Uno.
Ultrasonic sensor: The input, enabling the Arduino to express its code.
Two 330 Ohm resistors: For the safety of the electronic components (LED and Buzzer).
Designing the circuit on TINKERCAD:
1️⃣ Arduino UNO – Main microcontroller to process sensor input and control output.
2️⃣ Ultrasonic Sensor (HC-SR04) – Detects intruders by measuring distance.
3️⃣ Buzzer – Sounds the alarm when motion is detected.
4️⃣ LED – Flashes as a visual alert when an intruder is detected.
5️⃣ Resistor (220Ω - 330Ω) – To protect the LED.
6️⃣ Breadboard – For easy wiring connections.
7️⃣ Jumper Wires – To connect all components.
Coding:
I used code blocks as displayed in the screenshot.
I then downloaded the code as an *.ino file which is attached in the link at the end of this week's journal.
Connected the circuit components in the same way that I did on tinkercad (taking the pin numbers on the Arduino into consideration)
Generated the text code from tinkercad and then opened it using Arduino IDO.
Uploaded the code to my arduino after connecting it to the PC.
Burglar alarm in action.
While working on Week 6 assignment:
I didn't know what to decide as a project idea for this week's assignment, and all I was thinking was that I wanted to do some sort of alarm. My friend "Ahmed Tallat" was very supportive in this panicky phase and he helped me to organise my ideas and come up with a reasonable output. (The LED fading and the buzzer not continuosly ringing).
During End of week session:
I worked on the waving hand with Aya, and it was such a joy to discuss with her a unique cardboarding strategy to make it look like a "wait" sign instead of just waving. It was my first experience with a servo motor and it was extremely pleasant.
After creating the code blocks on TINKERCAD, the code was working fine and did it's intended purpose as long as I was close to the ultrasonic sensor. However, when I was far in the simulation, the buzzer would start acting up and didn't stop working at all.
I reviewed the code and researched the internet and then re-watched the videos that included the buzzer on the protal. Only to find that a simple "if, then" doesn't work with a buzzer and I had to add the control block "if, then, else". Once I adjusted this in the code, it worked as intended.
Using code blocks in Tinkercad can play a significant role in making an interactive learning board for blind and deaf students by allowing for the integration of electronic components, sensors, and programmed responses that enhance accessibility. Tinkercad’s block-based coding provides a simple yet powerful way to program Arduino microcontrollers, which can control various features of the board.
And I finally feel like my final project is actually possible.