Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Keita Kaneko
Published

Portable Automatic Faucets Using M5StickC for COVID-19

Using the M5StickC, we developed a product that allows you to wash your hands without touching the device.

BeginnerFull instructions provided1 hour1,163
Portable Automatic Faucets Using M5StickC for COVID-19

Things used in this project

Hardware components

M5StickC ESP32-PICO Mini IoT Development Board
M5Stack M5StickC ESP32-PICO Mini IoT Development Board
×1
M5StickC PIR HUT
×1
Mini 3A Relay Unit
M5Stack Mini 3A Relay Unit
×1
water moter pomp
×1

Story

Read more

Code

main

MicroPython
from m5stack import *
from m5ui import *
from uiflow import *
import time
import hat
import unit
import hat

setScreenColor(0x111111)
relay1 = unit.get(unit.RELAY, unit.PORTA)

hat_pir0 = hat.get(hat.PIR)



label0 = M5TextBox(26, 67, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)


relay1.on()
while True:
  if 1 == (hat_pir0.state):
    relay1.on()
  else:
    relay1.off()
  wait_ms(100)
  wait_ms(2)

Credits

Keita Kaneko

Keita Kaneko

2 projects • 1 follower
Embedded engineer. Started electronics after seeing work at MakerFaire Kyoto in 2019.

Comments