Multiple ssd1306 OLEDs (or similar) in an 'array'

HI,

Newbie alert.

I have bought a few ssd1306 OLEDs (so cheap - £3ish!).

I have successfully (easily) strung these together in a chain.

My question is, how would I start to think about getting a load of these (a few to start, but I'd really like to have LOTS of them - a few hundred!), but arranged so that each display makes up part of a larger picture - a video wall effectively.

  1. Would I need 1 MCU per display?

  2. Can I have more than one display attached to an Arduino, each displaying a different image?

  3. If I have to have one display/one Arduino, how would I go about controlling all of them so they keep in time etc?

Sorry, this is a vague question. I would just like some pointers to where I need to research.

Many thanks!

Any clues? Please..?

Most OLED are SPI. You do not normally daisy chain regular SPI..

Post a link to the actual displays you are using. Post the schematic. A pencil drawing is fine.

Post the code (simple). You should be able to have multiple SPI devices on the same bus. Each has its own chip-select line. I have not tried it but I would assume that u8glib will support multiple objects.

Regardless of what Ebay vendors say, most OLED displays require 3.3V logic.

David.

Thanks for responding David.

OK, as I said, got the 3 ssd1306s daisy chained:

code below is from Hari Wiguna (youtube - $4 Arduino OLED display - YouTube ).

It doesn't use U8Glib AFAIK -

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

I'm using pins A4 and A5 to connect to the OLED - is this SPI or I2C? I'm really new to this!

So, looks like I could add n more displays to the chain - presumably would have to add some more power down the line, currently the 3 displays are running from 5V out of the Nano.

What I'd LIKE to do is NOT daisy chain, but have each screen be part of a large virtual screen - a video wall sort of, so each screen would be displaying its own small part of a larger image.

If I'm running say 3 off of the same bus (again - not really sure what this means! New boy here), and I want say 50+ screens - I presume I would need some kind of 'master' Arduino to control them all (Lord of the rings style).

Any help would be appreciated!

// HariChord, 2015
// Playing with OLED Display
// Big thanks to AdaFruit for providing the wonderful libraries!

/*********************************************************************
* This is an example for our Monochrome OLEDs based on SSD1306 drivers
* 
* Pick one up today in the adafruit shop!
* ------> http://www.adafruit.com/category/63_98
* 
* This example is for a 128x64 size display using SPI to communicate
* 4 or 5 pins are required to interface
* 
* 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, check license.txt for more information
* All text above, and the splash screen must be included in any redistribution
*********************************************************************/

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


// I2C
#define OLED_RESET 5
Adafruit_SSD1306 display(OLED_RESET);

/* SPI
// If using software SPI (the default case):
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);




/* 
// Uncomment this block to use hardware SPI
#define OLED_DC     6
#define OLED_CS     7
#define OLED_RESET  8
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
*/

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2

#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{ 
 B00000000, B11000000,
 B00000001, B11000000,
 B00000001, B11000000,
 B00000011, B11100000,
 B11110011, B11100000,
 B11111110, B11111000,
 B01111110, B11111111,
 B00110011, B10011111,
 B00011111, B11111100,
 B00001101, B01110000,
 B00011011, B10100000,
 B00111111, B11100000,
 B00111111, B11110000,
 B01111100, B11110000,
 B01110000, B01110000,
 B00000000, B00110000 };

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

int nFrames = 36;

void setup()   {                
 Serial.begin(9600);

 // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
 display.begin(SSD1306_SWITCHCAPVCC);
 // init done

 // Show image buffer on the display hardware.
 // Since the buffer is intialized with an Adafruit splashscreen
 // internally, this will display the splashscreen.
 display.display();
 delay(1000);

 // Clear the buffer.
 display.clearDisplay();
}


void loop() {
 for (int frame=0; frame < nFrames; frame++)
 {
   HariChord(frame);
 }

 for (int frame=(nFrames-1); frame >= 0; frame--)
 {
   HariChord(frame);
 }
}

void HariChord(int frame)
{
 display.clearDisplay();
 int n = 7;
 int r = frame * 64 / nFrames;
 float rot = frame * 2*PI / nFrames;
 for (int i=0; i<(n-1); i++)
 {
   float a = rot + i * 2*PI / n;
   int x1 = 64 + cos(a) * r;
   int y1 = 32 + sin(a) * r;
   for (int j=i+1; j<n; j++)
   {
     a = rot + j * 2*PI / n;
     int x2 = 64 + cos(a) * r;
     int y2 = 32 + sin(a) * r;
     display.drawLine(x1,y1, x2,y2, WHITE);
   }
 }
 display.display();
}

You have an "I2C interface" version of the SSD1306. Note that most of the Ebay displays do not ACK I2C properly (if at all)

You appear to have four displays in parallel. i.e. all SDA lines are connected together.
In theory, you only have one I2C Slave active at any one time. But since your modules probably do not ACK, the Master has no idea what is going on.

It appears that all the modules are receiving the same I2C commands. I am surprised that they operate at all.

You can have an infinite number of SSD1306s using the SPI interface with different CS pins.
You can have two SSD1306s using the I2C interface by setting different Slave addresses.

Daisy-chained means that the output of one display is the input of the next display ...
Often used with SPI shift registers. Not possible with I2C.

David.

Thanks David.

Ah, OK, so in my setup above, the SSD1306s are NOT daisy chained, but in parallel, got it.

You say you're 'surprised that they operate at all' - is this because as you say they are not sending ACK (or acknowledgement (as I now understand it from wiki!) so the Arduino is quite happy to send data in ignorance of what's happening down the line, yes?

Are my displays 'unusual'? Is it unusual also that they re I2C not SPI? Most of the SSD1306s i've seen on eBay have SDA/SCL pins.

So... I can have any number of SSD1306s daisy chained on SPI. And with I2C, I could have only TWO slaves with different addresses - both showing different images?

Would it then be possible to have a set up with n number of MCUs and 2n number of displays?

The tricky bits then I guess would be to write some code to :

  1. split an animation into 2n number of 'pieces' and

  2. have them keep in precise time?

Is this a non-trivial project, even for someone who knows what they are doing? (it's all non-trivial to me at the moment!)

Thanks,

T

The I2C display version is just as common on Ebay as the SPI version.

These displays require 3.3V logic regardless of what Ebay tells you. However 5V I2C would be kinder to the electronics than 5V SPI.

No, even the SPI versions can not be daisy-chained. Nor would you want to.
I presume that you want N different images on N different OLEDs.

Easy with SPI. You just have N chip-select pins.
The I2C versions can only have two different Slave Addresses. So you only get 2 different pictures.
And the non-ACK I2C means that genuine I2C devices can't really use the same bus.

Be realistic. Do you want a wall full of OLEDs? Even a 4x4 matrix would cost you £48.
You could buy a 800x480 full-colour TFT screen for about £30.

David.

Great, thanks again David.

To answer your question - and respond to you admonition!

"Be realistic. Do you want a wall full of OLEDs? Even a 4x4 matrix would cost you £48.
You could buy a 800x480 full-colour TFT screen for about £30."

I AM being realistic. :slight_smile: This is for a commissioned installation, and the budget is ...generous. I'm not intending to use it as a monitor! :o

At £3 or so each, I can easily afford to create a ! matrix of 36x24 screens or more.

If I'm understanding right, I would use SPI (at 3.3v - that means using a level shifter?), but can I use any of the Digital pins on, say, a Mega 2560 which has lots of pins, and use a few (a lot) of Megas?

Then write code for each address to show a different image on each display?

Am I getting ANY of this right? :slight_smile:

You will not use a 5V Arduino for this. Choose an ARM with lots of GPIO.
You will still need several controllers. e.g. one controller for each 8x8 pane.

It is perfectly reasonable to experiment with an Arduino like a Due.

You will soon see what is practical.

David.

OK, ARM, lots of GPIO - The Due does look like it fits the bill... Why ARM particularly? Speed? GPIO?

Obviously I will do my research on these boards and others, but if you have any 'off the cuff' response regarding any of these boards...

Will a clone such as these eBay listings be OK?

eBay Search results for Arduino Due

http://www.ebay.co.uk/itm/DUE-R3-BOARD-SAM3X8E-32-BIT-ARM-CORTEX-M3-CONTROL-BOARD-MODULE-FOR-ARDUINO-AOYV-/381473424931?hash=item58d1968623:g:vY8AAOSwYlJW3x0a

http://www.ebay.co.uk/itm/UK-SainSmart-Due-Board-SAM3X8E-32-bit-ARM-Cortex-M3-Full-Compatible-for-Arduino-/301692224705?hash=item463e4204c1:g:3-AAAOxy2O1SW7ve

Or should I go for the 'official' version do you think? Any real difference?:

Official-Genuine-Arduino-Due-Atmel-AT91SAM3X8E

I'm using a Nano (clone) for the setup in the images above.

Purely for the look of the thing, I'd like to use something small, so, although I would need to use more of them as they don't have so many GPIO, would a Nano, Trinket, Arduinio Mini Pro, or even a Teensy 3.2 work with this idea?

Also, what about the Raspberry Pi Zero? ARM, but not many GPIO... I've got a couple or the 'normal' boards knocking around (a v2, and a B+ I think) , will be buying a Zero whenever the stock is there...

Any thoughts on the the
Texas Instruments ARM® Cortex®-M4F Based MCU TM4C123G LaunchPad™
I'm doing an Edx course with one of these... Edx - Embedded Systems... using this board, so would be good for me...

And many thanks for the advice, at least I know which direction to point myself in so I don't end up in a maze... :slight_smile: