Live Desktop Crypto Ticker

by ssiddharth in Circuits > Wireless

4019 Views, 53 Favorites, 0 Comments

Live Desktop Crypto Ticker

vlcsnap-2022-01-11-15h52m53s455.png

When you are trading Cryptos it is always itching to constantly look at the prevailing rate. I wanted a gadget that could display the live Crypto rate without constantly refreshing the browser.

I have incorporated a slideshow effect for better appeal. The first slide will be an image of the Crypto logo, the second slide will be the live Crypto trading rate and the last slide will be the rate of change, that is it shows whether the price of Crypto has decreased or increased and by how much.

My first thought was to 3D print a case for this project and then when I saw a plastic box on my table, decided to recycle the old plastic instead of adding to the global plastic woes by 3D printing a new one.

I have got all the files in the git project page. You can get access to all the related files by clicking here.

Supplies

Hardware:

  1. Wemos D1 Mini (any other NodeMCU will do as well).
  2. SSD1306 Monochrome OLED display.

Tools:

  1. Box cutter.
  2. Electrical tape.
  3. A plastic box (optional)

Getting the Enclosure Ready

vlcsnap-2022-01-11-15h45m01s459.png
vlcsnap-2022-01-11-15h45m56s947.png
vlcsnap-2022-01-11-15h46m39s121.png
vlcsnap-2022-01-11-15h47m38s386.png

My first idea was to add a Micro USB female connector to the enclosure and then connect the Wemos to it. But on second thought, decided to partially expose the Wemos's USB connector and RESET button outside the enclosure. This way, I need not take out the Wemos out of the enclosure for updating the code or re-purposing the setup for some other display based project. This will also allow me to RESET the Wemos when desired.

  1. First I inspected the plastic enclosure for any defects. While inspecting the enclosure, I saw that the plastic was partially translucent.
  2. The partial translucency in fact helped my cause. I placed the Wemos inside in the desired position and I could see it's outline from outside.
  3. With the Wemos's outline as reference, I used a piece of electrical tape to mark the dimensions of the cutout.
  4. In the last image, you can actually see the tape's border matching the Wemos's height.

Cutting Through

vlcsnap-2022-01-11-15h48m02s984.png
vlcsnap-2022-01-11-15h50m02s554.png
  1. Using a box cutter, I cutout the plastic to make room for the Wemos.
  2. Similarly, made a cutout for the OLED display on the plastic enclosure's cover.

Fixing the Wemos Tight

vlcsnap-2022-01-11-15h49m45s263.png

I slid the Wemos through the cutout on the side just enough to partially expose the USB connector and the RESET button of the Wemos.

To hold the Wemos tight in its place, used a fair bit of hot glue to affix the Wemos to its plastic enclosure.

Now it is ready to be tossed around.

Putting It All Together

vlcsnap-2022-01-11-15h50m52s607.png
Wemos SSD1306 Wiring_bb.jpg
Screenshot_6.jpg

For the OLED display, I used strips of electrical tape to hold it against the cutout on the plastic lid.

The OLED display uses I2C protocol for communicating with the Wemos. So its just four wires, VCC, GND, SDA and SCL. You can use attached wiring diagram as a reference for the connection.

Alternately, you can prepare your own OLED shield for Wemos and get rid of the wires. I have designed a simple board and have generated the Gerber file. You can download the Gerber from here. You can get your PCB printed using JLCPCB's PCB printing service. With their online Gerber viewer, you can verify the PCB design before ordering. Use this link https://jlcpcb.com/IAT for great discounts and minimal PCB fabrication costs.

Brining the Ticker to Life

Screenshot_5.jpg
Screenshot_1.jpg
Screenshot_2.jpg
Screenshot_4.jpg
Screenshot_3.jpg
vlcsnap-2022-01-11-15h52m24s477.png
This project uses Coindesk's API for getting the crypto rates. Its a free API, so I urge the users to use that with caution and fairly. Please do not bombard the server with multiple requests constantly. We may end up loosing the only free API we have.

With the disclaimer done, lets continue with the instructions.

Preparing the Image

Coindesk also has great images to go with their data. Replace the ISO name of the Crypto in this link https://downloads.coindesk.com/arc-hosted-images/eth.png with your desired Crypto's ISO value.

Couple of ISOs for popular Cryptos:

  1. btc for Bitcoin
  2. sol for Solana
  3. luna for Terra
  4. bch for Bitcoin Cash

Get more ISOs info here.

Once you have got the desired image, open that using Microsoft's Paint and resize it to 60x60 pixels. Save that as PNG itself. Please do not change the format.

Next you need a service to change the PNG to values that the microcontroller can decipher. Use this online PNG to XBM converter. The conversion will result in the creation of a XBM file that you need to download to your computer.

Time to download the Arduino code. Get your Arduino code from here. Mind the images.h file it is required as well.

Customize the Code

By default, the script or code or sketch is for displaying Bitcoin values. If you wish to replace that to some other currency, Press Ctrl + F on your keyboard and replace BTC with the desired ISO of your currency. For example, if you need Ethereum, replace BTC with ETH.

Mind the lettering case. For the PNG images it was lower case, but it is upper case here.

If you don't change the Boot logo in the images.h file, irrespective of the Crypto changed in the code, Bitcoin logo will be displayed by default.

Remember the XBM file that you just created using the first step ? Now Open the XBM file with Notepad or Notepad++ in Windows. Copy the values within the first curly "{}" brackets and replace the existing values in the images.h with that.

Set your Wifi SSID and Password in the place provided in the code.

By default, I have set the sketch to get the Crypto values every 2 minutes. This is to honor the Coindesk's free API. If you scroll through the code you should be able to figure the variable declaration. But please do not touch that, we may loose the only free and reliable API.

Now compile the sketch and upload it to the Wemos.

All Done

vlcsnap-2022-01-11-15h53m01s149.png
F54T8NHKY9E5965.png

Wow !! After the initial wait period of 2 minutes, we should have the Crypto values show up.