Build A DIY BlockClock

DIY Blockclock

Share this article

Once you get into bitcoin, a lot of your disposable income with probably go towards stacking sats, an admirable use case for your labour and value, but sometimes, you might feel a little high time preference FOMO and want to enjoy a little guilt purchase. This could be building a node, buying a pre-build node, hardware wallets, seed storage devices or other bitcoin accessories.

As the amount of bitcoin branded merchandise grows, there are certain products that have become rather popular in the space. The BlockClock by Coinkite has become one of the most sought-after bitcoin gifts you can give yourself or a fellow maxi; they look awesome. While they have more of a use case than any altcoin, but they do cost a pretty penny, a penny you could turn into potential sats.

Clocking in on Moscow time

The BlockClock has been around for a while but gained popularity during a remote testimony by then Twitter CEO Jack Dorsey. During the call, he addressed the United States Congress, and during that time, the BlockClock was visible behind him. Jacks’ blockclock was set to display the price of 1 USD in Sats, which at the time was 1952.

The strange time didn’t correspond to anything normies could understand at the time, which led to massive speculation on Twitter, with the most popular theory being Jack had his clocks set to “Moscow Time”.

The Blockclock set to Moscow time

If you’re keen on having a Moscow time display in your home, head to Coinkite’s Blockclock website and pick up a BlockClock or a BlockClock mini.

Create your DIY BlockClock

Now Coinkite’s BlockClock is an amazing display to have in your home; it looks cool and reminds you to stack sats, but not everyone’s got the fiat to spare or wants to risk shipping something like this to certain parts of the world.

Talking from personal experience, when shipping something to South Africa, you’ve always had to have a hope and a prayer that it would reach you and the bigger the item or more expensive, the lower the chance it will ever reach your doorstep.

Thankfully in bitcoin there is no single way to get a job done and the BlockClock has inspired some plebs to create cheaper homemade versions of their own, like the one developed by pleb @ajmotto who used an M5StickC IoT device to create his mini BlockClock for a fraction of the price.

Here is the result:

DIY Blockclock ready

Steps to setup your DIY bitcoin clock

  • Buy M5StickC from here. It costs around $13.95 without a shipping charge
  • Next, you need to flash it with UIFlow firmware using M5’s firmware burning tool. Please search on youtube for ‘how-tos’.
  • M5stack has hosted multiple videos on YouTube.
  • If your M5stickC is already flashed with UIFlow when you receive it, you can skip this step
  • Connect your M5StickC with your WiFi
  • M5stack has an online IDE to code and flash your device remotely.
  • Please connect your device with UIFlow by following the instruction.
  • Get your coinmarketcap API to get the BTC price. Coinmarketcap offers a few thousand API calls free for a month.
  • Create an API key in their portal.
  • Copy the following micro python program in the UIFlow interface and run it to flash the device.
  • Note: Don’t forget to replace coinmarketcap API key in the code.

Flashing the M5StickC

from m5stack import *
from m5ui import *
from uiflow import *
import urequests
import json


def setFont():
  #lcd.clear()
  #setScreenColor(0x006600)
  lcd.setRotation(1)
  lcd.font(lcd. FONT_Default)
  #lcd.font(lcd.FONT_Small)
  #lcd.setTextColor(0xffffff,0x006600)

def redBackDrop():
  lcd.clear()
  setFont()
  setScreenColor(0xf80b0b)
  lcd.setTextColor(0xffffff,0xf80b0b)
  
def greenBackDrop():
  lcd.clear()
  setFont()
  setScreenColor(0x009900)
  lcd.setTextColor(0xffffff,0x009900)

def displayContent(symbol,price, marketcap,block):
    lcd.print(str(symbol), 60, 5)
    lcd.print("Price : $" + str(price), 5, 20)
    lcd.print("M.Cap: $" + str(marketcap) + " Bn", 5, 35)  
    if str(symbol) == 'BTC':
      lcd.print("1$     : " + str(round(1/(price/100000000))) + " Sat", 5, 50)
      lcd.print("Block : " + str(block) + "", 5, 65)


def getAPI():
  result = dict()
  try:
    # Replace 'X-CMC_PRO_API_KEY' with your coinmarketcap API
    req = urequests.request(method='GET', url='https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC,ETH,LTC', headers={'X-CMC_PRO_API_KEY':'<replace your coinmarketcap API key here>','Accept':'application/json'})
    req1 = urequests.request(method='GET', url='https://mempool.space/api/blocks/tip/height')
    BTCPrice = round(json.loads((req.text))["data"]["BTC"]["quote"]["USD"]["price"],2)
    BTCMarketCap = round(json.loads((req.text))["data"]["BTC"]["quote"]["USD"]["market_cap"]/1000000000,2)
    BTCBlock = req1.text

    result['btcprice'] = BTCPrice
    result['btcmarketcap'] = BTCMarketCap
    result['block'] = BTCBlock

    
    return result
  except:
    setScreenColor(0xff0000)
    lcd.print("Can't fetch API",5,30)
    result['btcprice'] = 0
    result['btcmarketcap'] = 0
    result['block'] = 0
    result['ethprice'] = 0
    result['ethmarketcap'] = 0
    return result
   
while True:
  result = getAPI()
  redBackDrop()
  displayContent('BTC', result['btcprice'],result['btcmarketcap'],result['block'])
  wait(150)
  greenBackDrop()
  displayContent('BTC', result['btcprice'],result['btcmarketcap'],result['block'])
  wait(150)

You can also find the instructions on the following Github repo

Note: this code does not format well on M5StickC Plus display

Cut costs and stack sats

While the project won’t look as awesome as the BlockClock, you are spending a fraction of the price to create it. The total cost of this project is not more than $30, and it serves the purpose, and I am pretty sure it will inspire more elaborate setups in the future.

Plebs do tend to get rather creative when it comes to bitcoin.

So there you have it, a mini BlockClock you can give to friends and family or display around the house that won’t end up breaking the bank.

You can thank @ajmotto for his setup by sending him sats directly to his Lightning Address

⚡️ajmotto@stacker.news

Originally posted on Stacker News

Are you a DIY bitcoiner?

Do you like to take on bitcoin DIY projects? What have you built or customised so far to make your bitcoin experience better? Let us know in the comments below or share your DIY projects with us on Twitter; we’d love to check out your set-up and share it with bitcoiners worldwide to draw inspiration.

Disclaimer: This article should not be taken as, and is not intended to provide any investment advice. It is for educational and entertainment purposes only. As of the time posting, the writers may or may not have holdings in some of the coins or tokens they cover. Please conduct your own thorough research before investing in any cryptocurrency, as all investments contain risk. All opinions expressed in these articles are my own and are in no way a reflection of the opinions of The Bitcoin Manual

Related articles

You may also be interested in

Wumbo LN channels explained

What Are Wumbo Lightning Channels?

Bitcoin’s Lightning Network has reached significant milestones as it continues to provide bitcoin users with a scaling method ideal for micropayments and programmable payments. The

Sign up to our newsletter

Never Miss A Story

Get the latest bitcoin news, articles and resources.

Cookie policy
We use our own and third party cookies to allow us to understand how the site is used and to support our marketing campaigns.