Skip to content

the splitFlapClockRadio is an old stylish, classic alarm clock with up to date features, such as automatic time adjustment, weather forecast, air quality sensors, FM radio or Spotify playback.

Notifications You must be signed in to change notification settings

iz2k/splitFlapClockRadio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

splitFlapClockRadio


Table of contents


The splitFlapClockRadio is an old stylish, classic alarm clock with up to date features, such as automatic time adjustment, weather forecast, air quality sensors, FM radio or Spotify playback. This is an updated version of the Flip-Clock, with slight modifications on the split-flap mechanics and integrated electronics. This device has been designed for DIY hobbists and can be manufactured for 100$ BOM.

Outside Inside
IMG_20210209_083904 IMG_20210208_174947 - copia

The splitFlapClockRadio features the following characteristics:

  • Local time and weather on 3D printed split-flaps.
  • 2W I2S Class-D Stereo Amplifier
  • FM radio
  • Spotify
  • Air Quality measurements (eCO2 and TVOC)
  • 32 x RGB LED array light
  • Spoken weather forecasts (openWeatherMap + TTS)
  • Volume and Media control rotary encoder wheels
  • Powered by a Raspberry Pi 3A+

The project is divided in four main sections: 3D design, electronics hardware design, split-flap controller MCU firmware (C++) and main software (Python backend + Angular frontend).

DIY brief

  • Print 3D parts
  • Manufacture PCB (<20$ with JLCPB)
  • Populate PCB with Hot Air Gun
  • Flash MSP430 MCU
  • Set-up fresh RaspberryPiOS Lite SD card (tutorial)
  • Install splitFlapClockRadio barebone: wget -O - https://raw.githubusercontent.com/iz2k/splitFlapClockRadio/master/sw/shInstall/barebone.sh | bash
  • Reboot and enjoy!

3D design

SplitFlapDigit

Each split-flap digit consists of a support structure with two bearings. The axle is placed inside the bearings holding two flap holders. All the flaps are mounted within those holders. The movement of the digit is achieved with a stepper motor and two gears. A reflective IR sensor is used to detect falling flaps, and a hall sensor to synchronize the absolute position of the drum. image

In order to get numbers and weather icons painted into the flaps, custom stencils have been designed and printed. The stencil design is avaiable at iz2k/splitFlap-stencil repository. stencil

Cover

The cover consist on 3 main parts and 2 control wheels:

  • Floor
  • Top cover
  • Frontal
  • Volume wheel
  • Media wheel image
Front Right
IMG_20210209_083859
Front Left
IMG_20210209_083912
Rear
IMG_20210209_083929

Electronics hardware

The electronics hardware integrates the following components:

  • AC/DC converter
  • MSP430FR2476 MCU as splitFlap controller
  • 3 x ULN2003 stepper driver
  • 3 x OPB733 reflective IR sensor
  • 3 x DRV5055 hall sensor
  • 1 x Si4731 FM radio tuner
  • 2 x MAX98357 I2S audio amplifier (stereo)
  • 32 x WS2812-2020 RGB LED
  • Air Quality sensors: 1 x BME680 + 1 x SGP30/SGP40

splitFlapClockRadio_3D_Image

SplitFlap controller firmware

The firmware runs on a MSP430 MCU and controls the driver of the three integrated stepper motors. The firmware keeps track of the falling flaps based on the reflected IR detector and synchronizes every cycle based on a hall efect sensor. The MCU can be commanded through I2C bus using SMBUS commands.

Main Control Software

Tha main functionality of the clock is controlled by the Python backend. It controlls all the peripherals and makes the system work upon user interface with the rotary encoders or the orders triggered through the frontend.

The frontend is an Angular application that allows checking and modifying the current status and configuration of the system. It is accesible withtin the WLAN through a web browser ponting to the configured hostname of the Raspberry Pi.

Python backend

The backend is divided in different packages to control specific peripherals of the systems:

  • Alarm: controls activation of the configured alarms.
  • Audio: controls the alsa sound system to trigger sounds and control volume.
  • Clock: controls the split-flap controller via SMBUS.
  • Config: controls the configuration file.
  • DB: interfaces a MariaDB database to log periodic weather and Air Quality data.
  • OsInfo: passes current OS infor to the frontend.
  • RadioTuner: controls the integrated Si4731 FM tuner IC
  • RgbStrip: controls the WS2812 RGB LED strip.
  • SpotifyPlayer: activates raspotify device and controls the playback of spotify via spotify-cli.
  • UserInterface: controls the Volume and Media rotary encoders.
  • WeatherStation: gets weather information through OpenWeatherMap API and controls Air Quality sensors.
  • WebServer: integrated Flask webserver to connect with the frontend via REST requests and/or websockets.

The backend is by default installed as a system service (autostart enabled), but can be stopped and launched manually to check its output.

sudo service splitFlapClockRadioBackend stop
sudo splitFlapClockRadioBackend

image

Angular Frontend

The frontend is also divided in different modules:

Dashboard

  • Quik view of current status image

Clock

  • Current time and alarm list image
  • SplitFlap calibration image
  • Alarm configuration image

Radio

  • FM radio tuner control and stored station list. image

Spotify

  • Playback control and stored media item list image
  • Authentication image
  • Music search image

Sensors

  • Air Quality sensor data and calibration. image

Weather

  • Weather data, location configuration and API keys. image

Historic

  • Logged weather and Air Quality data image

About

the splitFlapClockRadio is an old stylish, classic alarm clock with up to date features, such as automatic time adjustment, weather forecast, air quality sensors, FM radio or Spotify playback.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published