Distant Necklace

by yinchongguang123 in Circuits > Arduino

188 Views, 1 Favorites, 0 Comments

Distant Necklace

35e1519c925320cbafb3993cd03958a.jpg

Today, coronavirus becomes a major concern worldwide and it is important for people to take precautions in the daily routine. Besides maintain personal hygiene, we also need to keep an appropriate distance from other people in the public area such as the crowded transport system because infection in many cases is caused by bodily contact. Therefore, we've decided to launch our new device to prevent closed physical contacts called 'Distant Necklace'. It is a fashion and functional product that enable you to detect people who are trying to approach you in a very short distance. It will make a sound to notify someone is approaching and the stick attached to the device would swing to warn others to keep a distance from you.

How to Make the Device

1) Arduino UNO board

2) Ultrasonic sensor

3) BreadBoard

4) 9V battery and battery connector

5) DC male power jack

6) A buzzer-HYDZ

7) Servo

8) knitting wool

9) Paper

Video

Distant Necklace

Programming

Code:

#define Tpin 11 #define Epin 10 //#define motor 7 #define buzz 8 #include Servo myServo; int pos = 0; int servoPin = 9; long timetaken; void setup() { pinMode(Tpin, OUTPUT); pinMode(Epin, INPUT); //pinMode(motor, OUTPUT); pinMode(buzz,OUTPUT); myServo.attach(servoPin); } void loop() { long x, dist; digitalWrite(Tpin, LOW); delayMicroseconds(20); digitalWrite(Tpin, HIGH); delayMicroseconds(10); digitalWrite(Tpin, LOW); timetaken = pulseIn(Epin, HIGH); dist = ((timetaken/2)*340)/10000; if (dist< 100) { //digitalWrite(motor,HIGH); digitalWrite(buzz,HIGH); myServo.write(90); } else { //digitalWrite(motor,LOW); digitalWrite(buzz,LOW); myServo.write(0); } delay(500);}

Circuit

ea57df44491e93c093e4153c9c8d27a.jpg

Reference and Credits

Reference: https://www.instructables.com/id/Glove-for-Blind/

Credits: Noah Yin, Lulu