I decided to make something that combines parenting and gamification so I found that I can make a buzzer game with an ultrasonic senor to make mothers more aware if kids are dealing with electrical points
The source of inspiration is my background about the habits process
Software: I used Tinkercad to design and simulate the circuit before we use the real electronic components; To avoid any problems in the real circuit and avoid damage of the components.
Electronics components
Breadboard
ultrasonic sensor
peizo buzzer
arduino uno
Jumper wires
wiring and code blocks
introduction :
I used TINKERCAD to simulate the circuit before I started to Build the circuit on a breadboard in real.
The input is an ultrasonic sensor to detect distance of kids proximity from electrical points
The outputs are sound using piezo buzzer
The power is supported from arduino uno (5v) as the piezo and ultrasonic sensor can work
The circuit is connected as shown in simulation using wires and breadboard
the Arduino Uno takes orders through code
Details :
I tried to draw the circuit on tinkercad so I inserted the components ( Piezo buzzer, Ultrasonic sonsor, Arduino uno, breadboard, wires )
The wiring steps:
The ultrasonic sensor has 4 pins :
* vcc (connected to 5v arduino pin through breadboard),
* ground (connected to ground pin in Arduino through breadboard),
* echo(connected to digital pin 2) and finally
* trigger (connected to digital pin 3)
The piezo's positive side is connected to the digital pin 9 in arduino, and the other side is connected to ground of arduino through breadboard
The power source is 5v from arduino uno
using tinkercad to use code blocks to write orders to arduino and simulate the wiring
Explanation of code :
I used if condition to include the math block and output block, math block to include the input:
if the distance = or less than 20 cm the buzzer is working on 170 for one sec then stop for one sec ( to simulate the warning sounds ) ,
if the distance is more than 20 cm, the buzzer doesn't work.
I translate the code blocks through the option of blocks and text to text
wiring
The wiring steps:
The ultrasonic sensor has 4 pins :
* vcc (connected to 5v arduino pin through breadboard),
* ground (connected to ground pin in Arduino through breadboard),
* echo(connected to digital pin 2) and finally
* trigger (connected to digital pin 3)
The piezo's positive side is connected to the digital pin 9 in arduino, and the other side is connected to ground of arduino through breadboard
The power source is 5v from arduino uno
I copied the code through option blocks and texts, pasted and uploaded it in arduino
I didn't find the idea easily so I finish this task after inspiration of my peers and instructor
I didn't have enough knowledge about buzzer and ultrasonic sensor so i revised the portal tutorials in week6
After finishing real wiring and uploading the code, the buzzer don't stop, the instructor helps me to find the problem. The diagnosis was problem in some wires continuity, we removedthem and reconnect the circuit.
I learnt how to wire the circuits and the importance of each component so I can use it efficiently
I learnt how to use TinkerCAD to simulate circuits and use it write code using code blocks
the project of waving hand is so nice