Retro METAR Clock

Time and Weather

As an aviator its important to know what the weather is doing and in my case whether there is an point tuning up to the airfield.

I had been toying with the idea of making a retro LED clock for some time, but as I now have to use an ESP8266 connected device for everything because its cheap and east to use, I thought I could add value by displaying the current METAR. A METAR is an aviation text encoded weather observation that really belongs 100 years in the past, but is still useful. It tells us what the wind is doing, the pressure, cloud and visibility. These are all available online in JSON requests or via many free API’s. So all we need to do is make a web request.

The ESP8266 does not have a real time clock, but it is able to sync with NTP (Network Time Protocol) and keep time that way. So all we really need is the ESP8266 and the LED display.

Two 4 panel LED displays is too large for my 3D printer so its made it two halves. Simple affair, there is no back but it includes screw hangars and a notch for USB entry.
To join the two LED panels, I used 5 wire links between them.
CDS light cell / resistor tacked on to the board allows sensing of ambient light levels. Other than that its all driven directly from the ESP8266, the USB powers everything.
  • ArduinoOTA – allows for it to be updatable over the air, essential when its screwed to the wall.
  • Adafruit GFX Library – required for the LED panel.
  • MegunoLink – used to filter the light sensor data to stop the brightness hunting.
  • ArduinoJson@5.13.4 – specific version required to parse the JSON web request for the METAR data.
  • WifiManager – to create a hotspot to allow the device to be configured.
  • Max72xxPanel – the shift register driver for the matrix panel.

Refinements

I found that the string class, although very powerful, can lead to heap fragmentation on the ESP8266. The forums are not terribly helpful basically saying that people should learn to use char arrays and pointers instead and stop being lazy. Whilst that may be true especially on a tiny process with a few kb of RAM its not helpful when leveraging 3rd party libraries, particularly the JSON class – you could do this manually but its unwieldy.

The solution I went for is to restart the ESP every 24 hours instead to clear up the memory. The LED display will just retain whatever it was showing whilst the restart fires, and it only takes a few seconds. I may revisit this and refine it a bit later, but for now its perfectly workable.

Clones

As it happens by word of mouth I have made quite a few of these. Its ironic that the most expensive part is a nice USB cable! There’s one at Flightpath flying school at Wolverhampton Halfpenny Green.

Leave a Reply