This week, our assignment was to design a simple smart circuit using electronic components and Arduino. I chose to create an intrusion alarm system. The idea is that when someone enters a restricted area, the alarm is triggered and a sound is played. For this project, I used an Arduino and a buzzer.
What inspired me is the presence of different types of alarms, whether fire alarms or intrusion alarms, that we often see in important places like shopping centers or museums. I also liked the idea of having such a system for security in my future home.
Picture 1
Picture 2
For designing the Circuit:
tinkercad.com
Tinkercad is an online platform that makes it easy to simulate electronic circuits. I used it to test and visualize my wiring before building the real circuit.
For Online Simulation :
Breadboard
Power supply
Resistor (220 ohm)
LED (Red-Red)
DC Motor
Arduino
Buzzer
Ultrasonic Sensor
For Practical Implementation :
Breadboard
Adpter 5v
Jumper wires
Arduino
Buzzer
Ultrasonic Sensor
Electrinic circuit in Tinkercad :
To design and prepare my project I used Tinkercad, which allows creating and simulating electronic circuits before building them in real life. Here are the main stages I followed:
Steps to build the circuit on Tinkercad.com :
I logged into Tinkercad.com and selected the electronic circuits section
From the component search bar, I selected the following parts:
Arduino Uno,
breadboard,
two red LEDs,
a buzzer,
an ultrasonic sensor,
and two 220-ohm resistors.
I connected the components together in an organized way, making sure the positive terminals of the components were properly linked to the Arduino digital pins.
After finishing the wiring, I started programming using Scratch blocks. I first made the two LEDs blink whenever the sensor detected movement.
Then, I searched online for different alarm sounds to decide which melody I wanted for my project.
Finally, I chose a particular alarm sound and tried to code it using the Scratch blocks.
Input / Output components :
For the input components, I used an ultrasonic sensor, which detects the movement of objects in front of it.
For the output components, I used two red LEDs and a buzzer: the LEDs blink while the buzzer plays a specific melody.
THE CONSTRUCTION STEPS :
First, we connected the different components on the breadboard, following the same setup as in the Tinkercad.com simulation.
Next, we added the ultrasonic sensor to the circuit, making sure to correctly place its four pins on the breadboard.
After placing the components, we moved on to the Arduino. I connected the different components to the Arduino: I used the digital pins for the LEDs and the buzzer, and I connected the ultrasonic sensor to the digital pin.
For the Arduino coding, I copied the code from Tinkercad.com, but as I described in the ‘Overcoming Challenges’ section, I had to modify this code using the Arduino software.
The final Result :
During this assignment, I faced several challenges, especially when coding the buzzer frequencies. I had a specific melody in mind, but whenever I tried to code it, the sound came out differently.
The biggest problem, however, was when I wanted the buzzer to work at the same time as the two red LEDs, in order to simulate a real alarm sound. With the Scratch block coding, I couldn’t manage to activate them simultaneously. To solve this issue, I decided to download the code in Arduino format and then edit it directly using the Arduino software. This took me many hours of thinking and testing before I finally found a working solution.
From this experience, I learned that sometimes block-based coding has limitations, and switching to real Arduino code can give more flexibility. Others doing the same project should be aware of this challenge so they can save time if they face a similar problem.
This week, by using block-based coding in Scratch, I gained new ideas that can be applied to my final project. It helped me understand how to control movements more easily, and it even gave me a small idea for the coding of my final project, which is about a rotating globe.
The coolest thing I learned this week was the Smart Waving Hand project that I worked on with my partner Omar. It was a very interesting and fun activity. We built two different circuits: one where the hand waves manually using an Arduino and a potentiometer, and another where the hand waves automatically using an Arduino and an ultrasonic sensor.
This is something I will never forget because it combined creativity with electronics and showed me how sensors and components can make projects more interactive.