For all of my introvert homies I have come to you with a solution.
A social distancing alarm system to stay as alone as possible!
Just kidding.... my struggle has started since the beginning of 2020 AKA Corona virus, although I didn't suffer from severe symptoms, it really bothered me to lose my sense of smell and taste, and as we know there was no remedy for covid so we had to blame..... that's right social distancing.
Tinker CAD
Arduino IDE
Software:
Tinker CAD
Purpose: Design simulation for the electronic circuit
Arduino IDE
Purpose: Implement and upload the code on the actual circuit
Materials: Electronic components:
Adapter
Jumper wires
Buzzer
Breadboard
Ultrasonic sensor
LCD
Switch
Arduino UNO
As simple as it is, the concept here is represented with simplicity for a user-friendly interface.
Beginning with the Ultrasonic sensor that should indicate the distance approached to the selected spot, it shall determine whether it is a safe place that undergoes social distancing or not, if it is then a green LED will turn on and LCD displays "safe :)"
If it's not then a red LED will turn on, also a Buzzer for warning and finally the display will change to "Keep distance".
OUTPUT: 2 LEDs, Buzzer, LCD
INPUT: Ultrasonic sensor
Power supply: 5v adapter
AS FOR STEPS:
I choose a 5-volt power supply after I had checked the datasheet for each component.
I proceeded with the LCD, after checking its datasheet for wiring, I connected both SDA &SDL to two different analog pins in Arduino which leaves VCC for the common positive in my breadboard and GND for the common ground.
Then, I began to connect the ultrasonic legs: trigger to an analog pin of Arduino, trigger to a digital pin of Arduino, VCC for positive, and GND for common ground built in the negative line of my breadboard.
Finally, the buzzer is connected in two ways: one leg for a digital pin in Arduino through a 220-ohm resistor to protect it from high voltage, the other is for the common ground.
Additionally, connected 2 LEDs each leg to a digital pin in Arduino through a 220-ohm resistor to protect it from high voltage, the other is for the common ground.
So, how can I make that circuit understand what it's supposed to do?
The brain (Arduino) is controlled using coding; therefore, I used Code Blocks in Tinker CAD to control my chip.
CODING STEPS:
the on-start block is used at the beginning of the code for only once.
I used it to define my LCD I2C and sit it's operating states to turn it on.
In the same block, I also identified the pins connected to the Arduino for each LED.
Moving forward with the forever block (which is used continuously and repeatedly), I declared a variable for my sensor so that I can call back in any logical condition to indicate the targeted distance.
Finally, I built my if condition to set to states first one for a safe distance (far), the other one is for near distance which is dangerous so I set a buzzer for it, noting that both states have LED with different color and LCD AFOR different display.
I took adavantage from Tinker Cad's feature to convert the blocks into a C code to copy it and paste it in Arduino IDE to ypload it on my chip.
Later on. it was time to start creating the code blocks for the circuit logic.
Depending on only if.....slse condition, I was capable create the two required conditions.
Next step: I used the features of Tinker CAD to convert the blocks into a text code that is compatible with Arduino IDE to upload it on my actual circuit.
How can someone notice you from a far distance?
A) Scream & shout.
B) Run over them with your car.
C) Wave to them.
If you expected me to say it's the second one then you are wrong
It happens to be the last one.
Hence, me and my friendly team decided to create this waving female SpongeBob using srvomotor with aruino and cardboard.
Despite using Tinker CAD for simulation can be significantly easy and well organized, The blocks actually confused me a bit as I am more used to write a text code using an IDE.
Therefore, it started raining errors not in the code but in the simulation itself as the code skipped the first condition and went straight forward to the else condition,
after consulting the instructors in the trouble shooting channel on slack, I was able to detect the issue and fix it.
Solution:
Move the Ultrasonic read command from the on-start mode to the forever mode.
and also to insert the clear screen command for LCD to enable the LCD of changing displays depending on the distance indiacted by the Ultrasonic sensor.
Now I know more about real sizes for machines and how to create a virtual estimation for them on software tools such as Laser cut and Cura, not to mention to take in consideration the limitations of producution in terms of how much materials are consumed and production time.
Checking out the precise work of the printing machines was mind blowing as it was my first practical experience which made me start to consider myself as areal maker!
Title of Media