The OLED shield

This shield features a 64x48 pixel OLED display. We would normally not connect it as IoT sensor but it comes it handy to display the state of out WeMos sensor node, especially when running from battery and without a serial connector to the PC.

wemosOled.png

Programming the shield

The shield uses an SSD1306 OLED dot matrix controller which is accessed through the I2C bus. In order to see if we can access the chip we can first run a little program scanning the I2C bus and showing all uses I2C addresses:

i2cscan.png

This shows us that the module must be accesses on I2C address 0x3c. The code of the i2c scanner can be found here:

https://github.com/uraich/MicroPython_IoTDemos/blob/master/drivers/i2c/i2cScan.py

The Cayenne client may use the OLED display. It first checks if it is connected and if yes it print information about the network state. This is particularly useful if the WeMos D1 mini runs on battery and there is no connection to the PC where state information can be displayed.

oled.png

-- %USERSIG{UliRaich - 2019-03-22}%

Comments

 

I Attachment Action Size Date Who Comment
i2cScan.py.txttxt i2cScan.py.txt manage 839 bytes 23 Mar 2019 - 13:06 UnknownUser  
i2cscan.pngpng i2cscan.png manage 28 K 23 Mar 2019 - 13:04 UnknownUser  
oled.pngpng oled.png manage 334 K 17 May 2019 - 16:07 UnknownUser  
wemosOled.pngpng wemosOled.png manage 305 K 22 Mar 2019 - 14:21 UnknownUser  
This topic: AFNOG > WebHome > AFNOGWorkshop2019 > WeMosD1Mini > OledShield
Topic revision: 17 May 2019, UliRaich