制造商零件编号 U031-B
MINI RFID UNIT 2 WS1850S
M5Stack Technology Co., Ltd.
License: General Public License Arduino
* Thanks for the source code and project information provided by @Team Group 5: Yong Li Yan, Joy -, Shiva Dharani, ashley chan
Driving Question:
How do we design a device that monitors the overall environmental conditions of a warehouse that have adverse impacts on product spoilage?
Project Introduction:
Instead of practicing the manual way of inspection, our Warehouse Monitoring System aims to deliver readings of temperature, humidity, and the intensity of light levels so as to ease the monitoring process. If any of the temperature or humidity readings go beyond the required limit, an alert signal goes off. As an extra feature, it also monitors the presence of pests inside the warehouse.
Research Background:
•Hence, it is important to monitor the temperature, humidity, and intensity level of lights accordingly
•Sometimes, even small things such as the door not being closed properly results in warm air to come into a room with a fitted cooling system, causing spoilage of the products. Thus, it is important to have a constant look out for the readings and do the needful if they surpass the required values.
•Even in this modern era, the issue of rodents/pests tainting the sanitary conditions of the warehouse, persist. Roaming around and accidentally slipping into the huge silos, they contaminate the food products which then become unfit for consumption. By using chemical pesticides/aroma inside the warehouse, they may trigger allergic reactions to the employees and some chemicals inside these pesticides are unsafe for consumption.
Schematics
Overview Block Diagram
Flowchart 1
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
env3_0 = unit.get(unit.ENV3, unit.PAHUB4)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
light_0 = unit.get(unit.LIGHT, unit.PORTB)
T_Value = None
H_Value = None
M_temp = None
M_Light = None
M_Humidity = None
card = None
label0 = M5TextBox(7, 0, "Temp (Celsius) :", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(180, 0, "Humidity (%):", lcd.FONT_Default, 0xFFFFFF, rotate=0)
T = M5TextBox(7, 18, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
H = M5TextBox(180, 19, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
rfid = M5TextBox(30, 74, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label2 = M5TextBox(97, 48, "Light:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
img_T = M5Img(22, 100, "res/coolTemp.png", True)
L = M5TextBox(154, 48, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
img_H = M5Img(192, 100, "res/L_HMD.png", True)
# Describe this function...
def dosomething():
global T_Value, H_Value, M_temp, M_Light, M_Humidity, card
T.setText(str(M_temp))
T.show()
H.setText(str(M_Humidity))
H.show()
L.setText(str(M_Light))
L.show()
label2.show()
label1.show()
label0.show()
img_T.changeImg("res/coolTemp.png")
img_H.changeImg("res/L_HMD.png")
T_Value = 23
H_Value = 45
while True:
M_Light = int((light_0.analogValue))
M_Humidity = int((env3_0.humidity))
M_temp = int((env3_0.temperature))
card = str('e23c7312bf')
rgb.setColorFrom(6 , 10 ,0x33ff33)
if M_temp >= T_Value or M_Humidity >= H_Value:
if M_temp >= T_Value:
while M_temp >= T_Value:
T.setText('Abnormal Temperature')
rgb.setColorFrom(6 , 10 ,0xff0000)
H.hide()
L.hide()
label2.hide()
label1.hide()
img_T.changeImg("res/Hightemp.png")
speaker.tone(1800, 200)
speaker.setVolume(1)
rfid.setText('Scan card to disable alarm system!')
if (rfid_0.readUid()) == card:
rgb.setColorFrom(6 , 10 ,0x3366ff)
rfid.setText('Access Granted')
T_Value = 10000
dosomething()
if M_Humidity >= H_Value:
while M_Humidity >= H_Value:
H.setText('Abnormal Humidity')
rgb.setColorFrom(6 , 10 ,0xff0000)
T.hide()
L.hide()
label0.hide()
label2.hide()
img_H.changeImg("res/H_HMD.png")
speaker.tone(1800, 200)
speaker.setVolume(1)
rfid.setText('Scan card to disable alarm system!')
if (rfid_0.readUid()) == card:
rgb.setColorFrom(6 , 10 ,0x3366ff)
rfid.setText('Access Granted')
H_Value = 10000
dosomething()
else:
dosomething()
if btnA.isPressed():
T_Value = 23
H_Value = 45
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pir_3 = unit.get(unit.PIR, unit.PORTB)
rgb_3 = unit.get(unit.RGB, unit.PORTB)
label0 = M5TextBox(240, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label2 = M5TextBox(22, 7, "Pest status:", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
label3 = M5TextBox(175, 12, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
image1 = M5Img(58, 50, "res/pest2.png", True)
image1.changeImg("res/pest2.png")
while True:
label3.setText(str(pir_3.state))
if (pir_3.state) >= 1:
rgb_3.setColorFrom(1, 3, 0xff0000)
label0.setText('Pest Detected!')
image1.show()
else:
rgb_3.setColorFrom(1, 3, 0x33ff33)
label0.setText('Normal')
image1.hide()
wait_ms(2)