Banggood 1.3″ OLED I2C Displays

I just wrote about the 10-pack of GeekCreit Wireless IOT Modules – or as most of us know them – nodeMCU ESP8266 boards – at a very reasonable €23 for 10 – i.e. 2.30 each inc post. So what better to test them with than the freely-available tasmota-displays.bin and a nice OLED display.

But using the little 0.96″ displays is nothing new and though cheap they are a little on the small size. I was pleased therefore to note that Banggood stock a larger version at 1.3″ (I’ve no idea why we still use inches for the size of these). I’ve been using the SSD1306-based 0.96″ displays for years and you’ll find umpteen references to them in here.

The larger, white 1.3″ OLED displays however use a different chip – the SSH1106 – this particular version has the same resolution as the higher of the two smaller displays – i.e. 128*64

Having already tested one of my nodeMCU boards with the SSD1306 I was happy my hardware worked – and changed the Tasmota commands slightly to cater for the new display.

Disaster – and that’s why it has taken me a couple of weeks to write this article, planned originally for Christmas week. I wasted a lot of time on the Tasmota forums trying to find out why my new display – when presented with some text, would only show every other line of pixels. Antonio (Mr Shark) and I spent AGES trying to figure it out then he remembered he’d had a similar display and his worked.

tasmota-display.bin webUI

The penny dropped… so I sent an email to Banggood who rapidly shipped off a pair of replacements. They turned up in deepest Spain this morning and here I am. They work, PERFECTLY – so it looks like, after all that, I simply had a duff display (looking now I can see a minor crack in the bottom left of the display which may have resulted in a disconnected internal wire) – nothing wrong with the Tasmota driver at all.

If you check the link in this article to the displays – note that for some reason Banggood show the GND and VCC positions to be the same as the SSD1306 displays – in FACT they are reversed (and marked accordingly) on the displays I have (i.e. vcc on the outside).

To drive these OLED displays, assuming for now you are working in the Tasmota webUI – is easy. But take note – the displays use 4 wires in total – 3v3,gND, SCL and SDA (i2c). The Tasmota (display version bin file) settings for this are easy – simply set GPIO4 (D2) to SDA in the webUI and GPIO5 (D1) to SCL using the “generic (18)” template. This as it happens is a choice, you don’t HAVE to use GPIO4 and 5, I just tried moving SCL to GPIO12 and it worked just as well.

Then wire the display to the ESP8266 board. (for reference these boards sit at i2c address 0x78 by default – that is how Tasmota knows the board is connected. In addition, a couple of commands are needed and these are non-volatile.

displaymode 0
displaymodel 7

There are a ton of commands and settings for displays and it all gets confusing very quickly – the ones I’ve given you above are all you need to get started. That should force a reset of the board and give you a blank screen on the display. Next you will want to send some text…again in this case in the console:

displaytext Hi how are you today

Of course it doesn’t stop there – you can set one of several fonts, clear the screen, change orientation and so much more as well as xy position the cursor but that gets confusing fast so I thought I’d get the basics out of the way – I got bogged down with all the commands through trying to do too much at once. Ok, got a working display?

How about clear screen and a little cursor positioning..

displaytext [z]Hi there[x0y8]how are you

“displaytext” supports commands in square brackets which can be used for control – for example [z] clears the screen, [x0y8] sets the cursor down and left etc. To go further – I direct you back to the massive Tasmota commands page (display section) for more. You have a small choice of fonts, can draw rectangles etc filled or un-filled and more.

If you were sending commands via MQTT, in this example to a device I’m calling “display1”, you might send the displaytext command as a topic – payload pair:

topic: cmnd/device1/displaytext
payload: [z]Hi there[x0y8]how are you

Let’s ramp this up a bit by using 2 fonts (inline font setting), inline time (with seconds hence tS) and a horizontal line:

OLED text and horizontal line
topic: cmnd/device1/displaytext
payload: [zf1]HI THERE![x70tS][x0y12h128f0x0y18]how are you today?[x0y27]Lovely, thank you,[x0y36]What a nice day…
topic: cmnd/device1/displaytext
payload: [x0y45]Yes, it is.[x0y54]Warmer tomorrow.

Note the closing then opening brackets on the first payload – after time and before the xy setting – why? No idea but when I missed them out, the time showed up on line 2 in the smaller font – it’s a mystery).

There’s an important point here, these displays don’t last forever, so when I put a message up, sfter some time, maybe a couple of minutes depending on the job, I turn it off – this can be done with a POWER command or simply [z] to clear the display.

Until recently I was running the SSD1306 display on my home control Raspberry Pi, but now that I have this, I can combine the display and maybe a pair of SSD PSU control relays onto one nodeMCU board (I’m thinking power to the Pi and control of a pair of SSDs for cloning, all handled in Node-Red but that’s another article). Oh, another non-volatile command DISPLAYROTATE (0,1,2 or 3). Of course, it is up to you not to put too many characters on a line.

I’ll shortly expand this as I’m expecting more displays in the next week or so including colour LCD and OLED displays (the larger ones tend to use SPI hence more GPIOs).

Facebooktwitterpinterestlinkedin

15 thoughts on “Banggood 1.3″ OLED I2C Displays

  1. Isn’t the price a bit steep? More than 3 times compared to the small ones.
    Or are they worth it cause it really makes a big difference?

    1. Thanks for that response, Felix – yes it does seem a lot compared to the SSD1306 and yes I HAVE just written to ask why so high, the jump from 0.96 to 1.3 really is nice, I struggle to read the smaller ones, nice as they are, from my desk. Ok, I just looked at the price again – of course, AliExpress can beat that hands down but then life’s too short for all that scouring about on their website only to find the price they give is for something else or the postage is high thanks to Covid… I go there only when I must. Also AE’s range of delivery times generally seem to range from a reasonable 2 weeks to a ridiculous 2 months. I’m guessing that’s because they don’t actually stock anything but just act as a middle man.

      Did you see my comment about getting replacements as I initially had a duffer – AE have a standard “let’s discourage customers from griping” technique – “Can you send a video of the fault”. Regardless – as they have a 1.3″ blue version for much less, I’m having it 🙂

      Well, maybe, we are rapidly approaching Chinese New Year… just in time for vaccine roll-out (there’s always something).

      1. Yeah, shipping times are pretty bad with AE at the moment. I don’t need things very quickly usually though, so it’s ok in my case.

        I’ll give these a try: https://www.aliexpress.com/item/32847040077.html
        4 pieces for $16.38 and you can mix white and blue.

        Thanks for pointing out the display update over mqtt! I did not know about that yet and that’s really easy to use.

  2. Now you have caught my interest again Pete!

    I have a sonoff 2 gang light switch in my hall re-purposed with Tasmota to momentarily operate the totally unconnected relays but the corresponding MQTT output is used to “Boost” or “Advance” my central heating programme, default on a BigTimer of course!

    The issue is my better 1/2 has no idea which button does what, never knows which one she has just pressed or what the heating is doing!

    I am waiting for a red/black ePaper display to land from the far East. Now if this had a library in Tasmota and I could compile a .bin with some image.h files…

    What do you think?

    G

    1. Hmmm,
      I had a rummage in the parts bin and found one of the SH1106 1.3″ displays and tried flashing up a D1 Mini with tasmota-displays.bin

      I get nothing!

      I did revert to some kind of Arduino example which worked all be it with the pixels not mapped correctly but I blame the sketch which I didn’t read beyond the I2C pin definitions!

      This is the console output from “display” no args

      {“Display”:{“Model”:7,”Width”:128,”Height”:64,”Mode”:0,”Dimmer”:1,”Size”:1,”Font”:1,”Rotate”:0,”Refresh”:2,”Cols”:[21,8],”Rows”:8}}

      I emulated the col/row from your support post from Theo A but neither this or the default works.

      This:
      00:00:00 I2C: SH1106 found at 0x3c

      on boot suggests to me that I2C is working and that the 3C = 60 is correct?

      Any clues? Just a black screen!

      Thx, Garry

      1. Hi Garry – firstly make sure you’re on the latest DEV version of Tasmota as that’s all I’ve tried. 9.2.0.4

        And just for you – I just took a virgin nodeMCU board, programmed it up from a local tasmota.bin file using TASMOTIZE.EXE on my PC, then using the “send config” section in Tasmotize, called it “display2” and set up MQTT as well…. that always gets it wrong and adds a dash and 4 numbers to the WiFi address – I’ve asked the author of Tasmotize to fix that…

        So then I upgraded it… just for ease, in 2 halves using a local file tasmota-minimal.bin.gz then a tasmota-display.bin.gz to the latest version…. then I set up the module under CONIGURATION in the webUI for DISPLAY2, D2 as SDA, then D1 as SCL and VOILA.

        Then in the webUI CONSOLE for DISPLAY2 – I send
        POWER 1
        then
        DISPLAYMODE 0
        then
        DISPLAY MODEL 7

        All of the above is non-volatile
        so I waited a few secs as the board rebooted and then:

        DISPLAYTEXT [z]Hello World

        and out came Hello World. I’d add the image but this reply system being a bit archaic will only let me send one image at a time…

        1. I don’t know whether I should apologise or thank you Pete!

          You’re a gentleman and I am blaming my general anaesthetic this morning…

          I mean, I am a moron! See attached image.

          Sighs!

          Thanks a mil Pete!

          1. Magic. Power on/off is useful. The displays don’t last forever. If you want to time out the display, use the power off command. It retains the data but turn off the display, a subsequent power on will restore the display.. another non-volatile command – DISPLAYROTATE with a value of 0,1,2 or 3. This just keeps getting better.

  3. It sure is useful!

    I think I will 3D print a new face plate to replace the Tasmota light switch doing the MQTT currently. I will include a couple of buttons to allow jog or boost overrides and some feedback on the display using MQTT as in your blog post, as you suggest using a timer to power off. All nice and easy in NodeRed.

    Many thanks again!

    Garry

  4. Now appearing on any purchases from AliExpress “From 11PM 31 December 2020, AliExpress is required by law to collect UK Value-Added Tax (VAT) at the applicable rate and remit to the UK tax authority when goods are sold to UK customers (i) where the goods are located outside the UK at the point of sale with a consignment value of GBP135 or less, or (ii) where the goods are in the UK at the point of sale, but sold by an overseas seller. For more information, please visit: https://www.gov.uk/guidance/vat-and-overseas-goods-sold-to-customers-in-great-britain-using-online-marketplaces-from-1-january-2021“. Means that all items automatically have 20% added to cost of goods including shipping charges even if they fall below the previous minimum for VAT (£15).

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!

This site uses Akismet to reduce spam. Learn how your comment data is processed.