Skip to content

richrd/esphome-clock-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESPHome ClockOS

ESPHome ClockOS is my work in progress project for an ESPHome based desk clock with an OLED screen and rotary encoder. It is not only a clock and takes inspiration from 2000s era mobile phones.

Clocks

Contents

Hardware

I'm building my devices with a "freeform circuits" approach using 1.5mm copper wire for the frames and 1mm wire for the connections to the display, rotary encoder etc, but any other method works too as long as the minimum hardware requirements are met. So far I've had a good time with ESP32 C3 Super Mini boards due to their tiny form factor.

Here are the hardware components used, the required ones are marked with a checkmark.

  • ESP32 (I'm using C3 but any ESP32 should work)
  • Screen (128x64)
    • Tested SSD1306 and SSD1309
  • Rotary encoder
  • Beeper
  • Vibration motor
  • Joystick
  • A / B buttons

Software

ClockOS is built on the ESPHome platform.

Features

  • Clock and alarm
  • Games (Breakout and Snake)
  • Demos (examples of what can be done with graphics)
  • Floorplan (for controlling entities in the house)
  • Settings
  • Display timeout

Menu system

The default screen is the Clock, and clicking the encoder opens the main menu, below is the menu hierarchy which outlines the current features of the project:

[ Main Menu ]
├── Clock ⏵
│   ├── Default clock
│   ├── Analog clock
│   ├── Alarm ⏵
│   │   ├── Alarm [OFF]
│   │   ├── Hour [9.0]
│   │   └── Minute [30.0]
├── Games ⏵
│   ├── Breakout ⏵
│   │   ├── Play
│   │   └── Autoplay [OFF]
│   ├── Snake ⏵
│   │   ├── Play
│   │   ├── Speed [7.0]
│   │   └── Walls [ON]
│   └── Demos ⏵
│       ├── DVD (bouncing DVD logo screensaver)
│       ├── Spin (spinning ball animation)
│       ├── Cat & Yarn
│       ├── Text Input (WIP)
│       ├── Tokyo Bunny
│       ├── Bunny Wiggle
│       ├── Doodles
│       ├── Joystick test
│       └── Pixel paint
├── Sounds ⏵
│   ├── Mario
│   ├── Star Wars
│   ├── Mission Impossible
│   ├── Barbie Girl
│   └── ...
├── Control ⏵
│   ├── Turn off all lights
│   └── Floorplan
├── Settings ⏵
│   ├── Brightness [50.0]
│   ├── Screen timeout [2.0]
│   ├── Rumbole [ON]
│   ├── Sound [ON]
│   ├── Volume [2.0]
│   └── System ⏵
│       ├── Status
│       ├── WiFi [ON]
│       ├── Restart
│       └── Factory reset
└── Close

Games

Breakout

Breakout Game Screenshot

This is my take on Breakout / Arkanoid. It's played by moving the paddle with the rotary encoder. Features:

  • Level progression: more bricks, power-ups and speed on each level
  • Power-ups:
    • Extra life
    • Widen paddle
    • Wonky bricks: moves bricks around randomly
    • Multiball: spawn a new ball at the top of the screen above the paddle (max 10 balls simultaneously)
    • Shield which saves one ball from missing the paddle, can be stacked
    • Shooter: gives the paddle a shooter which shoots projectiles at the bricks damaging them, can be stacked once for a dual shooter
    • Question mark: shuffle all powerups randomly
  • Autoplay: the game can play itself

Code

Snake

Simple Snake clone, features:

  • Control snake direction by turning the head left & right with the rotary encoder
  • 4 pickups available at all times
  • Ability to change game speed
  • Ability to enable/disable walls
    • When disabled the snake warps to the other side when crossing the screen edge

Code

Credits

  • First of all, shoutout to the ESPHome for making this possible!
  • Peter Akimoto
    • Artistic supervision & motivation ❤️
    • Tokyo Bunny
    • Bunny Wiggle animation

About

ESPHome ClockOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages