Project showcase
Facemask ATM + Reminder

Facemask ATM + Reminder

Fear not ol' forgetful geezers for I have a solution for the ever-existing problem in these pandemic time of forgetting face mask!!

  • 60 views
  • 0 comments
  • 2 respects

Components and supplies

Apps and online services

About this project

Story

Have you ever felt like an idiot when you walked out that door and forgot to bring a face mask with you? Yea I totally feel you. Not only does that provokes animosity towards you, but it also has a potential risk for your health, especially during this global pandemic and that you're living in the US.

With the grudges I've held against my idiotic self, I decided to build something to reminds me to wear face mask whenever I want to go outside. And that's when an idea of a facemask-reminder-slash-atm strikes me, and here I am present it to y'all.

How it works

So this is a fairly simple project, probably one of the simplest one out there, that I think anyone with a bit interest in hardware and happens to have an Arduino, as well as some other components and bit of cardboard, can build with ease.

It uses:

  • 4x4 Keypad
  • A Motion sensor
  • a 16x2 LCD
  • an Arduino Uno
  • a small breadboard
  • Jumper wires
  • Piezo Buzzer
  • Potentiometer

The idea here is that whenever you pass through it, it'll buzz so loud that it's irritating and makes you just want to smash it! (Don't) You just have to pick up a face mask to stop its annoying noise. The LCD and the Keypad is just for inputting and keeping track of the number of face masks there are. That being said, the optimal place to put this thing is near the door.

Wiring

Just follow the image below:

How to use it?

It is as easy to use as it sounds! You walk pass it, it buzzes, you grab the face mask and go away while the amount of face mask displayed on the LCD decreases by one.

When you first plug it in the power supply, the first thing to do is to input how many face mask you're planning to put in. To input, you simply hit the number buttons and hit D to enter. If you make any mistakes, just press A during the process to backspace.

If you input the amount of more than 100, it'll returns error and you have to redo it by hitting any key on the keypad.

When the first step is done (say 10 face masks), now the LCD is like this:

When you run out of face mask, the following will appear on your LCD:

As it stated above, you just need to press a random key button to start the inserting process again.

Pretty simple, eh?

Pictures of how I made the whole thing

Code

Face mask ATMArduino
#include <LiquidCrystal.h>
#include <Keypad.h> 

LiquidCrystal lcd(12,11,A4,A5,13,10);
const byte ROWS = 4; 
const byte COLS = 4;
const int pirPin = A3;
char keys[ROWS][COLS] = {
  {'7','8','9','C'},
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = { 2, 3, 4, 5 };
byte colPins[COLS] = { 6, 7, 8, 9 };
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

int fm = 0;

void setup() {
  Serial.begin(9600);
  lcd.begin(16, 2);
  pinMode(pirPin, INPUT);
}

void loop() {
  //case 1: when there is no face mask
  int fm_temp = 0;
  while(fm==0){
    lcd.setCursor(0,0);
    lcd.print("Number of mask:");
    lcd.setCursor(0,1);
    lcd.print("Max 100: ");
    //input number of face mask
    char key = kpd.getKey();
    if(key){
      if(key == '0') fm_temp = fm_temp * 10 + 0;
      if(key == '1') fm_temp = fm_temp * 10 + 1;
      if(key == '2') fm_temp = fm_temp * 10 + 2;
      if(key == '3') fm_temp = fm_temp * 10 + 3;
      if(key == '4') fm_temp = fm_temp * 10 + 4;
      if(key == '5') fm_temp = fm_temp * 10 + 5;
      if(key == '6') fm_temp = fm_temp * 10 + 6;
      if(key == '7') fm_temp = fm_temp * 10 + 7;
      if(key == '8') fm_temp = fm_temp * 10 + 8;
      if(key == '9') fm_temp = fm_temp * 10 + 9;
      if(key == 'A') fm_temp = fm_temp / 10;

      lcd.setCursor(9,1);
      lcd.print(fm_temp);
      lcd.print(" ");
      if(key == 'D'){
        //if number exceeds 100, reset fm to -1
        if(fm_temp > 100){ 
          fm = -1;
        }else{
          fm = fm_temp;
        }
        fm_temp = 0;
      }
    }
  }
  //case 2: when there is one or more face mask
  while(fm>0){
    lcd.setCursor(0,0);
    lcd.print("Current amount:");
    lcd.setCursor(0,1);
    lcd.print(fm);  
    lcd.print("             ");
    //algorithm for each time motion sensor detects something
    int pirStat = digitalRead(pirPin);
    if(pirStat == HIGH){
      Serial.print("I got chu");
      tone(A1, 100, 500);
      delay(5000);
      if(fm > 1){
        fm--;
      }else if(fm == 1){
        fm = -2;
      }
    }
  }  
  //case 3: when fm exceeds 100 and need to be reset
  while(fm==-1){
    lcd.setCursor(0,0);
    lcd.print("Invalid number!");
    lcd.setCursor(0,1);
    lcd.print("Any key to redo ");
    char key = kpd.getKey();
    if(key){
      fm = 0;
    } 
  } 
  //case 4: when fm runs out and needs to be refilled
  while(fm ==-2){
    lcd.setCursor(0,0);
    lcd.print("Out of facemask!");
    lcd.setCursor(0,1);
    lcd.print("Any key to input");
    char key = kpd.getKey();
    if(key){
      fm = 0;
    }
  }
}

Comments

Similar projects you might like

Medicine Reminder and Vending Machine

Project tutorial by Mihir Khara

  • 2,479 views
  • 4 comments
  • 32 respects

Social Distancing Reminder – Coronavirus

Project tutorial by Arca_Ege

  • 3,684 views
  • 2 comments
  • 12 respects

DIY Hand Wash Reminder

Project tutorial by Mukesh Sankhla

  • 1,105 views
  • 1 comment
  • 1 respect

MeDuino: Smart Automatic Medicine Reminder

Project tutorial by ashraf_minhaj

  • 4,908 views
  • 1 comment
  • 15 respects

2 Factor Authentication for ATM Machine Project

Project tutorial by Brijesh Singh

  • 2,455 views
  • 3 comments
  • 4 respects
Add projectSign up / Login