How to Build a Bitcoin/Cryptocurrency Price Ticker Using a Raspberry Pi

Tyler Tyler (291)
Total time: 60 minutes 

If you're like me and check cryptocurrency prices throughout the day, every day, then you'd probably benefit from a dedicated cryptocurrency price ticker. This will save you from having to pull out your phone to check prices on Ifttt, which always leads to undesired distractions. Plus it's just awesome.

This project uses a Raspberry Pi Zero WH (wireless, with pre-soldered headers), an LED Matrix Panel, and RGB Matrix Bonnet, and a few miscellaneous cables that I'll link to in the Tools and Materials section of this guide. It also requires a CoinMarketCap API account (free). Altogether this project costs just over $100, but you can definitely take some steps to cut costs. Time-wise it took me about 10 hours, but since I've done the leg work and written the software, it should only take you about an hour to assemble and configure (minus the time to print the case, if you choose to do so).

In this guide, you'll learn how to set up the LED panel, install the crypto-ticker library, and configure it to show the cryptocurrencies you're tracking. Let's get started!

Adafruit 64x32 RGB LED Matrix (5mm pitch)Adafruit 64x32 RGB LED Matrix (5mm pitch) ×1
Raspberry Pi Zero WHRaspberry Pi Zero WH ×1
Adafruit RGB Matrix BonnetAdafruit RGB Matrix Bonnet ×1
5V 4A switching power supply5V 4A switching power supply ×1
SD card, 32GB ×1
2x20-pin Male Header ×1
Small metric bolt and nut set ×1

Howchoo is reader-supported. When you buy through links on our site, we may earn a small affiliate commission at no cost to you.

The first step of every great project is to install Raspberry Pi OS. Fortunately, we've written a guide that shows you how to install Raspberry Pi OS on your Raspberry Pi. Follow the steps to flash Raspberry Pi OS on your micro SD card, then jump back to this guide to continue.

While you're installing Raspberry Pi OS, you will also want to configure Wi-Fi and enable SSH.

cryptocurrency ticker configure the LED panel

Hardware setup

In an effort to save space, I'm again going to refer you to the guide we've written that shows you how to use the LED Matrix Panel with your Raspberry Pi.

Refer to this guide if you need help setting up the LED panel hardware. Since we're going to use Docker to run the application, you won't need to install the dependencies yourself. So please use the above guide to get your hardware set up only.

What you need

For this step, you'll need the LED Panel, the RGB Matrix Bonnet, and the Pi Zero WH.

This is one area where you can save a little bit of money. We referred you to a reliable panel made by Adafruit. There are cheaper alternatives on Amazon if you're willing to experiment.

Optional case

Keep in mind that the 3D-printed case is optional. If you've got a 3D printer and want to give it a shot, great! It will certainly make the project look more professional.

Since the Raspberry Pi doesn't ship with a physical power button, you may want to add your own. This isn't required, but it is a good (and safe) way to shut down your Pi when you're not using it (like if your spouse gets tired of the Bitcoin price glowing at night).

We've written a solid guide that shows you how to add a power button to your Raspberry Pi. I'm linking to the guide here because we need to do some work before wrapping up the hardware portion of this guide.

If you're not going to add the power button, skip ahead to the next step.

Solder male header pins

The RGB Matrix Bonnet attaches to the entire GPIO header on the Pi, but it does expose some GPIO holes that you can solder pins or wires to. In this case, you only need to solder pins to the SCL and GND holes, but for simplicity, I soldered a 2x2 pin square that covers both of the pins I need (see the image below).

RBG Matrix Bonnet 2x2 pins

Drill a hole in the case

If you're not using a case, you can skip this piece and just let the button dangle! But if you're using the case we recommended, you'll need to drill a 1/2" hole to attach the power button. Again see the image for details.

The location of the button doesn't matter as long as you've got male-to-female jumper cables to extend the leads to the Pi. I put my power button on the Pi-side at the very top.

It's worth noting at this point that the power button we sell does not fit in the hole that the case provides. If you'd like to buy a smaller button, you can skip drilling the hole. But I do recommend using the power button we sell because it comes from a reputable source and you get to support your favorite DIY site :)

Pi power button mounted to the LED panel case

Connect to the leads to the bonnet

When you're ready to close up the case, attach the leads (or the jumper wires) from the button to the SCL and GND pins on the bonnet.

If you're using the case, now is the time to secure it. To do so, you'll need to place the panel face down. Then drop two M3 nuts into the brackets on each side of the panel.

Now place the case on top of the panel, and use the M3 screws to secure it.

CoinMarketCap API sign up screen

In order to get up to date price data, you'll need access to a reliable cryptocurrency data API. For this project, I chose to use CoinMarketCap because it has a good free version. To get what you need for this project, simply sign up for the free version at https://coinmarketcap.com/api/ and copy the API key that is automatically created for you.

A note on API usage limits

The CoinMarketCap API measures usage in terms of credits and the limits are daily. For this project, a single API request costs a single credit, and the free version gives you 333 credits per day. This would allow you to make one request every five minutes or so.

If you need more up-to-date data, I'm sure CoinMarketCap wouldn't mind you upgrading to increase your limits :)

Now it's time to log in to your Pi and install the software. To begin, you'll need to open your Terminal application and SSH into your Raspberry Pi.

ssh pi@raspberrypi

If you've got multiple Pi's on your network, or the hostname doesn't work for some reason, you'll need to find your Raspberry Pi's IP address and use it instead.

Next you need to install Docker on your Pi. To install Docker, run the following:

curl -sSL https://get.docker.com | sh

Why Docker?

Docker allows us to run our application as a software container. For the purpose of this project, it allows us to define all of our dependencies in a Dockerfile and build the application as an image. This saves you from having to run a bunch of commands to install packages directly (among other advantages).

Git should already be installed on your Raspberry Pi, but if it's not you can install it using apt-get install git.

Clone the crypto-ticker repository with the following command:

git clone https://github.com/Howchoo/crypto-ticker.git

To run the application, you'll need to add your custom settings.env file. This file will be mounted onto the running container and provide the application with your API key, the cryptocurrency symbols you want to track, and a few other things.

You'll need to cd into the crypto-ticker directory:

cd crypto-ticker

Then use your favorite text editor to create the settings.env file and add the following:

CMC_API_KEY=<your coinmarketcap api key goes here>
SYMBOLS=BTC,ETH

You can customize the symbols you want to fetch. Simply go to coinmarketcap.com and find the ticker symbols for the cryptocurrencies of interest.

If you want to test this first on CoinMarketCap's sandbox API, you can add the following:

SANDBOX=true

You can also override the REFRESH_RATE, SLEEP, and a few other variables. But please refer to the repositories README.md file for the latest settings and default values.

With your settings.env file in place, you're ready to start the application. Run the following:

docker-compose up -d

This command will take a few minutes because it needs to read from docker-compose.yml, build the image, install the dependencies, and start the application.

It's worth noting that the ticker service in the docker-compose file specifies that we want to restart the container "always". This means that if the container dies, it will be restarted automatically. It also means that when the machine restarts, the container will start up as well. This is an easy way to run the crypto-ticker application on boot.

The application takes a few seconds to get started, but once it does you should see your crypto prices flash before your very eyes. The panel will scroll through the crypto symbols you specified in your settings.env file, and it will update prices every five minutes.

Attention developers

If you're a software developer and want to contribute to this project, I'd be happy to have you participate. Feel free to fork the repository and submit a pull request.

Here are some ideas for improvements:

  • Add cryptocurrency icons to the display
  • Add a "Loading" screen when the Pi is booting
  • Add some animation to transition between screens, maybe even allow the user to specify the transition

Share and comment

If you like this project, please share it on Facebook and Twitter. If you have any questions or feedback, feel free to leave a comment below.