Bitcoin Ticker With Graph

I made this based upon a project for a BTC price ticker, which obtains price information from coinmarketcap.com originally written by Brian Lough. He used the ESP8266, which is an Arduino compatible board that comes with built in WiFi. As he described, the project will run on any ESP8266 device and the code should be easily adaptable to whatever screen you have.

UPDATE October 2019:

I have added some more information on programming the Adafruit Huzzah ESP8266 board. It is also worth noting the latest ones come with a USB-C connector. In my photos I am using an older board that has serial pins and a separate board you temporarily plug onto it to program it. I have also added an alarm warning that alerts you (maybe) to a sudden spike or drop in the price relative to the price variability over the previous 10 to 15 minutes. I have found that this is what I am using the device for, as an early warning of a something going on.

Click here to open link to Brian Lough project.

Also see his Instructable here

Click here to open link

I used an Adafruit Feather HUZZAH with ESP8266.

I started with his code and then wrote the graphing part myself along with some code to turn a yellow price-rising or a red price-falling LED on or off. You need to follow his instructable very carefully, obtaining all the correct Arduino libraries to make this work.

  • I have also made an attempt to add indicators on the screen showing when the trend may be reversing direction in the very short term.
  • These inflection point markers take time to stabilise so ignore the first few readings. If the price is quite stable, every little wobble up and down creates an inflection point so this may need more work.
  • The vertical axis auto adjusts in height. If there is a sudden pump or dump in price such that the curve is in danger of going off top or bottom of the graph, the graph will restart from left with a re-adjusted vertical axis.
  • The reason I have done this is so that even when price is quite stable, small changes in price are always visible as a change in the curve shape.
  • The last 2 digits of the previous few prices are shown on the right, most recent at the top.
  • The percentage change x10 since the previous reading, taken approximately 2 min earlier is also displayed top right so you can spot sudden large alterations in the rate of change of the price.

Parts:

I used an Adafruit Feather HUZZAH with ESP8266

https://www.adafruit.com/product/2821

An example of a suitable OLED screen is this one (look for I2C 128x64 OLED display)

https://www.ebay.com/p/0-96-in-I2c-IIC-Serial-128x...

My wiring is exactly as described in the instructable by Brian Lough with the addition of two LEDs. Each of these needs to be wired in series with a 330 Ohm resistor to limit the current through each to 12mA or less, as this is the maximum the pins of the ESP8266 will deliver.

My enclosure is 3D printed and downloadable from Thingiverse. It is described as an Anemone Display Tentacle (NodeMCU v2 Display Case) by Marc Trems in Montreal. It needed some filing of the screen aperture to suit my display and it is available for download Here.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Annotated View of the Screen

Here is a better view of the screen showing these various features in action.

NOTE October 2019:

I have changed the screens lightly since this photo was taken (see image in title page).

The last 2 digits of the previous few prices are shown on the right, most recent at the top of the column of 4 values.

The percentage change x10 since the previous reading approx 2 min earlier is also displayed top right with the D (Deviation) in front of it so you can spot sudden large changes.

The value top right with Av in front of it is the Av-erage of the last few percentage change (x10) values. If the D value differs from the Av value by more than a trigger value of 0.8 or -0.8, then this means a fast change has suddenly happened. This will cause screen to flash, LED's to flash and an ALERT signal to appear on screen. This tells you to pay attention and trade or not as you want to.

Step 2: How Display Responds in Different Situations

Here are 4 images taken in different situations.

I may change the code to make the inflection point markers only appear if a change in price direction has been sustained for a longer period of time than currently is the case.

Step 3: OLED Screen

These are readily available and advertised as I2C 126x64 OLED display modules.

See the wiring diagram in the instructable by Brian Lough: https://www.instructables.com/id/Simple-10-Crypto...

In my code I used the Adafruit OLED library rather than the one Brian Lough used: https://www.instructables.com/id/Simple-10-Crypto...

Step 4: OLED Screen

The library can be seen, available for download, in the top of the screenshot of the listing in the Arduino search for libraries (open the Manage Libraries option within Arduino).

The two LEDs that show if price is rising or falling are each wired in series with a 330 Ohm resistor to limit the current draw of each one to less than 12 mA.

The red or "falling" LED has the pin next to its curved (+) side wired, via a 330 Ohm resistor, to Pin 12 of the Adafruit Feather HUZZAH with ESP8266 and the wire next to the flat side is connected to one of the GND pins.

For the "price rising" LED, the wiring is the same but pin 14 is used on the Adafruit Feather HUZZAH with ESP8266.

Step 5: Code

The Arduino code is attached to the next page.

Into this code you will need to insert your WiFi network name and your network key in the places shown in this image.

Step 6: Arduino Code

The code is attached here for upload to your device

Step 7: More Information on Loading Code Onto the Feather Huzzah

Additional notes on this:

To prepare the board to receive the code from the connected laptop, you have to press one button then, while holding it down, press the second one. It does not happen automatically. You have to do this, otherwise the program will not load correctly.

Step 8: Additional Features Added in October 2019

I have found that this device is useful to have on a desk or similar while working on something else. If the BTC price is quite steady, moving up and down only a very small amount, as shown by a relatively straight line on the graph, a sudden rise or drop is what catches your eye that a pump or dump in price is starting.

I have now added code to measure the running mean price variability over the last few readings, and then show an alert if there is a sudden deviation from this mean value by more than 0.08, a value I have come to by trial and error. I may adjust this again later.

When the price suddenly makes a big change, compared to variability of the previous few readings, the screen will flash white, the LED's will flash and an ALERT text will appear at base of screen.

It is up to you what action you take as a result but it will at least perhaps alert you something is going on or about to happen.

1 Person Made This Project!

Recommendations

  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

3 Discussions

None
Mr Joshua

13 days ago

Hi, great project, I love this! I have made it but cannot get anything on my display somehow.
If I run the code from the original project this is based on then it works fine (uses 1 different pin, 3 for data instead of pin 5).
The only difference I can see is I have an i2c display that only has 4 pins so there is no reset pin on the OLED for me, but I don't know how to work around this? Thanks very much