Concept
Ideation
I chose the idea of making a security alarm, let's see how it works🤩
Inspiration
Security Alarm
This week's task is to make an electronic circuit using Arduino, write a code block on Tinkercad, connect this circuit, and try it in reality.
software : Tinkercad
It is online software from Autodesk, I think it is a discovery for me. It is used in modeling and building electronic circuits and simulating them, and this is the best part about using it. It allows you to build any electronic circuit because it has a large library of electronic components and the wonderful feature of writing codes through blocks that are built, in addition to the usual method of writing using text.
This program is used through which we transfer to the Arduino, where the code was copied from the Tinker Cad and checked to ensure that there are no errors. Then the download was done and made sure to choose the Arduino Uno from the drop-down list at the top.
components of circuit
red LED
green LED
Jumpers Wires
Breadbord
Ultrasonic Sensor
2 resistor
Arduino UNO
Buzzer
Design / preparation process
Input Components
The ultrasound sensor works by sending waves through one eye at a specific range that is determined, and the waves received by the other eye are reflected, thus determining the distance to the object in front of it. In this picture the explanation is clear. It requires 5 volts
Output Components
red LED
An LED is an output component used for illumination, alarm or indication. It requires 3 volts to operate, so we always use a 220 ohm resistor to reduce the voltage.
Buzzer
Buzzer is one of the output components, which is often used to provide some kind of warning or produce music with different pitches. It requires 5 volts
The breadboard is considered one of the solutions through which electronic circuits and smart circuits can be created using Arduino without having to make welds between wires and using complex boards, as it is used in Prototype.
As is clear in the pictures, how to connect, the difference between the slots, and how to use them
I have connected the 5V pin of the Arduino to the positive row of the breadboard
Connect the ground to the negative row
Connect the positive terminal of the yellow LED to pin 9
Connect the positive terminal of the red LED to pin 10
The negative terminals of each LED have two resistors of 220 ohms
Connect the positive terminal of the buzzer to pin 8
Connect the Echo terminal of the sensor to pin 5
Connect the trigger end of the sensor to pin 6
The positive terminal is on the positive terminal of the breadboard, and the negative terminal is on the negative terminal of the breadboard
Code Blocks
From the list of variables, a variable was created and the input block was selected
The ultrasonic block was selected from the input list and select pins for both the trigger and the echo sensor was selected which 5 & 6
I have placed a special serial monitor block from the output blocks to show the distance the sensor senses
I placed a special block for conditional statements so that the operation can be performed under a specific condition
The condition is that the input is greater than or equal to 100
Make LOW and HIGH for each of these selected pins
Or if this condition is not present, do this
Code function description
If a person or object is present at a distance greater than or equal to 100 cm, the yellow LED becomes illuminated, indicating that there is no danger.
If the distance is less than 100 cm, then the yellow LED will turn off, the red LED will light, and the buzzer will emit a warning sound of the presence of an approaching object.
Assembly 🛠️
A 5 volt adapter was used because the motor needs this voltage, and this problem was solved in the LED, which only needs 3 volts by placing a 220 ohm resistor.
Final 🤩
....finally
This cute car was used to help me test the distance that the sensor senses to warn of an object approaching it, as is clear in the video.
Challenges 🥹
There was a problem in placing code blocks. I did research on the Internet on how to create a variable and write code for the ultrasonic sensor.
Files & Resources💾