Bilal Ahmed
Published © GPL3+

Smart Glasses for Social Distancing

This device can be mounted on any frame of glasses and will help users to maintain a distance of more than 1 meter in the post corona world.

IntermediateFull instructions provided6 hours750
Smart Glasses for Social Distancing

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
TP4056 Lipo Charger Module
×1
0.96" OLED 64x128 Display Module
ElectroPeak 0.96" OLED 64x128 Display Module
×1
Lipo 3.7v 400 mA
×2

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Multitool, Screwdriver
Multitool, Screwdriver
Hot glue gun (generic)
Hot glue gun (generic)
Mini Side Cutter, 120mm Length with 25mm Jaw Capacity
Mini Side Cutter, 120mm Length with 25mm Jaw Capacity
Rotary

Story

Read more

Code

Social Distancing Glasses

Arduino
Go through the code and the comments for further instructions and understanding the code better :)
//////////////////////////////////////////////////////////////////////////////////////Bat-Lab///////////////////////////////////////////////////////////////////////////////////////////////////

#include <SPI.h>  
#include <Wire.h>
#include <Adafruit_GFX.h>  //These Libraries Needs to Be Installed First to run the code
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
#define pir A0

Adafruit_SSD1306 display(OLED_RESET);

void setup() {
  // put your setup code here, to run once:
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
pinMode(pir,INPUT);


display.setTextSize(2);      //Setting the text size 2 is recommended
display.setTextColor(WHITE);

display.setCursor(0,0); //Inorder to start a fresh cursor must be kept here

display.println("BatLab");   //Booting Screen Optional
display.display();
delay(2000);
display.clearDisplay();
display.display();

}

void loop() {
  // put your main code here, to run repeatedly:
display.setTextSize(2);
display.setTextColor(WHITE);

display.setCursor(0,0);

int a= digitalRead(pir);  
 
if (a>=1){    //Note the sensor is set to a range of 1 meter through the pre built potentiometer

display.setCursor(0,0);

display.println("Warning!!!GET AWAY!!!"); 
display.display(); // putting this after every display command is necessary otherwise it wont work
}
else if (a==0){

display.clearDisplay();
display.display();
    }
}

Credits

Bilal Ahmed

Bilal Ahmed

1 project • 1 follower

Comments