The Inspiration
This week we'll make a smart circuit using an Arduino UNO which reads a signal from an input component (Sensor, Switch, or variable resistor) to control an action component (Motor, Buzzer, LED...etc) using Code Blocks.
I like to watch movies talking about robbeies, and I am amazed at how smart that security system is, so I decided to make an alert device.
And a security alarm is a system designed to detect intrusion.
We used Tinkercad to design and simulate our device circuit.
We used The open-source Arduino Software (IDE) to write code and upload it to the board.
We used Arduino to read signals from a ultrasonic sensor using Code Blocks.
USB 2.0 Printer Cable - A-Male to B-Male Cord
We used a USB 2.0 Printer Cable - A-Male to B-Male Cord as a voltage source.
We used red LED to present police light.
We used RGB LED to use blue to present police light.
We used piezo buzzer to make police sound.
We used ultrasonic sensor to measure the distance.
Resistors to reduce current flow to LEDs
We used MM wires to connect the circuit.
The function of this device is when something enter the range of the sensor (15 cm) the buzzer make police serine and LED make color Red and Blue.
Schematic View
I start add the components that I need.
I open the code section in tinkercad and add code blocks.
then I simulate the code.
Code blocks
Connect the components on breadboard with the Arduino.
Connect the buzzer in an analog pin, so I can control the Buzzer sound.
The final result
The smart circuit
I didn't use ultrasonic sensor before, so I search on Google "Ultrasonic sensor arduino".
I found a Tutorial on Arduino project hub website and how it works. link
Ultrasonic Sensor HC-SR04 is a sensor that can measure distance. It emits an ultrasound at 40 000 Hz (40kHz) which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Considering the travel time and the speed of the sound you can calculate the distance.
Ultrasonic sensor
Wiring diagram
Ultrasonic sensor
I can use Ultrasonic sensor on my project, when someone set under the pavilion, it move to drop shadow on him.
The best thing about this week is that I am learning about Arduino and the amazing things that he can do.
Arduino Uno