OLED I2C

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mawi
New user
Posts: 2
Joined: 05 Oct 2015, 23:00

OLED I2C

#1 Post by mawi » 06 Oct 2015, 14:54

Ist der Support von einen SSD1306 OLED Display auch geplant ?

spants
New user
Posts: 7
Joined: 01 Nov 2015, 20:45

Re: OLED I2C

#2 Post by spants » 01 Nov 2015, 21:03

I'd like to see support for this too!

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#3 Post by BertB » 02 Nov 2015, 08:07

So do I.
I have a number of those little OLED displays. They are ideal for projects with small footprints.

Martinus

Re: OLED I2C

#4 Post by Martinus » 28 Nov 2015, 13:07

Development release R46 (github) now has basic text support for the I2C SSD1306 128x64 OLED display:

Image

BerndJ
Normal user
Posts: 86
Joined: 28 Sep 2015, 06:57

Re: OLED I2C

#5 Post by BerndJ » 28 Nov 2015, 13:21

Hi,

nice, thx a lot.

Is it planend in future to send Messages via http request, like:

Code: Select all

http://<ESP IP address>/control?cmd=OLED,<line nr>,<pos nr>,<Text>
??

Would be nice also for the LCD Display.

Or could i send such Messages via json or something else?

best wishes

BerndJ

PS: I found 0,96" and some 1,3" Displays with these controler. Are there greater on the market?

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: OLED I2C

#6 Post by fluppie » 28 Nov 2015, 16:31

Nice!! I was trying to develop this plugin as I tried out Nathan Chantrell's WiFi MQTT display code (http://nathan.chantrell.net/20141230/wi ... he-esp8266) for the ESP8266. I used the esp_mqtt example from the Cherts Dev Kit (http://www.esp8266.com/viewtopic.php?f=9&t=820).
MQTT to Oled is also interesting. Personally I prefer MQTT over HTTP. It's very lightweight and snappy. MQTT light switch (https://harizanov.com/wiki/wiki-home/th ... tat-board/) is almost realtime. Code is also on Github.

chrille
Normal user
Posts: 88
Joined: 26 Aug 2015, 15:11
Location: Horsens, Denmark

Re: OLED I2C

#7 Post by chrille » 28 Nov 2015, 20:32

fluppie wrote:MQTT to Oled is also interesting. Personally I prefer MQTT over HTTP. It's very lightweight and snappy. MQTT light switch (https://harizanov.com/wiki/wiki-home/th ... tat-board/) is almost realtime. Code is also on Github.
It would be great to have all output methods supported by MQTT (relay/output pin, PWM, displays etc)

- Jan
Jan Chrillesen, Denmark

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: OLED I2C

#8 Post by fluppie » 28 Nov 2015, 21:10

Working :)!!
IMG_6397.JPG
IMG_6397.JPG (105.82 KiB) Viewed 26423 times

Martinus

Re: OLED I2C

#9 Post by Martinus » 29 Nov 2015, 13:44

BerndJ wrote:Is it planend in future to send Messages via http request, like:

Code: Select all

http://<ESP IP address>/control?cmd=OLED,<line nr>,<pos nr>,<Text>
Would be nice also for the LCD Display.
Development R47 on github has support for this, both LCD and OLED plugins have been updated.

Martinus

Re: OLED I2C

#10 Post by Martinus » 29 Nov 2015, 13:51

chrille wrote:It would be great to have all output methods supported by MQTT (relay/output pin, PWM, displays etc)
- Jan
It would be great indeed, but looking at the code bits that we have build for MQTT output control it is not so easy as with http control.
This is actually still in a very rudimentary and experimental state and it supports only simple topics with one "command", one parameter to identify the IO pin and one single numerical value being send by MQTT messages.

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: OLED I2C

#11 Post by fluppie » 29 Nov 2015, 19:57

HTTP is already very nice, MQTT will be even better.
Should we implement a "screensaver" function? Is the OLED display sensitive to "burn-in" ??

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#12 Post by BertB » 29 Nov 2015, 20:48

Somewhere I read, that oleds develop burn-in from luminance degradation of the light-emitting pixels.

I think it must be possible to shut down the display with a command.

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: OLED I2C

#13 Post by fluppie » 01 Dec 2015, 09:21

Or maybe blank display during the night an/or a blank display during 5s every minute?

neuros
New user
Posts: 3
Joined: 30 Nov 2015, 20:33

Re: OLED I2C

#14 Post by neuros » 01 Dec 2015, 20:47

BertB wrote:Somewhere I read, that oleds develop burn-in from luminance degradation of the light-emitting pixels.

I think it must be possible to shut down the display with a command.

it is possible to set the contrast level.
Just change in file _P023_OLED.ino
(Line 438 ) Plugin_023_sendcommand(0x81); //SETCONTRAST
(Line 439 ) Plugin_023_sendcommand(0x1F); Lower values is less bright.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#15 Post by BertB » 02 Dec 2015, 17:58

neuros wrote:
BertB wrote:Somewhere I read, that oleds develop burn-in from luminance degradation of the light-emitting pixels.

I think it must be possible to shut down the display with a command.

it is possible to set the contrast level.
Just change in file _P023_OLED.ino
(Line 438 ) Plugin_023_sendcommand(0x81); //SETCONTRAST
(Line 439 ) Plugin_023_sendcommand(0x1F); Lower values is less bright.
@Martinus: Can you build a feature with this in the plugin, so it can be controlled via a Domoticz dimmer device and by pushing a switch on the ESP itself? A push on the switch switches the display on for a while.

tparvais
Normal user
Posts: 99
Joined: 28 Oct 2015, 23:13

Re: OLED I2C

#16 Post by tparvais » 02 Dec 2015, 23:14

Hello

I connected my oled to ESP12e with last GIThub release R48 and it works ! great !!! thank you for that !

push via url is also working

minor remark: special character éè ... are not working. WE can manage that.

However the ° of °centigrade would be nice to have :-)

other ideas: possibility to dump on screen some ESP system parameter such as ssid, IP address, uptime,...

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: OLED I2C

#17 Post by costo » 07 Dec 2015, 17:16

I have the wellknown OLED 0.96 inch display with SSD1306 controller.
It has a configurable I2C address with a solderpad at the backside, marked as 78 or 7A with translates to address 3C or 3D. (I2C adresses have to be divided by 2 sometimes as the even address is the listen and the uneven address is the talk address of the same device 78/79=3C and 7A/7B=3D).
As I have another OLED 1.3 inch display already on address 3C i have changed my 0.96inch display to address 3D.

I had to change the ESPEasy sketch in 2 places to make the OLED work again with this different address.

in file: _P023_OLED.ino : line 294 #define OLED_address 0x3d // was 0c3c

and had to add 3 lines in the WebServer.ino after line 1127
case 0x3D:
reply += F("OLED SSD1306 Display");
break;

p.s. i use the 048 release

retel
New user
Posts: 3
Joined: 10 Oct 2015, 11:44

Re: OLED I2C

#18 Post by retel » 07 Dec 2015, 19:30

How to display analog value from ADC input ?
[Analog#Voltage], not working.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: OLED I2C

#19 Post by costo » 07 Dec 2015, 19:39

retel wrote:How to display analog value from ADC input ?
[Analog#Voltage], not working.
You better start your own topic with this question.

For me it is working: Device=Analog Input, formula=%value%/335 to display in volts the voltage from pin ADC/Tout.
Fill in: ADC [adcDemo#Analog] on the line of the Oled/LCD where adcDemo is the name of the device that you give to it.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#20 Post by BertB » 08 Dec 2015, 18:06

Since OLEDs wear out, it would be nice to have a way to activate them on request.
Is it possible to add another port to the plugin to connect a switch for that purpose?

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: OLED I2C

#21 Post by costo » 08 Dec 2015, 19:55

BertB wrote:Since OLEDs wear out, it would be nice to have a way to activate them on request.
Is it possible to add another port to the plugin to connect a switch for that purpose?
I have no idea if an OLED wears out that fast. The small ones are cheap to replace, usually about 5 euro for a 0.96 or 10 euro's for a 1.3 inch.

But if you want to turn it on/off on command it must be done with these 2 commands:

Plugin_023_sendcommand(0xae); //display off
Plugin_023_sendcommand(0xaf); //display on

So an input on the ESP needs an button that makes the ESP send the 0xAF command to the OLED and after a predetermined time the ESP needs to send the command 0xAE to the OLED to turn it off.

I have been playing with the contrast commands before but for me that did not give much effect. Probably because the OLED was so cheap that contrast is not implemented well.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#22 Post by BertB » 10 Dec 2015, 17:05

Lifespan
The biggest technical problem for OLEDs was the limited lifetime of the organic materials. One 2008 technical report on an OLED TV panel found that "After 1,000 hours the blue luminance degraded by 12%, the red by 7% and the green by 8%."[69] In particular, blue OLEDs historically have had a lifetime of around 14,000 hours to half original brightness (five years at 8 hours a day) when used for flat-panel displays. This is lower than the typical lifetime of LCD, LED or PDP technology. Each currently is rated for about 25,000–40,000 hours to half brightness, depending on manufacturer and model.[70][71] Degradation occurs because of the accumulation of nonradiative recombination centers and luminescence quenchers in the emissive zone. It is said that the chemical breakdown in the semiconductors occurs in four steps: 1) recombination of charge carriers through the absorption of UV light, 2) homolytic dissociation, 3) subsequent radical addition reactions that form π radicals, and 4) disproportionation between two radicals resulting in hydrogen-atom transfer reactions.[72] However, some manufacturers' displays aim to increase the lifespan of OLED displays, pushing their expected life past that of LCD displays by improving light outcoupling, thus achieving the same brightness at a lower drive current.[73][74] In 2007, experimental OLEDs were created which can sustain 400 cd/m2 of luminance for over 198,000 hours for green OLEDs and 62,000 hours for blue OLEDs.[75]

Martinus

Re: OLED I2C

#23 Post by Martinus » 10 Dec 2015, 19:14

@bert,

I think all these articles are about "super high luminance" OLED TV's. I think degradation is influenced by luminance strength being applied.

Do you think that this also applies to these tiny OLED displays? My sample has a brightness that resembles a "glow in the dark" toy...

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#24 Post by BertB » 10 Dec 2015, 23:12

My 0,96 " Oled is quite bright, unless I turn back the contrast to 01.

One of my friends is specialized in displays and he confirms the rapid degradation.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: OLED I2C

#25 Post by costo » 11 Dec 2015, 00:06

tparvais wrote:Hello
........
minor remark: special character éè ... are not working. WE can manage that.

However the ° of °centigrade would be nice to have :-)
If you want the centigrade/degree symbol you have to sacrifice another symbol for that.
For instance you can sacrifice the @ symbol and replace it with the ° degree symbol.

You do this:

in file -P023_OLED.ino you have to edit one line.
line 228 which looks like: {0x00, 0x32, 0x49, 0x79, 0x41, 0x3E, 0x00, 0x00},
which is the symbol @

Replace this with:
{0x00,0x00,0x0C,0x12,0x12,0x0C,0x00,0x00},
which is the degrees symbol and you just have to use the '@' to get the degree symbol on your OLED.

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: OLED I2C

#26 Post by fluppie » 14 Dec 2015, 00:04

Powerful OLED lib: http://blog.squix.ch/2015/12/esp8266-ol ... lease.html
Code: https://github.com/squix78/esp8266-oled-ssd1306

Then we can play with fonts, flip/rotate the display :).

hamster
Normal user
Posts: 62
Joined: 27 Sep 2015, 21:01
Location: UK

Re: OLED I2C

#27 Post by hamster » 15 Dec 2015, 21:30

2015-12-15 19.45.55.jpg
2015-12-15 19.45.55.jpg (116.98 KiB) Viewed 27432 times
Not sure why I have yellow text in lines 7 and 8?
bought this http://www.ebay.co.uk/itm/321927689593
Works great.. bicolor looks cool. :D

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: OLED I2C

#28 Post by Backbone » 15 Dec 2015, 22:39

You have a bi color Oled.
There are several version available.
http://www.ebay.nl/itm/5Pcs-0-96-Inch-4 ... SwYaFWb0Oi

Paco

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: OLED I2C

#29 Post by costo » 15 Dec 2015, 23:24

hamster wrote: ....
Not sure why I have yellow text in lines 7 and 8?
bought this http://www.ebay.co.uk/itm/321927689593
Works great.. bicolor looks cool. :D
There is a specific internal SSD1306 command to set the direction how the display draws its pixels.
If you have a bicolor oled ESPEasy will draw line 7 & 8 in the second color.
If the rotate screen command is used first you will find that line 1 & 2 are in the second color. (Like the picture on Ebay shows the display)

You have to live with the fact that ESPEasy does it this way or else you have to dig deep in the plugin sourcecode to add the extra command for screen rotation.

hamster
Normal user
Posts: 62
Joined: 27 Sep 2015, 21:01
Location: UK

Re: OLED I2C

#30 Post by hamster » 15 Dec 2015, 23:55

thanks for the reply.. appreciated.. I can live with the yellow font on lines ..7 & 8 .. I think it looks cool.. :D

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#31 Post by BertB » 17 Dec 2015, 23:44

I changed the OLED plugin a bit, so that I can switch on and off the display with a switch, created in Domoticz, with the on and off actions:
http://192.168.0.67/control?cmd=OLED,0,0,!on
http://192.168.0.67/control?cmd=OLED,0,0,!off
The commands are arbitrary, but as long as you do not use that specific sequence in normal messages, it seems to work just fine.
The update of the display continues even when the display is off.

@Martinus, can something like this be built in the official plugin?

Code: Select all

   case PLUGIN_WRITE:
      {
        String tmpString  = string;
        int argIndex = tmpString.indexOf(',');
        if (argIndex)
          tmpString = tmpString.substring(0, argIndex);
        if (tmpString.equalsIgnoreCase("OLED"))
        {
          success = true;
          argIndex = string.lastIndexOf(',');
          tmpString = string.substring(argIndex+1);
          ============
          Serial.print(tmpString);
          if (tmpString.equalsIgnoreCase("!off"))
          {
            Plugin_023_displayOff();
          }
          else if (tmpString.equalsIgnoreCase("!on"))
          {
            Plugin_023_displayOn();
          }
          else
          {
            Plugin_023_sendStrXY(tmpString.c_str(), event->Par1 - 1, event->Par2 - 1);
          }
          ============
        }
        break;
      }
      
  }
  return success;
}

mrb
Normal user
Posts: 11
Joined: 15 Dec 2015, 13:54

Re: OLED I2C

#32 Post by mrb » 18 Dec 2015, 12:49

@BertB this is good stuff!
thank you.
anyone know of a better way to clear the oled screen? I'm sending 16x %20 to clear the line but it makes for a slower refresh.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#33 Post by BertB » 18 Dec 2015, 14:49

Should not be too hard to built it too.

Martinus

Re: OLED I2C

#34 Post by Martinus » 20 Dec 2015, 10:18

BertB wrote:I changed the OLED plugin a bit, so that I can switch on and off the display with a switch, created in Domoticz, with the on and off actions:
http://192.168.0.67/control?cmd=OLED,0,0,!on
http://192.168.0.67/control?cmd=OLED,0,0,!off
The commands are arbitrary, but as long as you do not use that specific sequence in normal messages, it seems to work just fine.
The update of the display continues even when the display is off.

@Martinus, can something like this be built in the official plugin?

Code: Select all

   case PLUGIN_WRITE:
      {
        String tmpString  = string;
        int argIndex = tmpString.indexOf(',');
        if (argIndex)
          tmpString = tmpString.substring(0, argIndex);
        if (tmpString.equalsIgnoreCase("OLED"))
        {
          success = true;
          argIndex = string.lastIndexOf(',');
          tmpString = string.substring(argIndex+1);
          ============
          Serial.print(tmpString);
          if (tmpString.equalsIgnoreCase("!off"))
          {
            Plugin_023_displayOff();
          }
          else if (tmpString.equalsIgnoreCase("!on"))
          {
            Plugin_023_displayOn();
          }
          else
          {
            Plugin_023_sendStrXY(tmpString.c_str(), event->Par1 - 1, event->Par2 - 1);
          }
          ============
        }
        break;
      }
      
  }
  return success;
}
Maybe better to have an extra command like OLEDCMD?

then you would get

OLEDCMD,ON
OLEDCMD,OFF

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#35 Post by BertB » 20 Dec 2015, 11:23

That is even beter.

Mihadongle
Normal user
Posts: 25
Joined: 07 Jan 2016, 17:18

Re: OLED I2C

#36 Post by Mihadongle » 19 Jan 2016, 09:38

Hallo from Austria
I will display my Thermostat from domoticz on the display
Is there any way to diplay the thermostat Temperature?
Best regard

miroslav.petrov
New user
Posts: 4
Joined: 26 Jan 2016, 15:05

Re: OLED I2C

#37 Post by miroslav.petrov » 26 Jan 2016, 15:17

HI guys. I am using SSD1306 128x64 display by TinySine. I am using easyesp r48 on nodemcu v1(also tried it on adafruit huzzah feather, same sh^t) This is the image i get on the screen. Can you give me any suggestions why is the screen displaying this?

PS: The display works with Raspberry Pi
Attachments
Oled display
Oled display
12584156_10205606850559551_1278406140_n.jpg (132.81 KiB) Viewed 27089 times

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#38 Post by BertB » 26 Jan 2016, 16:23

Hi,
The OLED has to be reset first, as a simple power on often leaves it in a uncertain state.
Try to connect the reset of the OLED to the reset of the NodeMCU. That worked for me.

miroslav.petrov
New user
Posts: 4
Joined: 26 Jan 2016, 15:05

Re: OLED I2C

#39 Post by miroslav.petrov » 26 Jan 2016, 16:40

hm... Thank you it works now. But in the wiki, it says to connect just the 4 pins, why is that?

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#40 Post by BertB » 26 Jan 2016, 17:31

We will improve the wiki. Sorry for the confusion.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: OLED I2C

#41 Post by Drum » 21 Feb 2016, 00:24

So how should the Local Button for the OLED display be wired? The timer certainly works, but I tried 2 different pins pulled to ground or 3.3 V but neither triggered the display. For this I am using a Node MCU and R80. There could be some other problem as well, it likes to reboot a lot too, but that could be the wonderful USB port on my laptop, or the breadboard.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: OLED I2C

#42 Post by BertB » 21 Feb 2016, 11:54

If you use a breadboard and external devices (with respect to NodeMCU) it is important to add extra capacitors across the power lines.
I also found that the diode in series with the USB port and the regulator sometimes takes too much tension across it, leaving hardly any space for the dropout voltage. I shorted all diodes on my NodeMCU's and had no spurious reboots anymore. But be careful here not to blow up the USB power supply, your pc or the NodeMCU.

I connected the OLED button to ground and to GPIO02. That works fine for my, but on other ports you may need to use a pull up resistor.
a short pulse on the button turns the OLED on, until the timer turns it off again.

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: OLED I2C

#43 Post by cherowley » 23 Feb 2016, 10:38

Drum wrote:So how should the Local Button for the OLED display be wired? The timer certainly works, but I tried 2 different pins pulled to ground or 3.3 V but neither triggered the display. For this I am using a Node MCU and R80. There could be some other problem as well, it likes to reboot a lot too, but that could be the wonderful USB port on my laptop, or the breadboard.
Ah, I've had stability problems when using the oled. Also using a nodemcu board. Had assumed that since the usb port i'm using provides 1A that would be enough...

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: OLED I2C

#44 Post by costo » 23 Feb 2016, 15:28

cherowley wrote: Ah, I've had stability problems when using the oled. Also using a nodemcu board. Had assumed that since the usb port i'm using provides 1A that would be enough...
If you use a long USB cable and it has tiny wires you will have much loss in the cable.
Voltage will have dropped already as it reaches the usb connector of nodemcu board. There a diode gives another voltage drop before it reaches finally the 3.3v regulator. When voltage at the input of the regulator is low, the regulator will have difficulties to function during WiFi transmission.
This voltage drop during transmission will make the board unstable and unexplainable resets can occur.
This voltagedrop also influences the oled , making it flicker and maybe even freeze it.

Often it helps to use some extra capacitors on the 3.3v lines. The nodemcu has three 3.3v connections. You can use an extra capacitor on the 3.3v point positioned between EN_pin and GND, this helps stabilize the setup.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests