Previously I mentioned using a modified version of Squix’s Weather Station Colour as a test application for a 2.2″ TFT 240×320 display with an SPI interface. If you have a Yellow Board hanging around unused, I really would recommend this as a useful application. My photo doesn’t really do it justice (it is a rainy day here and the light is bad). The actual display is quite crisp and sharp (even with the protective plastic shipping sheet still attached to the screen).
What you see to the left is Keith Fowler’s modified version of Neptune2’s modified version of Squix’s original (got that?). The middle and bottom areas on Keith’s version dynamically update every few seconds to give you expanded information (for instance, the bottom 1/3 of the screen will change to show you the current phase of the moon, while the middle will give you the same style of iconized weather for an additional three days). It really is quite neat, even for someone with eyes as poor as mine.
Squix has build instructions on his site, which I’d just like to add to here. He’s using a NodeMCU board, where the GPIOs are numbered a little strangely, so here’s the connection map for a normal ESP-12 (or, in our case, the Yellow Dev board):-
- DISPLAY ESP
- MISO – N/C
- LED – 3v3
- SCK – GPIO14
- MOSI – GPIO13
- DC/RS – GPIO02
- RESET – RST
- CS – GPIO04
- GND – GND
- VCC – 3v3
There’s nothing special which needs to be done (other than watching out for upper-lower case issues with the names of the included font files if you’re compiling on a non-Windows machine). Once the connections are made, you can load either Squix or Keith’s code and it will burst into life …except that you won’t get much useful weather information until you get your own developer’s ID from Weather Underground (it’s free).
The display connections leave us with GPIOs 16, 15, 12, 05 and 00 to play with (remembering that 00, 02 and 15 need special attention because of their specific pull-up/down functions at power-on). One obvious addition would be the use of a P-channel MOSFET in the display LED backlight line to only light up the screen when a button is pressed. That could save quite a bit of power over time (and I don’t particularly want bright flashing screens at night).
Personally, I plan on stealing some of Squix, Neptune2 and Keith’s ideas to implement a little controller which will display inside and outside temperature (using a local DS18B20 for the local sensing) and allow override control of a fan heating system via MQTT.
Squix has build instructions on his site_