Chong Fangng rui haoHarith MuhammadAn Zhi
Created January 27, 2021

Covid Tracker

Covid Tracker is a device that aims to increase the efficiency of the checking-in process and also provide users with live data.

67
Covid Tracker

Things used in this project

Story

Read more

Custom parts and enclosures

Card reader

check in

temperature taker and crowd control

take patrons temperature and count the amount of patrons in the shopping mall

Schematics

Card reader

for check-in

temperature taker and crowd control

take the patrons temperature and warn the temperature screening staff if the number of patrons in the shopping mall has reached its limit

Code

M5 stack

Python
This is able make us count the number of people enter inside the mall with simulate taking temperature and able to see the data by entering the website
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
remoteInit()
setScreenColor(0x222222)
tof0 = unit.get(unit.TOF, unit.PAHUB2)
rgb0 = unit.get(unit.RGB, unit.PORTB)
pahub1 = unit.get(unit.PAHUB, unit.PORTA)
env21 = unit.get(unit.ENV2, unit.PAHUB0)


Count = None
level = None
bValid = None


label0 = M5TextBox(12, 180, "number of people", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(153, 140, "D-", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label2 = M5TextBox(16, 140, "Distance", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label3 = M5TextBox(153, 85, "T-", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label4 = M5TextBox(146, 35, "H-", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label5 = M5TextBox(13, 30, "Humidity", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label6 = M5TextBox(16, 82, "Temperature", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label7 = M5TextBox(152, 180, "0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label8 = M5TextBox(226, 44, "num", lcd.FONT_Default, 0xFFFFFF, rotate=0)

from numbers import Number



def buttonA_wasPressed():
  global Count, level, bValid
  Count = 0
  pass
btnA.wasPressed(buttonA_wasPressed)

def _remote_Number_of_people_inside_the_mall():
  global Count, level, bValid, tof0, rgb0, pahub1, env21 
  label8.setText('Hello M5')
  return Count
def _remote_level_o_risk():
  global Count, level, bValid, tof0, rgb0, pahub1, env21 
  label8.setText('Hello M5')
  return level
pahub1.select(2, 1)
pahub1.select(0, 1)
bValid = False
Count = 0
while True:
  label4.setText(str(env21.humidity))
  label3.setText(str(env21.temperature))
  label1.setText(str(tof0.distance))
  wait(1)
  if (tof0.distance) < 1000 and bValid < True:
    bValid = True
    Count = (Count if isinstance(Count, Number) else 0) + 1
    label7.setText(str(Count))
    speaker.tone(1800, 200)
  else:
    bValid = False
  level = 'low risk'
  if Count > 5:
    level = 'medium risk'
  else:
    if Count >= 9:
      level = 'high risk'
  if Count >= 555:
    rgb0.setColor(1, 0xff0000)
    speaker.tone(1800, 200)
  else:
    rgb0.setColor(1, 0x33ff33)
  rgb0.setColor(2, 0x00cccc)
  if (env21.temperature) < 18:
    rgb0.setColor(2, 0xff0000)
  else:
    if (env21.temperature) >= 31:
      rgb0.setColor(2, 0xffcc00)
  wait_ms(2)

# Describe this function...

# Describe this function...

Card reader

Python
Tap card on rfid reader and it will activate the hand sanitizer to dispense some hand sanitizing liquid, after the whole process of checking in, the will be a little beep sound to indicate that the whole process of checking in is over
from m5stack import *
from m5ui import *
from uiflow import *
import machine
import time
import unit

setScreenColor(0x222222)
servo0 = unit.get(unit.SERVO, (21,22))
rfid0 = unit.get(unit.RFID, unit.PORTA)



PWM0 = machine.PWM(26, freq=50, duty=3, timer=0)


label0 = M5TextBox(39, 71, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(52, 105, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)


while True:
  label0.setText(str(rfid0.isCardOn()))
  if (rfid0.isCardOn()) == True:
    speaker.tone(349, 200)
    speaker.tone(392, 200)
    speaker.tone(440, 200)
    wait(0.25)
    speaker.tone(440, 200)
    wait(0.25)
    speaker.tone(440, 200)
    wait(0.25)
    speaker.tone(455, 200)
    wait(0.25)
    speaker.tone(440, 200)
    wait(0.5)
    speaker.tone(392, 200)
    wait(0.25)
    speaker.tone(392, 200)
    wait(0.25)
    speaker.tone(392, 200)
    wait(0.25)
    speaker.tone(392, 200)
    speaker.tone(440, 200)
    PWM0.freq(25)
    wait(1)
    PWM0.freq(15)
    wait(1)
  wait_ms(2)
  

Credits

Chong Fang

Chong Fang

1 project • 0 followers
ng rui hao

ng rui hao

1 project • 0 followers
Harith Muhammad

Harith Muhammad

1 project • 0 followers
An Zhi

An Zhi

10 projects • 5 followers

Comments