Adding a mini display to show METAR information to the METAR map

Recently I decided to add a new functionality to my METAR map to support a small display that shows the METAR information for the various airports on the chat.

I decided I wanted to keep it compact, so I bought this small 128 x 64 pixel display from Amazon to embed into my METAR Map. It’s about 2.5 x 1.5 mm (1 x 0.5 in) in size, so it takes up very little space.

Mini LED display using SSD1306 chip

This particular one has the text in Yellow for the top 16 pixels and then blue for the bottom 48, but there are also many others available that are just normal black and white. As long as they use the SSD1306 chip and are I2C, they should likely work just the same.

First thing is wiring them up, they use the SDA and SCL pins on the Raspberry Pi and a 5V and Ground pin. Below is a picture how I wired them up. You can refer to Raspberry Pi GPIO Pinout for a graphic of the pins.

Pin setup for the display

With the wiring done, I’ve set up the software functionality for the Raspberry Pi to be able to communicate with the display.

The detailed steps for that are on the Github page for the METAR map.

With the wiring and the software completed, I made a small cutout in my chart to embed the display, here’s the final picture:

Final display integrated in my METAR map

Like the Project? I always appreciate a cup of coffee/tea!

Some of the above links to Amazon may earn me a small commission to keep the site running.

22 thoughts on “Adding a mini display to show METAR information to the METAR map

  1. Anthony Varga

    Phil, a great add. What would I do to keep the display static on one airfield ? I would like to mount it by my home field and only report on that field.

    Reply
    1. Philip Rueker Post author

      Hey,

      In the metar.py file, instead of looping through the airports towards the bottom of the file (there’s a comment “Rotate through airports METAR on external display”)
      Remove the indented code under:
      if disp is not None:
      and replace it with this (replace “KPAE” for whatever airport you want to show it for, just make sure that airport is present in the airports file for the LEDs):
      displaymetar.outputMetar(disp, "KPAE", conditionDict.get("KPAE", None))

      Reply
      1. Lynol Amero

        Philip,
        I thought I saw some place where a separate file of airports was used for showing up on the mini display. It was a truncated list of the ‘airports’ file that is cycled through of only the important airports that you wanted to display the data. Will you point to the what code changes and files are required to add this functionality?

        Reply
        1. Philip Rueker Post author

          Hey,
          you just need to create a new file called “displayairport” and put it in the same folder.
          The code already looks for this file and if it’s there will use it automatically, if not it uses the normal list from the “airports” file.

          Reply
  2. Anthony Varga

    Philip, I had left a comment about not being able to load one of the libraries (libjpeg-dev) needed for the display so if you see that please disregard as I resolved with a sudo apt-get update then it installed.

    Reply
  3. Kyle Lacey

    this is a great project I made one and then decided to make another with a friend. during his we ran into a couple problems during the led test they all light up for 2 second then they go out but the last 9 of the string of 50 stay lit. any ideas on why. I am ordering another light string to see if this one is faulty.

    Reply
    1. Philip Rueker Post author

      The most common explanation I’ve seen for unexpected behavior around LEDs not quite working is often related to power, so could be a too weak power supply being used, but yes it could also just be a faulty string of lights, so I guess you can see if it happens on the replacement too and if so, try to maybe use a different power supply.

      Reply
  4. K4DQP

    Philip, one question on wiring. Since I already have the PI ZERO wired up and operating the LEDs, do I just wire in the display to the same PI ZERO (according to your picture in the article)?

    Reply
    1. Philip Rueker Post author

      Hi, yes you wire it to the same PI Zero.
      The LED string and the display use different pins.

      Reply
  5. Lynol Amero

    Hi Philip,
    I’ve added the mini display to the project. I’ve found that when there are gusty winds, the LEDs blink (like they are supposed to), but the display also flashes another station back or forth from the current station being displayed to the next station. I can send a video of the issue if needed (please advise where to send it.)
    Thanks for the great project!

    Reply
    1. Paul

      Hi Lynol,
      For those of us without printers could we buy one from you?
      Also the light pipes could we buy from you?
      Happy to pay and shipping

      If not, which prusaprinter do we need to print ourselves?

      Reply
  6. Paul

    Hi Phil,

    Got the main map display working fine!

    Installed all software for the mini display.
    When I run the i2cdetect -y 1 it does run that script but doesn’t appear to detect anything.
    I’ve enabled in Interface Options etc.

    Do you think this is also a Power issue since I couldn’t seem to run the main map on the board alone (used external power supply)???

    If so, can I run a lead from the light back to the mini-display or do I need to run from the mini-display to the external power itself and tie in with the map lead???

    Can the external power supplies power the two devices ok?

    Reply
    1. Philip Rueker Post author

      Could be, you could also first try to unplug the LEDS to just get the display working and then re-plug the LEDS once you have the display working.

      But yes, you should probably be able to run the external display off the external power too, you’ll just have to splice the power wire into both the LEDS and the display.

      Reply
  7. Paul

    Hi Philip,

    Got everything running it seems.
    Two things:
    1) I’ve noticed since I hooked up the mini-display that in the morning, the mini display is off and maybe some of the lights. If I connect into the pi unit and do ./refresh.sh it seems to “reset” everything and it might continue fine until say the next morning. Any ideas? I have the mini-display set to every 5 seconds as you indicated in the directions.

    2) All works fine with the extra power adapter but it seems as though most people can run a 50 light strand on just the pi. Any idea what I might be missing? maybe how I’m wiring it up?

    Reply
    1. Philip Rueker Post author

      1) It should run fine continuously with using the refresh.sh script via the crontab.

      2) Not quite sure, as you mentioned it works fine for myself (I have about 30 LEDs) and others directly from the Pi, but sometimes these electronics are a bit finicky, so if it works okay with the external power supply for you, then that’s fine too.

      Reply
  8. Paul

    Hi Phil,
    Great project. The script seems to “time out” regularly. Not sure if it is related to the addition of the mini-display.
    In the morning, the mini-display is off and sometimes some of the lights and when I go into the VNC Viewer I see that there’s a message that reads “done”. If I hit enter I get the raspberrypi prompt and I can execute the ./refersh.sh command and it starts up fresh.

    https://ibb.co/TMcCCVM

    Any ideas?

    Reply
    1. Philip Rueker Post author

      Hey,

      The script runs for however long you set it, the default I have it running for is 5 minutes.
      After which it gets triggered again using the crontab so it gets the latest weather.

      So if you haven’t set up the crontab to trigger the script automatically, that’s why it stops running.

      Reply
      1. Paul

        I’m starting to learn more python-is there a line of code I could add somewhere to show last pull time at the top of each cycle?

        Reply
        1. Philip Rueker Post author

          The script will already print the last run time at the start “Running metar.py at” which prints the last date/time it ran, which is basically the last time it pulled the new data.

          Reply
  9. John C

    Hi Phillip,
    Is there any console status display via the metarmap application using the Pi console HDMI port (or SSH)… or say maybe something that shows the execution and/or updates as it cycles? My goal is to hook a monitor to it below the mount location that could display console application output or better yet a status page that could be displayed (and automatically updated as it cycles). Thoughts? Thanks for your time and input.

    Reply
    1. Philip Rueker Post author

      By default the script runs via cronjob in the background, so it doesn’t actually print anything to the console.

      You could change it so that the script will output the console log into a file and then display that file on a monitor with automatic scrolling.
      Beyond that you would need to create your own script additions to write the outputs to a script page.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.