
.
.
Social Distancing Monitor with Alarm, Arduino NANO and I2C LCD1602 Display
In times of the Coronavirus-Crisis (Covid_19), it might be GOOD to respect the 2 meters distance to avoid getting infected!!! But not everybody can estimate distances, nor are ALL persons respecting the 2 meters rule!!! So came the idea to build an easy to realize gadget, which measures the distance and gives an alarm when the 2 meters are not respected.
First of all, like usual, I was searching the internet to find out if there isn’t already such a project around. And YES, there is one; I found a tutorial with an Arduino MEGA and a LCD1602 ISP with provided code as well. Please check below:
This tutorial gave me the idea to start. Instead an Arduino MEGA, I used an Arduino NANO; and instead of an LCD1602 ISP, I used an LCD1602 I2C.
Thus meaning: it needs a bit to adjust the code in the sketch in the above mentioned tutorial and it’s LESS cabling, wiring needed to connect the I2C LCD1602 display.
WE played around already with I2C LCD1602 in my tutorial below, please check:
SO, here we go for the wiring… Below the wiring for the I2C LCD1602 with the Arduino NANO
:
.
Connecting the HC-SR04 Ultrasonic Sensor:
Connections to the Arduino NANO:
Vcc+ gets connected to + 5V
GND to GND
ECHO gets connected to PIN 10
TRIGGER gets connected to PIN 9
Connecting the Buzzer for the acoustic Alarm:
The + sign of the Buzzer gets connected to PIN 8 of the Arduino NANO and the other pin to GND!
Below you see the prototype with wiring.
.
.
The code
Here below see a preview of the Code:
The complete Code could get downloaded in “.doc” format below.
Download and open the document, copy it and bring it in a NEW Sketch of the Arduino IDE. Upload it to the Arduino Nano and have fun with it!
Ordering the necessary parts
.
Click image, please, to enlarge. |
|
|
![]() Click image, please, to enlarge.
|
Click image, please, to enlarge. |
|
All you need now is to put everything into a case. I was choosing a cardboard (recycling) 😉
.
Social Distancing Monitor
Click image, please, to enlarge. |
|
|
Social Distancing Monitor Click image, please, to enlarge. |
|
|
.
Stay tuned for next blog post(s) 😉
.
.
The author Gust MEES is ICT Course Instructor, ”Member of the Advisory Board” from “Luxembourg Safer Internet” (LuSI), BEESECURE, Official Partner (Consultant) from the Ministry of Education in Luxembourg, project “MySecureIT“, Official Partner from the Ministry of Commerce in Luxembourg, project “CASES” (Cyberworld Awareness and Security Enhancement Structure). The author was also a winner of an electronics contest (Germanic countries) in 1979 and got his project published in the “Electronics Magazine ELO”. |
.
.
.
.
.
.
.
.
.