Zonnestroompanelen in Nederland

duurzaamheid achter de meter

(35) Photometry displayed with a 130×130 pixel SSD1283A TFT screen and powered by an ESP8266 Wemos D1 mini

Summary
Here we connect a 130×130 TFT display with an SSD1283A controller to an ESP8266 Wemos D1 mini microprocessor board. The D1 mini has a smaller footprint than an Arduino while it has more working memory and on board wifi. A BH1750 photometric sensor breakout board connected with the D1 mini measures ambient light intensity. The amount of energy reported by the BH1750 is calculated in Watts per square meter and in Lux. Successively the Lux values are displayed on the TFT screen where a retro-analog looking temperature gauge automatically switches through three scales. The required libraries, <LCDWIKi_GUI.h> and <LCDWIKI_SPI.h>, can be downloaded from a repository at GitHub.

Introduction
Square displays are interesting devices because they offer graphic features that allows the mimicking of an analog watch or meter. Most Arduino compatible displays possess pixel dimensions that are a multiple of 8, e.g., 128×64, 128×160, 240×320 or 320×480. Such dimensions result in rectangular displays. For some applications one might favor a square display with sufficient pixel resolution. The 130×130 pixel TFT display breakout board described here is sold by several Chinese vendors. The on board controller is a SSD1283A chip. Screen diagonal is a comfortable 40 mm (1.6 inch) while the breakout board dimensions are 54×35 mm. One attractive feature of this TFT board is that full 16-bit color is available. In this example a 130×130 TFT display is on a prototyping breadboard connected with a Wemos D1 mini ESP8266 microprocessor board, running up to a future project that aims at the construction of a highly portable, wifi connected, light intensity data reporting unit. The light intensity sensor is a BH1750 breakout board with I2C connectivity.

Wiring
The breakout 130×130 TFT display is placed onto a breadboard together with a Wemos D1 mini (ESP8266; NodeMCU and Arduino compatible). This assembly is combined with the BH1750 breakout light intensity sensor (figure 1). The BH1750 sensor is mounted on a separate bracket and supplied with a gray intensity filter borrowed from a camera, this in order to match the intensity of direct sunlight with the sensor’s dynamic range (see earlier post)
The SSD1283A controller of the TFT display requires instructions that can be compiled with the libraries, <LCDWIKI_SPI.h> and <LCDWIKI_GUI.h> (authored by Jean-Marc Zingg). These libraries and their user documentation can be found at GitHub (https://github.com).

Pin mapping table

TFT display pin labels

also indicated as:

connect to pin on Wemos D1 mini (ESP8266) marked:

LED

LED

3V

SCK

SCLK

D5

SDA

MOSI

D7

A0

DC

D3

RST

RES

D4

CS

CS

D8

VCC

Vcc

3V

GND

GND

GND

figure 1: Schematic connectivity for a 130×130 pixel SPI TFT display with SSD1283A driver with a Wemos D1 mini. The breakout TFT board has eight pins: LED, SCK, SDA, A0, RST, CS, GND and VCC. The display is a 16-bit color transflective TFT. The sketch forces it to automatically scale in three ranges. Pins SCL and SDK of the BH1750 photometric sensor are connected with pins D2 and D1 of the D1 mini, respectively.

3.3V or 5V?
The TFT breakout board is advertised by the vendor as 3.3V. Its brightness and contrast however are low when it is powered at 3.3 V (brightness and contrast of the display in both figures 1 and 2 were enhanced with a bitmap editor). The display tolerates 5V, e.g. when combined with an Arduino Uno and then displays somewhat brighter. As it will be introduced in a 24/7 photometric sensing project the 3V power supply is maintained to assure a long life. The BH1750 photometric sensor is 3.3V compatible.

Electronics and supplies
1x Arduino Nano microcontroller board, breadboard, jumper wires, 130×130 pixel SSD1283A breakout TFT display, BH 1750 photometric sensor, 2x 4.7 k Ω resistor, breadboard.

Figure 2: Prototype ready! The 130×130 TFT display at work with the Wemos D1 mini that takes light intensity data from the BH1750 photometric sensor.

Sketches
Two sketches are supplied here: a demo showing graphics that can be programmed, and a sketch that reads light intensity data from the BH1750 sensor and displays these with a retro-analog gauge type meter on the 130×130 TFT screen. Both sketches need the libraries LCDWIKI_GUI.h> and <LCDWIKI_SPI.h>. The LCDWIKIs can be downloaded from repositories at GitHub (https://github.com/lcdwiki/LCDWIKI_gui) (https://github.com/lcdwiki/LCDWIKI_SPI)

Graphic functions demo sketch: wemos_D1_130x130_TFT_SSD1283A_graphic_functions.ino
– download via link at the end of this paper

Temperature display sketch: wemos_D1_130x130_TFT_SSD1283A_BH1750.ino
– download via link at the end of this paper

Discussion
The 130×130 SSD1283A TFT display performs well with an ESP8266 type microcontroller board such as the Wemos D1 mini. In a previous post this has already been demonstrated. One disadvantage of this particular TFT display running at 3.3V power supply with a Wemos D1 mini is its low luminosity, making it less useful in sunlight conditions.

Sketches:

wemos_D1_130x130_TFT_SSD1283A_graphic_functions.ino  (supplied as zip file)
wemos_D1_130x130_TFT_SSD1283A_BH1750.ino (supplied as zip file)