GET BITCOIN LIVE PRICE TTGO ESP32

Introduction: GET BITCOIN LIVE PRICE TTGO ESP32

About: Arduino fan!

In this tutorial we will learn how to get a current Bitcoin price in USD and EUR using a TTGO ESP32 and Visuino.

Watch the video.

(New Updated File for Download below!)

Step 1: What You Will Need

Step 2: Start Visuino, and Select the Arduino TTGO T-Display ESP32 Board Type

The Visuino: https://www.visuino.eu needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "TTGO T-Display ESP32" as shown on Picture 2

Step 3: In Visuino Set WiFi

Select TTGO T-Display ESP32 board and in the properties window expand "Modules>WiFi>Connect To Access Points

  • Click on the Connect To Access Points 3 Dots
  • In the AccessPoints window drag "WiFi Access Point" to the left side
  • In the properties window set SSID (name of your WiFi hotspot or router)
  • In the properties window set Password (password of your WiFi hotspot or router)
  • Close AccessPoints window

Select TTGO T-Display ESP32 board and in the properties window expand "Modules>WiFi>Sockets

  • Click on the Sockets3 Dots
  • In the Sockets window drag TCP/IP Secure Client (SSL) to the left
  • In the properties window set Host to: blockchain.info
  • Close Sockets window

Step 4: In Visuino Set Display

Select TTGO T-Display ESP32 board and in the properties window expand "Modules>Display>Orientation

Set Orientation to:goRight

Select TTGO T-Display ESP32 board and in the properties window expand "Modules>Display>Elements

Click on the Elements 3 Dots

In the Elements window drag Draw Bitmap to the left

In the properties window set Y to 20, Click on the Bitmap 3 Dots

In the Bitmap Editor Load the Bitcoin bitmap (picture 6) and close the Bitmap editor

In the Elements window drag Draw Text to the left

In the properties window set color to aclOrange, size to 2, text to USD, X to 150, Y to 10

In the Elements window drag Text Field to the left

In the properties window set size to 3, X to 100, Y to 35

In the Elements window drag Draw Text to the left

In the properties window set color to aclOrange, size to 2, text to EUR, X to 150, Y to 80

In the Elements window drag Text Field to the left
In the properties window set size to 3, X to 100, Y to 105

Close the Elements window

Step 5: In Visuino Add Components

  • Add "HTTP Client" component
  • Select and in the properties window set Host to api.coindesk.com
  • Click on the Requests 3 Dots
  • In the requests window drag "GET" to the left
  • In the properties window set URL to: /v1/bpi/currentprice.json
  • Close the requests window
  • Add "HTTP Client" component "Char To Text" component
  • Select "CharToText1" and in the properties window se Max Length to 2000
  • Add "Clock Generator" component
  • Select "ClockGenerator1" and in the properties window set frequency to 0.1
  • Add "Delay" component
  • Select "Delay1" and in the properties window set Interval to 2000000
  • Add "Split JSON Object" component

Step 6: In Visuino Parsing JSON

  • With the mouse right click on the "SplitJSON1" and in the menu click on the "Parse JSON Object.."
  • In the "JSON Object" window paste this sample code(avalible on https://www.coindesk.com/coindesk-api:


{"time":{"updated":"Sep 18, 2013 17:27:00 UTC","updatedISO":"2013-09-18T17:27:00+00:00"},"disclaimer":"This data was produced from the CoinDesk Bitcoin Price Index. Non-USD currency data converted using hourly conversion rate from openexchangerates.org","bpi":{"USD":{"code":"USD","symbol":"$","rate":"126.5235","description":"United States Dollar","rate_float":126.5235},"GBP":{"code":"GBP","symbol":"£","rate":"79.2495","description":"British Pound Sterling","rate_float":79.2495},"EUR":{"code":"EUR","symbol":"€","rate":"94.7398","description":"Euro","rate_float":94.7398}}}

  • Close the "JSON Object" window
  • "SplitJSON1" component will now create new pins

Step 7: In Visuino Connecting Components

  • Connect "ClockGenerator1" pin Out to "HTTPClient1" pin Clock and "Delay1" pin Start
  • Connect "HTTPClient1" pin Content to "CharToText1" pin In
  • Connect "HTTPClient1" pin to TTGO T-Display ESP32 > WiFi>TCP Secure Client1 pin In
  • Connect "Delay1" pin Out to "CharToText1" pin Clock and TTGO T-Display ESP32 > WiFi>TCP Secure Client1 pin Disconnect
  • Connect "CharToText1" pin Out to "SplitJSON1" pin In
  • Connect "SplitJSON1>USD>rate_float to TTGO T-Display ESP32>Text Field1 pin In
  • Connect "SplitJSON1>EUR>rate_float to TTGO T-Display ESP32>Text Field1 pin In

Note: you can also play with the other pins from "SplitJSON1" component

Step 8: Generate, Compile, and Upload the Code

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 9: Play

If you power the TTGO ESP32 module it will connect to the network and display the current Bitcoin price in USD and EUR

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu

Note: In the File Project when you open it in Visuino, change the WiFi settings (Access point and password) to your settings.

Step 10: Troubleshooting

In case you dont get any data:

  1. make sure that you are using the latest Visuino version
  2. check that you entered correct WiFi settings
  3. connect "SplitJSON1" pin "rate_float" to serial [0] pin, upload and click connect button and see if you get any data there (see attached pictures )

Be the First to Share

    Recommendations

    • Teach With Tinkercad Contest

      Teach With Tinkercad Contest
    • Fandom Contest

      Fandom Contest
    • Cheese Challenge

      Cheese Challenge

    4 Comments

    0
    marcop55
    marcop55

    11 months ago

    followed the instructions, same issues as who tried before me... I see the symbol but no data... no answer from the author, what a pity

    1
    StefanNeubacher
    StefanNeubacher

    1 year ago

    Thanks for the tutorial. Unfortunately it doesn't work.
    Downloaded the Finished Project File, changed the WiFi to my home network.

    Build & Upload = Success but Blackscreen.

    Tried the Troubleshoot section:
    "Connect "SplitJSON1" pin "rate_float" to serial (0) pin, upload and click connect button and see if you get any data:"

    This is the Output in the Terminal:
    Line1: #6$#24]#24e#24N<8}!~)))#28<#5M#28-#8%H!6#8z!$#24] M#30
    Line2: #20!*mFU]#24)+M#14#7#29$&
    Line3: U$F#6$#24]#24eB(#1^&UmzU]#24)VM#28-#8s=GU$FKR9#1@"-j#29%6NO#2#15gBy!#7#29%U5+1

    Anyone an idea? Blackscreen only :(


    (Link to my product
    https://www.amazon.de/gp/product/B093H3LCVP/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)

    Bildschirmfoto 2021-06-18 um 22.15.42.pngBildschirmfoto 2021-06-18 um 22.15.25.pngBildschirmfoto 2021-06-18 um 22.18.54.png
    1
    tiagodomingues
    tiagodomingues

    1 year ago

    I downloaded your project, changed the SSID and password, compiled and uploaded it to the board successfully, but the LCD does not show any information / image. I did the compilation via Visuino and Arduino IDE. The result is the same. I don't know what the issue is. My board works with other projects.
    visuino:8.0.0.2

    0
    cryptoseb61
    cryptoseb61

    Question 1 year ago on Step 8

    hello is it possible to change the btc to eth. and can we scroll through several crypto in a row