loading

This is the second (and final) iteration of my office bitcoin price ticker. The concept is simple. Every ten minutes the current price and trading volume for bitcoin is pulled from the Interwebs, parsed and then displayed on a wide led matrix.

Here is my parts list:

  • 1 x Arduino Yun (I don't think they make this anymore, but I had it already. Would probably have been easier with a more up to date board (feather?)).
  • 1 x Adafruit Panel Mount 2.1mm DC barrel jack ( https://www.adafruit.com/products/610)
  • 1 x 5V 2A (2000mA) switching power supply (https://www.adafruit.com/products/276)
  • 6 x Adafruit 16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Blue LEDs (https://www.adafruit.com/products/2039)
  • 2 x 100K potentiometers and some chrome knobs from the closing sale of our local Radio Snack :-(.
  • Some hookup wire and an oak board.
  • An on/off switch.

Step 1: Make a 96x8 Matrix Out of Six 16x8 I2C Matrixes

For the bitcoin price information to be readable and scroll along like a stock ticker, I wanted a wide matrix for display. Just one or two 16x8 matrixes would not do!. Fortunately, you can have many small (16x8) matrixes controlled via I2C. On the back of each matrix a unique I2C address can be set via a solder joint on the back of the matrix: See https://learn.adafruit.com/adafruit-led-backpack/c...

In theory, you could have eight matrixes on one I2C connection (I used six). Just place your small matrixes next to each other, work up a little program to make them function like one matrix, and you should be off and running. But alas, when you put these smaller matrixes together, there is a big gap between them.

However, one end of the 16x8 matrix doesn't have any essential circuits and can be cut off with a cutting wheel on a Dremel tool. I did this to five of the matrixes and which allowed the matrixes to be lined up very close. After testing each matrix to make sure it worked, I used super glue to join the matrixes together. You don't want to find out after you have superglued them that there is an issue with your wiring!

I also glued several posts onto the matrixes to support them. Later I'll make some holes in my mounting board to accept these stands. If you have some other form factor that you want to use, then you can make whatever accommodations you want.

I wired up the connections on the back of the matrixes in parallel. I then wired the 96X8 matrix to an Arduino Uno to test the large matrix. NOTE: Don't try to power the large matrix from the Arduino. I didn't calculate the power draw but I imagine it will be way too much for the Arduino.

To test, I just wired the SDA on the matrix to pin Analog 4 on the Arduino, and the SCL to Analog 5 on the Arduino. (I used an Uno to test, and a YUN on the final board. The pins are different on the YUN.)

Below is the program I came up with to display a string on the large matrix. There is probably a more elegant way to make all the matrixes work together, but this made sense to me. What I am doing is setting an offset for each 16x8 matrix based on their location in the 96x8 matrix. So each matrix will be displaying the string all the time, but as the string starts on the right side of the large matrix, the smaller matrixes are offset so that they are displaying the string at a position "off screen". Eventually, they will work their way up to the start of the string. The position is updated each time through the loop (via updateTicker()). When the message has scrolled off the screen (xposition =17) then the whole things starts over. I used the comparison of milliseconds to trigger the updates since I will want to be doing other stuff between updates (such as pulling the updated bitcoin prices, adjusting brightness, etc.). If I used a wait, the microprocessor would not be able to go do "other stuff."

If my explanation doesn't make and sense, hopefully the code does!

/*************************************************** 
  This is a library for our I2C LED Backpacks

  Designed specifically to work with the Adafruit 16x8 LED Matrix backpacks 
  ----> <a href="http://www.adafruit.com/products/2035"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2036"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2037"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2038"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2039"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2040"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2041"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2042"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2043"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2044"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>
  ----> <a href="http://www.adafruit.com/products/2052"> <a href="http://www.adafruit.com/products/2035"> http://www.adafruit.com/products/2035
</a>
</a>

  These displays use I2C to communicate, 2 pins are required to 
  interface. There are multiple selectable I2C addresses. For backpacks
  with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
  with 3 Address Select pins: 0x70 thru 0x77

  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution

 ****************************************************/

#include 
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_8x16matrix firstmatrix = Adafruit_8x16matrix();
Adafruit_8x16matrix secondmatrix = Adafruit_8x16matrix();
Adafruit_8x16matrix thirdmatrix = Adafruit_8x16matrix();
Adafruit_8x16matrix fourthmatrix = Adafruit_8x16matrix();
Adafruit_8x16matrix fifthmatrix = Adafruit_8x16matrix();
Adafruit_8x16matrix sixmatrix = Adafruit_8x16matrix();

long previousMillisTickerScroll = 0;        // for updating the ticker
long previousMillisupdatePrice = 0;        // for updating the price

int brightness = 20;//set inital brightness
int xposition = 17; //one row to the right of the start of the text
int scrollspeed =40; //set inital speed // How fast to scroll will adjust with a pot later
String lastmsg  = "";
String msg1 = "Hello World! This is a long test message to see how this works";
int msgStringLength = msg1.length();

void setup() {
   //set the addresses of the matrizes
   //A 70
//B 71
//C 72
//D 74
//E 77
//F 73
   firstmatrix.begin(0x73);  
   secondmatrix.begin(0x77);  
   thirdmatrix.begin(0x74);  
   fourthmatrix.begin(0x72);
   fifthmatrix.begin(0x71); 
   sixmatrix.begin(0x70); 
   Wire.begin();
    
   //see if we can put this in the setup
   firstmatrix.setTextSize (1);
   firstmatrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
   firstmatrix.setTextColor(LED_ON);
   firstmatrix.setRotation(1);
   
   secondmatrix.setTextSize(1);
   secondmatrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
   secondmatrix.setTextColor(LED_ON);
   secondmatrix.setRotation(1);
   
   thirdmatrix.setTextSize(1);
   thirdmatrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
   thirdmatrix.setTextColor(LED_ON);
   thirdmatrix.setRotation(1);
   
   fourthmatrix.setTextSize(0);
   fourthmatrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
   fourthmatrix.setTextColor(LED_ON);
   fourthmatrix.setRotation(1);
   
   fifthmatrix.setTextSize(0);
   fifthmatrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
   fifthmatrix.setTextColor(LED_ON);
   fifthmatrix.setRotation(1);
   
   sixmatrix.setTextSize(0);
   sixmatrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
   sixmatrix.setTextColor(LED_ON);
   sixmatrix.setRotation(1);
}



void loop() {
     
    unsigned long currentMillis = millis();
    if(currentMillis - previousMillisTickerScroll > scrollspeed) {
      previousMillisTickerScroll = currentMillis;   
      updateTicker();  
    }
}


void updateTicker(){

      msgStringLength = msg1.length();
      xposition = xposition-1;
      if (xposition <= -(64+(6*msgStringLength)))
         {
           xposition =17; //start over
         }

      firstmatrix.clear();
      firstmatrix.setCursor(xposition+80,1);
      firstmatrix.print(msg1);
      firstmatrix.writeDisplay();
      
      secondmatrix.clear();
      secondmatrix.setCursor(xposition+64,1);
      secondmatrix.print(msg1);
      secondmatrix.writeDisplay();
  
      thirdmatrix.clear();
      thirdmatrix.setCursor(xposition+48,1);
      thirdmatrix.print(msg1);
      thirdmatrix.writeDisplay();
      
      fourthmatrix.clear();
      fourthmatrix.setCursor(xposition+32,1);
      fourthmatrix.print(msg1);
      fourthmatrix.writeDisplay();
      
      fifthmatrix.clear();
      fifthmatrix.setCursor(xposition+16,1);
      fifthmatrix.print(msg1);
      fifthmatrix.writeDisplay();

      sixmatrix.clear();
      sixmatrix.setCursor(xposition,1);
      sixmatrix.print(msg1);
      sixmatrix.writeDisplay();

     // later we will use a pot to set the brightness and the speed of the scrol
  
      firstmatrix.setBrightness(brightness);
      secondmatrix.setBrightness(brightness);
      thirdmatrix.setBrightness(brightness);
      fourthmatrix.setBrightness(brightness);
      fifthmatrix.setBrightness(brightness);
      sixmatrix.setBrightness(brightness);
}

<p>Cool project!</p>
<p>Thanks!</p>
<p>Dude, this is awesome! Great work!</p>
Thanks!

About This Instructable

843views

10favorites

License:

Bio: Most days, I am an Assistant Teaching Professor at the University of Missouri and a small business owner with decades of experience in project management ... More »
More by JScottMO:Bitcoin Price Ticker Game Show Controller 1.0 RFID Stethoscope for Medical Sim 
Add instructable to: