Hello Everyone!
Want a fun way to track the prices of cryptocurrencies? Tired of checking the prices online? Why not get a device to do it for you!
In this tutorial I will show you how to build a device that connects directly to your WiFi and displays the latest price for multiple different cryptocurrencies. This device uses a library I wrote to interact with the CoinMarketCap.com Api.
I've designed this project to be as simple as possible, so you don't need to know how to solder or code, I will go through everything you need to build the device. And did I mention that the total cost of the parts for the build is less than $10?!
Check out the video to see what the device looks like when running or for more info on how to build.
Lets get to it!
Step 1: Parts RequiredFirst off what do we need for this project, thankfully not a lot! You only need an ESP8266 based microcontroller, a screen and some wires.
If you are not familar with the ESP8266, it's an awesome Arduino compatible board that comes with built in WiFi. I recommend the NodeMCU board and the OLED Display as they come with headers pre-soldered, but the project will run on any ESP8266 device and the code should be easily adaptable to whatever screen you have.
A micro USB cable is required for programming and powering this project, I'm going to assume you already have one as they come with everything! Nearly all Android phones came with them for the last few years, check the second image if you are not sure which type of cable is micro USB.
You can get everything you need off either Aliexpress or Amazon. Aliexpress will take about 2-3 weeks to arrive, but is about 1/3 of the price.
Aliexpress (Total cost ~$9):
Amazon.com (Total cost ~$27):
Amazon.co.uk (Total cost ~£25)
* Affiliate Links - I get a couple of cents from sales made through the links but it doesn't increase the price for you.
Step 2: Software SetupIf you have never used the ESP8266 or Arduino before, we will need to a little bit of software setup. I have a dedicated video for this. It's only 5 minutes long and goes through everything you need to setup.
If videos are not really your thing, check out lesson 2 of Becky Stern's Instructable IoT Class, it goes over everything you need as well. Before you move off this step you should be able to upload a simple sketch to your ESP8266 (such as the blink example mentioned in both the video and Becky's lesson)
Step 3: Getting the SketchWe want to program the ESP8266 with the software that it needs to run this project, but first we will need to get the sketch loaded into the Arduno IDE
Open the Arduino IDE and click File -> New In the new window that opens, click File -> Save As and name the sketch whatever you like ("crypto display" maybe?)
- Now open your browser and go to the following link.
- Select all the text at that link and copy it.
- Now back in the Arduino IDE, select all the code from the default sketch and delete it (you should have a blank sketch)
- Paste in the code you copied from the link
This is the main code that the project needs, we just need to install some required libraries and make some minor changes so it works for you, I'll cover both of these in the next steps.
Step 4: Installing the LibrariesThis sketch relies on some external libraries for it to run, we will need to install them before we can put the software on the board.
In the Arduino IDE, go to Sketch -> Include Libraries -> Manage Libraries
- In the search bar, search for the "Coinmarket", install the library by Brian Lough (hey, that's me :) )
- Search for "oled ssd1306", install the library by Daniel Eichhorn
- Finally search for "arduino json", install the library by Benoit Blanchon
You now have all the libraries you need to run the code, we just need to change a couple of things and we will be good to go!
Step 5: Configuring the SketchIf wanted, change the CURRENCY. This will change the price the cryptocurrency prices are shown in, for example if it's set to eur, the value will be displayed in euro and if its set to usd the value will be displayed in US dollars. Check the currency drop down on CoinMarketCap.com for supported values (just take the lower case version of it)
- In the Arduino IDE, scroll down to the section labeled "Configurations - Update these"
- Change the ssid and password to be the name and password of your WiFi network
- If you change the currency, you might also want to change the CURRENCY_SYMBOL, this is the symbol displayed beside the price. The Euro symbol didn't work for me, but the $ and the £ do.
Now scroll down the section of the code labeled "Holdings - Add your currencies here", to add new ones, do the following.
- Open CoinMarketCap.com
- Search for the coin you want to display and select it
- Take the value from the URL and use with the addNewHolding method.
- The currencies will display in the same order they are listed here
- I've tested up to 10 of these, if you want to try more you will need to update the MAX_HOLDINGS value in the configurations section.
Now all that's left to do is upload! Plugin in your board and press the upload button and your sketch should get uploaded.
Step 6: Wiring Up the DisplayNote: Unplug USB cable from the ESP8266 before starting this step, just to be on the safe side.
The screen should be wired up to the as follows:
Display Pins -> NodeMCU board
- GND -> G
- VCC -> 3V
- SCL(or SCK) -> D5
- SDA -> D3
If you are finding the table above hard to follow, check out the picture above. The Github page has some more closer pictures too.
WARNING! I have seen online that sometimes these displays have a the GND and VCC pins the other way around from my diagram, make sure that you always connect GND to G and VCC to 3V or you may damage your display
Step 7: Moment of Truth!Plug the USB cable back into the NodeMCU board, congratulations you should now have a working cryptocurrency display! I really like this OLED screen, its really crisp, even from pretty far away.Just to note here, the device doesn't need to be plugged into your computer anymore, it fetches data directly via the WiFi so it can be plugged into a standard phone charger or any other source of USB power.
Step 8: A Stand - the Right WayNow we will need a stand to hold our masterpiece. I'll show two different options for this.This way would be the more professional way. I made up a case to be printed out on a 3d printer. I am pretty terrible at 3d design, but I did my best!
You can find the files here.
Check the gif out above for assembly, but its pretty straight forward (although i did use blu tack, aka sticky tack, to hold it all together)
Step 9: A Stand - the Bodge WayBefore I got a 3D printer, I used to be so disappointed when I came across a project online that I wanted to make that required one. This is really a project where you can do whatever you like with it, an old box or lunch box would suit it perfectly.
The quickest and bodgiest solution I could come up was to get a popsicle stick, and put some blu tack up near one end. Stick the display to the blu tack, and add more on top to hold it down. And that's it! Check out the GIF for more detail
The screen remains upright which is all you really need.
Step 10: ConclusionHopefully you enjoyed this tutorial!
I had a lot of fun making this project and thought it would be an interesting challenge to make so that people who might not necessarily be makers (yet) could do it. From talking to people, soldering really does put some people off.
As always, if you have any questions please feel free to ask, I will do my best to help out.
For other ESP8266 related projects and info, check out my other tutorials or my YouTube channel.
Thanks!
Brian
Comments