Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Muhammad KhairinintanAslamOng Ying Jie
Published

Smart Entrance System

A Smart Entrance System that notifies shop owners if someone has entered or exit a shop and allows authorized personnel to open the shop

BeginnerWork in progress224
Smart Entrance System

Story

Read more

Schematics

Block Diagram

Blockly code for Automated Door

Automatic Door Code

Blockly code for shutter

Shutter Code

Code

Automated Door

Python
from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
servo_0 = unit.get(unit.SERVO, unit.PORTA)
light_0 = unit.get(unit.LIGHT, unit.PORTB)






label0 = M5TextBox(87, 16, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
image0 = M5Img(87, 81, "res/default.jpg", True)


servo_0.write_angle(90)
while True:
  if (light_0.digitalValue) == 1:
    servo_0.write_angle(0)
    rgb.setColorAll(0x33ff33)
    speaker.tone(3000, 1000)
    label0.setText('Door Open')
    image0.changeImg("res/Tick.PNG")
  else:
    if (light_0.digitalValue) == 0:
      servo_0.write_angle(90)
      rgb.setColorAll(0xff0000)
      label0.setText('Door Close')
      image0.changeImg("res/cross.PNG")
  wait_ms(2)

Shutter Code

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

setScreenColor(0x000000)
servo_0 = unit.get(unit.SERVO, unit.PORTB)
rfid_0 = unit.get(unit.RFID, unit.PORTA)


i = None



label0 = M5TextBox(110, 66, "Text", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
image0 = M5Img(110, 114, "res/llock.png", True)
image1 = M5Img(110, 114, "res/uunlock.png", True)
rectangle1 = M5Rect(-22, 200, 365, 45, 0x1f1f1f, 0x000000)




servo_0.write_angle(0)
label0.setText('Shutter ')
while True:
  if rfid_0.isCardOn():
    image1.show()
    label0.setText('Access Granted!')
    rgb.setColorAll(0x33ff33)
    if btnA.isPressed():
      for i in range(90, -1, -4):
        servo_0.write_angle(i)
        label0.setText('Shutter closing...')
        wait(0.05)
      rgb.setColorAll(0xff0000)
      label0.setText('Shutter closed')
    else:
      if btnB.isPressed():
        for i in range(0, 91, 4):
          servo_0.write_angle(i)
          label0.setText('Shutter opening...')
          wait(0.05)
        rgb.setColorAll(0x009900)
        label0.setText('Shutter opened')
  else:
    rgb.setColorAll(0xffcc00)
    image0.show()
    label0.setText('No Access!')
  wait_ms(2)

Credits

Muhammad Khairin
1 project • 0 followers
Contact
intan
0 projects • 0 followers
Contact
Aslam
0 projects • 0 followers
Contact
Ong Ying Jie
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.