pull down to refresh

Coinkite's blockclock is amazing. Blockclock inspired me to develop one using M5StickC IoT device for a cheaper price. Here is the result:
Follow the steps for your next DIY project
  • 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. Don't forget to replace coinmarketcap API key in the code.
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)
(this code does not format well on M5StickC Plus display)
The total cost of this project is not more than $30. It serves the purpose though it is not as beautiful as blockclock. I bought bitcoin for the rest of the cost of blockclock. Stack sats!!
I still don't understand why Bitcoin nodes don't display this as a default. Then it becomes a decorative item instead of a server that you put in the back of your house.
reply
Yup this is just a fun little project, a small piece of decorative item on your desk. It does not do much except displaying few BTC info every 3 mins or so. It is a very small microcontroller(esp32) with not much computing power.
reply
Super cool, would you mind if we reposted this on our site? Will obviously link to your original post
reply
Please feel free to repost it
reply
Thank you so much, we really appreciate it :)
reply
Your article is amazing. Thanks for the encouragement. Thanks again for letting me contribute.
reply
It's a pleasure, if you ever come up with cool things you want to share, we're happy to promote it for you or set you up as a guest author, we're all about pushing the grass roots movement
reply
Amazing!! Great work! I love it
reply
This is awesome! Keep sharing!
reply
Super cool! I’ve been eyeballing the m5 stick for a while (I collect a lot of microcontrollers with high hopes and mediocre follow through) and have resisted so far. I think this is gonna push me over the edge…
reply
I am happy to meet few microcontrollers enthusiasts here. I am also a big fan of M5 stacks, esp32 for various use cases. I must say a big thank you to Ben Arc. I love all of his work. His work inspired me and redirected me to experiment with microcontrollers for bitcoin.
reply
I really need to check out the esp32. I have a couple of reactive lighting projects using esp8266 and the extra horsepower and BLE in the 32 looks sick. Love love love seeing cool bitcoin embedded projects 😄
reply
Yeah, the horsepower of esp8266 is next to nothing. I love to see your lightning projects using esp8266. Please share if you can. But esp32 is a bit promising compared with esp8266. I wanted to check if esp32 can create a mesh lightning network with microchannels using neutrino. It is definitely possible with raspberry pi Pico
reply
That sounds dope
reply
Heh, exactly. I've had a couple of these for a while, and when I saw the matching model I finally pulled the trigger and managed to burn, erase, burn, save, download, erase, burn until I got it to work.
I'd like to make a couple of changes, like the background reflecting the usual green/red signalling, but there's a bit to learn before I can confidently do more than stare in awe at this little box with its wi-fi and capability.
reply
Color signaling is a great idea. If you come across any free API which provides price changes, please share.
reply
Doing good work here. :)
reply
Cool, tipped l33t sats for a l33t guide!
reply
Super cool! Love this project.
reply
How long does the battery last?
reply
Unfortunately, the battery is not good. Not more than 30 mins since I will have to keep the display on most of the time :(
reply