Bala VikneshDylan ChuaJamesTmgJane
Published

Automatic Fire Door System

This automated door system activates to facilitate emergency evacuation.

IntermediateShowcase (no instructions)Over 2 days70
Automatic Fire Door System

Things used in this project

Story

Read more

Schematics

FlowChart

Code

EEP Project Code

Python
from m5stack import *
from m5ui import *
from uiflow import *
import time
from servo import Servo
import unit

setScreenColor(0x972f4c)
env2_1 = unit.get(unit.ENV2, unit.PAHUB0)
servo_2 = unit.get(unit.SERVO, unit.PORTC)
rfid_1 = unit.get(unit.RFID, unit.PAHUB5)
pahub_1 = unit.get(unit.PAHUB, unit.PORTA)
light_1 = unit.get(unit.LIGHT, unit.PORTB)






label0 = M5TextBox(10, 56, "Temperature", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(149, 99, "Luminous", lcd.FONT_Default, 0xFFFFFF, rotate=0)
line0 = M5Line(M5Line.PLINE, 11, 77, 81, 77, 0xFFFFFF)
label2 = M5TextBox(110, 99, "Text", lcd.FONT_Default, 0xffffff, rotate=0)
label3 = M5TextBox(110, 55, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
F = M5Title(title="Fire Detector", x=3, fgcolor=0xFFFFFF, bgcolor=0x0000FF)
label4 = M5TextBox(27, 99, "Light", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label5 = M5TextBox(149, 56, "Degree", lcd.FONT_Default, 0xFFFFFF, rotate=0)
title0 = M5Title(title="Title", x=3, fgcolor=0xFFFFFF, bgcolor=0x0000FF)


while True:
  F.show()
  label3.setText(str(int((env2_1.temperature))))
  label2.setText(str(int((light_1.analogValue))))
  label0.setText('Degree')
  label1.setText('Luminous')
  if (light_1.analogValue) >= 800 and (env2_1.temperature) >= 20:
    speaker.tone(1800, ((light_1.analogValue) < 800 and (env2_1.temperature) < 20))
    servo2 = Servo(22,50,500,2500,180)
    servo_2.write_angle(90)
  elif rfid_1.isCardOn():
    servo_2.write_angle(90)
  else:
    wait(5)
    servo_2.write_angle(180)
  wait_ms(2)

Credits

Bala Viknesh
1 project • 3 followers
Contact
Dylan Chua
1 project • 1 follower
Contact
JamesTmg
0 projects • 1 follower
Contact
Jane
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.