Skip to content

Instructions to build a pi-based digital clock showing the time, date, day of the week, local temperature and the current block of the Ethereum blockchain.

Notifications You must be signed in to change notification settings

chriskalv/ethClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

ETHclock

A digital table clock, built from a Raspberry Pi Zero, showing the

  • time
  • date
  • day of the week
  • local temperature AND
  • the current block of the Ethereum blockchain.

The code is entirely python-based and pulls time data from the internet, not from a RTC chip like in many other clock builds. Assembly of the device is really easy and even solder-free in case you have a Pi Zero WH model.



Finished clock (front) Finished clock (back)



Hardware

Setup

I. Data Preparation

  1. Create the API key that is needed in order to request the current Ethereum block:
    1. Head over to Etherscan.io and create an account.
    2. Go to My Profile --> API Keys --> Add, then enter a name and create the key.
  2. Create the API key that is needed in order to get the current temperature:
    1. Head over to OpenWeatherMap.org and create an account.
    2. Go to My API Keys, enter a name below Create Key and hit Generate.
  3. Convert the address, for which the temperature should be displayed, into longitude & latitude coordinates with help of LatLong.net.

You will need to paste both API keys and the data for langitude and latitude into the ethclock.py script later on, so you might want to already paste them somewhere you can find them again.

II. Device Work

  1. Flash Pi OS onto the microSD card (SSH enabled), assemble the hardware and make the device connect to your WiFi.
  2. sudo apt-get update && sudo apt-get upgrade -y
  3. Install the Adafruit SSD1306 library in order for your display to work. You can find the Instructions here.
  4. Create a new folder on the device and copy the font file data-latin_mod.ttf and the script ethclock.py into it.
  5. Make sure to edit permissions of the newly created folder and its files, so the script can later read, write and execute adequately (sudo chmod 777 -R /<yourdirectoryname>/ will do)
  6. Edit the Global Settings section at the top of ethclock.py:
    1. Paste your API keys from Etherscan and Openweather as well as your longitude/latitude data into the script.
    2. Change the displayed locale and temperature scale to your liking.
  7. Make ethclock.py autostart on boot. Some instructions on how this can be done are here.
  8. If you want to disable the green status LED on the Pi Zero board, which some people find annoying, you can find out how to do that in this post.

Case

  1. From the transparent acrylic case, cut off a little part with a Stanley knife in order to make room for the Qwiic SHIM breakout.
  2. Place a metal cooler onto the CPU. Any cooler will do and I'm pretty sure you do not really need one for this build.
  3. Shape two plastic hexagonal spacers with a Stanley knife and mount them to the bottom case screws, so the device can stand properly.
  4. Attach the display with a little bit of hot glue. Be careful not to damage it.

Obviously, this is just how I did it. There are endless possibilities on how to make your ETHclock look. By now, I've built a few of these with different displays and stands, so please don't feel like you have to "go by the book" here.

About

Instructions to build a pi-based digital clock showing the time, date, day of the week, local temperature and the current block of the Ethereum blockchain.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages