Miveil
Raspberry Pi alarm clock for childs, to let them know whether they can wake up or stay in bed.
The idea was to have a simple device that let my child know whether he can wake up or should stay in bed without a light always on, which is the case of all child alarm clock for sell. In action, it's pretty simple: a sonar listen for moves, when a move is detected, if the child should stay in bed, a (blue) led is turned on for 2 seconds, when he can wake up, another led (green) is turned on. Everyhting else is bonus (screen, animation).
Hardware
- Raspberry Pi/Pi Zero W
- Sonar:
HC-SR04
- LEDs:
- two leds with different colors or one rgb led
220Ω
resistor by led
- Screen:
- 0.96" oled screen
SSD1306
1kΩ
resistor for the screen
- 0.96" oled screen
Install OS
Use Raspberry Pi Imager to install the latest version of Raspbian Lite
.
Before writing data on the SD card, press on SHIFT+CTRL+X
to enter default options:
- set the
hostname
- enable
SSH
- configure
wifi
(remember that some Pi such as Zero does not support 5Ghz wifi)
Setup and start
miveil
runs on docker. After your OS fresh install, tun the following script to install deps, configure the Pi and start the container. It will create a docker-compose.yaml
file in home with the content of the sample given.
curl -s https://raw.githubusercontent.com/pierrecle/miveil/develop/setup.sh | bash -s
Development
On your Pi, install go:
sudo apt install golang
Then, edit files (with VSCode and Go add-on, everyhting is way easier) and run:
go run main.go
Todo
-
chore
/movemiveil.go
somewhere else -
feat
/implementhcsr04
usingperiph.io
-
feat
/clean up on quit (reset gpio etc) -
feat
/track when sonar is triggered -
feat
/handle RTCDS3231
-
feat
/make RTC optional -
feat
/make screen optional -
feat
/remove hard coded values- times
- pinning
- sonar maximum distance
- display duration
- animation
-
feat
/make different inputs configurable -
doc
/make a video -
doc
/draw pinning -
doc
/write technical documentation -
hardware
/make a PCB⚠️ help needed -
hardware
/make a 3D printable basic case -
chore
/handle releases with workflow etc -
chore
/write update process when not using portainer -
feat
/display current time after animation when can wake up -
feat
/create an OSD to display basic information (hostname, ip, wifi, current time) -
feat
/add a physical buttons to handle OSD -
feat
/create an API to change values -
feat
/handle wake up (morning where child should wake up at a precise time, for school etc) -
BONUS
/handle HUE lights to wake up -
BONUS
/front-end app -
BONUS
/HASS module