No description
- Python 100%
|
|
||
|---|---|---|
| .gitignore | ||
| blink.py | ||
| button.py | ||
| CLAUDE.md | ||
| door.py | ||
| LICENSE | ||
| read_i2c.py | ||
| README.md | ||
| requirements.txt | ||
| sensor.py | ||
bathroom-timer
Problem: the kids take showers or are "on the can" for longer than 30min.
Solution: make an alarm that goes off when the door has been closed for 30min.
Hardware
- Raspberry Pi Model A+ v1.1
- ASAIR DHT20 temperature/humidity sensor (I2C)
- Magnetic door sensor (reed switch)
- 4-pin tactile push button (manual reset)
- Buzzer (alarm)
- CanaKit ribbon cable + breadboard GPIO adapter
Pinout
DHT20 (ASAIR, I2C) — pins left to right with label side facing you
| DHT20 pin | Label | RPi pin |
|---|---|---|
| 1 | VDD | 3.3V |
| 2 | SDA | GPIO 2 (SDA) |
| 3 | GND | GND |
| 4 | SCL | GPIO 3 (SCL) |
I2C must be enabled (dtparam=i2c_arm=on in /boot/config.txt). Device appears at address 0x38.
Door sensor (reed switch)
| Wire | RPi pin |
|---|---|
| Either wire | GPIO 23 |
| Other wire | GND |
Reset button (4-pin tactile)
The button straddles the breadboard center gap. Pins on the same side are internally connected; pressing bridges the two sides.
| Button side | RPi pin |
|---|---|
| One side (pin 1 or 3) | GPIO 19 |
| Other side (pin 2 or 4) | GND |
Buzzer
| Wire | RPi pin |
|---|---|
| + (positive) | GPIO 26 |
| − (negative) | GND |
Notes
Started with this kit: Huzzah! Adafruit.io Internet of Things Feather ESP8266 - WiFi Starter Kit
But I needed a clock to measure 30min, so I am now using an old, low-voltage RPI Model A+ v1.1.
Still considering the solder kit: Ladyada's Electronics Toolkit