ishaan1490mechatron
Published © MIT

Smart Mask

This is a project that goes on your mask and makes it smart helping you maintain your sanity and social distancing suggested by the guidline

IntermediateShowcase (no instructions)1,528
Smart Mask

Things used in this project

Hardware components

Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Buzzer
Buzzer
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Arduino UNO
Arduino UNO
×1

Story

Read more

Schematics

Smart Mask

This is a very special circuit built for a mask (preferably a N95) that transforms an ordinary mask to a smart mask which will help you maintain your sanitation and also the social distancing as per the guidelines.

Code

Smart Mask

Arduino
This is a very special circuit built for a mask (preferably a N95) that transforms an ordinary mask to a smart mask which will help you maintain your sanitation and also the social distancing as per the guidelines.
#include <LiquidCrystal.h>
int sensorvalue = 0;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

long readUltrasonicDistance(int triggerPin, int echoPin)
{
	pinMode(triggerPin, OUTPUT); // Clear the trigger
	digitalWrite(triggerPin, LOW);
	delayMicroseconds(2);
	// Sets the trigger pin to HIGH state for 10 microseconds
	digitalWrite(triggerPin, HIGH);
	delayMicroseconds(10);
	digitalWrite(triggerPin, LOW);
	pinMode(echoPin, INPUT);
	// Reads the echo pin, and returns the sound wave travel time in microseconds
	return pulseIn(echoPin, HIGH);
}

void setup()
{
	Serial.begin(9600);
  	lcd.begin(16,2);
  	lcd.setCursor(3,0);
  	lcd.print("Smart Mask");
  	delay(3000);
  	lcd.clear();
  pinMode(11, OUTPUT);
}

void loop()
{
	sensorvalue = 0.01723 * readUltrasonicDistance(13, 12);
	Serial.println(sensorvalue);
  	lcd.setCursor(0,0);
  	lcd.print(sensorvalue);
  	lcd.print(" cm");
	delay(500); // Wait for 500 millisecond(s)
	if (sensorvalue >= 200){
		digitalWrite(11, LOW);
      	lcd.clear();
      	lcd.setCursor(0,1);
      	lcd.print("You're Safe");
      digitalWrite(13, LOW);
	}
	if (sensorvalue < 200) {
		digitalWrite(11, HIGH);
      	lcd.clear();
      	lcd.setCursor(0,1);
      	lcd.print("Move back!!");
      digitalWrite(13, HIGH);
	}
}

Credits

ishaan1490mechatron
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.