Certified Turtle
Published

SmartEase

A toilet system designed to give elderly easy access and detects their day to day health factors

IntermediateFull instructions provided3 hours52
SmartEase

Things used in this project

Hardware components

Mini RFID Unit RC522 Module Sensor
M5Stack Mini RFID Unit RC522 Module Sensor
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
I2C Hub 1 to 6 Expansion TCA9548A Module
M5Stack I2C Hub 1 to 6 Expansion TCA9548A Module
×1
Light Unit with Photo-resistance
M5Stack Light Unit with Photo-resistance
×1
M5Stack ENV II Unit with Temperature Humidity Air Pressure Sensor
×1
M5Stack FIRE IoT Development Kit (PSRAM 2.0)
M5Stack FIRE IoT Development Kit (PSRAM 2.0)
×1

Software apps and online services

UiFlow

Story

Read more

Code

Main M5Stack

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

setScreenColor(0x222222)
pahub_0 = unit.get(unit.PAHUB, unit.PORTA)
env2_0 = unit.get(unit.ENV2, unit.PAHUB1)
rfid_0 = unit.get(unit.RFID, unit.PAHUB0)
servo_0 = unit.get(unit.SERVO, unit.PORTB)






label0 = M5TextBox(121, 0, "Text", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
label1 = M5TextBox(139, 97, "Text", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
label2 = M5TextBox(18, 0, "Weight:", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
label3 = M5TextBox(10, 97, "Body Temp:", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
label4 = M5TextBox(18, 34, ".", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label5 = M5TextBox(18, 128, ".", lcd.FONT_Default, 0xFFFFFF, rotate=0)


while True:
  if rfid_0.isCardOn():
    servo_0.write_angle(90)
    wait(1)
    servo_0.write_angle(0)
    if (env2_0.pressure) > 30:
      label0.setText(str(env2_0.pressure))
      label4.setText('You are overweight')
    else:
      label0.setText('Normal Body Weight')
    if (env2_0.temperature) > 37.5:
      label1.setText(str(env2_0.temperature))
      label5.setText("Would you  like to schedule a doctor's appointment?")
    else:
      label1.setText('Normal Body Temperature')
  if rfid_0.isCardOn():
    servo_0.write_angle(90)
    wait(1)
    servo_0.write_angle(0)
  wait_ms(2)

Secondary M5Stack

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

setScreenColor(0x222222)
light_1 = unit.get(unit.LIGHT, unit.PORTB)






label0 = M5TextBox(19, 112, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)


while True:
  if (light_1.analogValue) <= 500:
    label0.setText('Drink more water')
  else:
    label0.setText('Keep up the water intake')
  wait_ms(2)

Credits

Rhyan

Thanks to Lenzo, Abrar, and Dillon.

Comments