METAR Map
Visual representation of weather conditions at specific airports
Summary
As a pilot, I wanted a conversation starter in my home office with other pilots, friends, and family. I came across this project on Phillip's website and thought this would be prefect! This project was fairly easy for me but I have a vast knowledge in all areas of this project (computers, carpentry, and electronics). Aside from that this project combined my love of aviation, computers, and electronics. I built my METAR Map based off of Phillip's project but with a few differences listed below.
● 48x36 map (Phillip's map was 16x20)
● Raspberry Pi 3 B+ (Phillip used a Raspberry Pi Zero W)
● 150 LEDs (95 airports) (Phillip used 22 airports)
● 5V 10A 50W Power Supply (Phillip used the 5V power from the Raspberry Pi Zero W)
● handmade frame constructed of 1x2 Poplar (Phillip purchased his frame)
● 7 different sectional charts to form a single map (Phillip used one sectional map)
The details about everything I did in this project (Raspberry Pi programming, wiring, testing LEDs, building the map, the frame, etc.) are all detailed below. In the end, I was displaying METAR data for 95 airports that were centered around Montgomery, Alabama. The reason I had to use so may sectional charts is because Montgomery, Alabama sits in the left, bottom corner of the Atlanta sectional chart so I had to piece together sectional charts from Atlanta, New Orleans, Jacksonville, and Memphis to form a single map.
Materials List
If you are using 50 LEDs or less then the Raspberry Pi Zero W/WH would work great. This is a much smaller version of of the Raspberry Pi 3 that has wireless capabilities. The processor is smaller which is why you wouldn't want to use more than 50 LEDs with the Raspberry Pi Zero W/WH. The advantage of the Raspberry Pi Zero W/WH is the cost! It is the cheapest and smallest Raspberry Pi. The W indicates that it is wireless (WiFi) and WH is wireless with header pins.
Raspberry Pi 3 B+ (I used this one)
If you are using more than 50 LEDs then the Raspberry Pi 3 B+ is what you'd want to use. This has a bigger form factor than the Raspberry Pi Zero W but it has the processing power to be more responsive for 50+ LEDs. I certianly would not exceed 150 LEDs with the Raspberry Pi 3 B+ because the processing power for managing more than 150 LEDs and processing the data for more than 150 weather stations (airports) just isn't there and the Raspberry Pi 3 B+ can become very sluggish. The biggest advantage is that with the release of the Raspberry Pi 4 Model B, the price of the Raspberry Pi 3 B+ has dropped a lot.
Raspberry Pi 4 B
If you want to use more than 150 LEDs then you should try the Raspberry Pi 4 B. The Raspberry Pi 4 B is available in either 2GB, 4GB, or 8GB of RAM. The processing power is slightly faster than the Raspberry Pi 3 B+. It has more processing power and is about the same size and cost as the Raspberry Pi 3 B+. I will say that if I did a project of this size again I would use a Raspberry Pi 4 B with 4GB of RAM.
Pi Version | Processor | RAM | Wireless | Ethernet |
---|---|---|---|---|
Raspberry Pi Zero | 1-GHz, 1-core | 512MB | ||
Raspberry Pi Zero W | 1-GHz, 1-core | 512MB | 802.11n | |
Raspberry Pi Zero WH | 1-GHz, 1-core | 512MB | 802.11n | |
Raspberry Pi 3 B+ | 1.4-GHz, 4-core | 512MB/1GB | 802.11ac | Ethernet |
Raspberry Pi 4 B | 1.5-GHz, 4-core | 2GB/4GB/6GB | 802.11ac | Gigabit Ethernet |
There are several different LED strands so be careful on what you purchase. The ALITOVE WS2811's work perfect and can be purchased in strands of 50 LEDs (strands can be connected together). If you do not purchase these LEDs make sure you know and understand what you are purchasing because some LEDs are 12v versus 5v, some are not addressable, and some cannot be connected to other strands. If you are going to use more than 20 LEDs then you will need an external power supply. The Raspberry Pi can power 20 or so LEDs but they will get dimmer the more you add due to the power draw. The power draw for each ALITOVE WS2811 LED is 0.3W. I used the 5V 10A 50W Power Supply because I was powering 95 LEDs. If you choose to not use the LEDs below, make sure you are using NeoPixels or you may need to re-write some code and make sure that multiple strands can be connected together because some LED strands cannot be extended (aka one strand connected to another strand).
This is for the outer wood frame. Depending on the size of your map you may be able to use 6' 1x3's instead of 8' 1x3's. You will need a total of two strips. You will also need a few finish nails or brads and some wood glue. I used a brad nailer and Elmer's wood glue.
1x2x8 Poplar
This is for the face of the wood frame. Depending on the size of your map you may be able to use 6' 1x2's instead of 8' 1x2's. You will need a total of two strips. You will also need a few finish nails or brads and some wood glue. I used a brad nailer and Elmer's wood glue.
3/4-in x 8-ft Pine Moulding (optional)
I used this on the back side of the foam board to hold it in the frame and as a horizontal brace on the back of the foam board to keep it flat due to it being so wide (36"). You could use hot glue or a few nails that you can bend over to hold the map in place. I just cut small strips and glued them into place.
Make sure you get two IF you need the front and back. A sectional chart is two-sided with the bottom half of the area covered on one side and the top half of the area on the other side. For my project I had to purchase 5 sectional maps because Montgomery, AL sits in the bottom left corner of the Atlanta sectional so I needed two Atlanta sectionals (top and bottom), New Orleans (for the area south of Montgomery), Jacksonville (for the area south of Atlanta; north Florida), and Memphis (for the west of Birmingham, AL). If you project is small enough you may only have to purchase one sectional chart. To know what charts to purchase, the link below goes to the FAA's sectional charts (PDF's) so you can see what areas are covered.
NOTE: See the map section for where sectional maps can be purchased.
TV/keyboard/HDMI cable/mouse
This is used to connect to the Raspberry Pi so that it can be setup.
Foam board
This is used as the backing to which the sectional charts are glued to. For this you should double the foam board using wood glue (if compatible; mine is) and use weight to keep the pieces tight until the glue can set. Then use Elmer's glue to glue the sectional charts to the foam board.
Foam board
This is used as the backing to which the sectional charts are glued to. For this you should double the foam board using wood glue (if compatible; mine is) and use weight to keep the pieces tight until the glue can set. Then use Elmer's glue to glue the sectional charts to the foam board.
3pin JST connectors
This is used to extend the LED strand since the LEDs are only a couple inches apart.
Dupont wires/Jumper wires
This is used to connect the the Raspberry Pi to the 3pin JST connector. It is called a Dupont wire or jumper wire for breadboards.
Spackle/Wood Filler
This is used fill in gaps and nail holes on the frame. If you are painting the frame then use a small tub of spackle but if you are going to stain the frame then use a stain-compatible wood filler.
heat shrink tubing
This is used to protect the wire joint on the connector cable and on LED extension cables.
Elmer's Glue-All
This is used to glue the foam board together and then to glue the sectional chart(s) to the foam board.
Tools List
● sander with light grit sandpaper for a nice smooth finish
● drill
● 5/16" metal drill bit
● quick-grip clamps (click here to view)
● mitter saw (click here to view)
● brad nailer with brads (click here to view)
● tape measure
● Swanson speed square (click here to view)
● framing square (click here to view)
● box blader/X-ACTO knife (click here to view)
● straight edge (T-square or 4' level) (click here to view)
The Steps to Build the METAR Map
The Raspberry Pi
Connect the Raspberry Pi to your TV/monitor, keyboard, and mouse with the SD card inserted into the Raspberry Pi. Turn it on and select the Raspbian with Desktop
operating
system, set the timezone, and choose the wireless network.
Copy the following files by opening them in the web browser on the Raspberry Pi, copy the code, and then paste the code in the file that you created on the Raspberry Pi. So open the file
manager and go to /home/pi
then right-click on the right side and choose New File...
and name it with the same file name as on the web page, for example metar.py
.
Next, copy the code from the web page and paste it inside the new file and save the file. Do this for the following files.
NOTE: The airports file does not have a file extention, it is
just airports
Open a terminal window and type the following to update the operating system packages.
Now type the following to upgrade the operating system packages.
Now type the following to install python3 and pip.
Now type the following to install remote desktop so that you can access the Raspberry Pi from your desktop or laptop. The hostname command is to get the local ip address of the Raspberry Pi. When you remote into the Raspberry Pi, just connect to this ip address. The default username should be pi and the password should be raspberry.
Next install the required libraries for the project. On Phillip's GitHub project page, located here, only two libraries are listed but there are actually three libraries that are required for the NeoPixels to work, as detailed here. The required libraries are rpi_ws281x, adafruit-circuitpython-neopixel, and adafruit-blinka. Running the following command lines will install these libraries.
Now you can shutdown the Raspberry Pi and proceed to the section 2.
Wiring the LEDs
Make sure your Raspberry Pi is turned off before proceeding!
Raspberry Pi pins used by the connector cable
If you are using the ALITOVE WS2811 LEDs from Amazon that I used then you will need to create a connector cable (figure 1a and figure 1b). Other brands of WS2811 may be different than
the ALITOVE brand. If you look close on the circuit boards below each ALITOVE WS2811 LED, on one side you will see a white arrow pointing up and below that you will see GND, DI, and +5V (figure 1c).
GND is the ground wire, DI is the signal wire that controls how bright a LED is and what color the LED is, and +5V is the power lead for the LED. I do not know why it is labeled as +5V because applying more than
5V to the LED strand can damage it. The white arrow indicates that the signal flows in that direction and that the signal comes from the Raspberry Pi and goes in this direction. The wire colors on the 3pin JST connector did not match
the 3-conductor wires on the LED strand but that is to be expected. The blue LED wire (ground and white on the JST connector) will connect to pin 39 (ground on the Raspberry Pi) and the white LED wire
(signal and green wire on the JST connector) will connect to pin 40 which is GPIO21. If you decide to use GPIO21, you will need to change the line in the configuration section in each of
the files from D18 to D21. I had to use GPIO21 so I had to change the LED_PIN
value from board.D18
to board.D21
. GPIO18 and GPIO21 are both PCM. There is a difference
between them that is important and it is because of that difference that I had to use GPIO21 and not GPIO18. Because they are both PCM there isn't an issue with the size of the signal data changing.
Basically, you can control 5,400 LEDs in a single strand using PCM. Information on the differences between PWM, PCM, and SPI can be found
here.
GPIO18 vs GPIO21
While both GPIO18 and GPIO21 are both PCM (pulse code modulation) they operate on different signal voltages. GPIO18 operates on the 3.3V supply rail
while GPIO21 operates on the 5V supply rail. Can you use GPIO18 with the ALITOVE WS2811 LEDs? Sure. You just need to add a logic shifter,
here, to convert the 3.3V signal to a 5V signal. To avoid this I used GPIO21. More information on the GPIO18 pin can be found
here and information on the GPIO21 pin can be found
here.
Connector Cable
To create the cable, peel two wires with a female dupont connector to match your 3pin male JST connector. My 3pin male JST connector had red, green,
and white. The red wire is for power and since we are not getting power from the Raspberry Pi I cut this wire short (figure 1b). I then chose a green and white wire with a female dupont connector on one
end and a male on the other end. I cut the male connectors off and attached these two wires to the 3pin male JST connector. Before attaching the wires I slipped some heat shrink tubing over the wires
(figure 1a and figure 1b). You can now connect this cable to the ALITOVE WS2811 LED strand (figure 1c).
NOTE: If you are going to light about 20 LEDs or less then you can get the power from one of the 5v pins (pins 2 or 4) on the Raspberry Pi (figure 2a); however, if you are going to light more than 20 LEDs then you will most likely need an external power supply (figure 2b) because the LEDs will be very dim due to the current draw. NEVER CONNECT THE PASPBERRY PI POWER TO THE EXTERNAL POWER SUPPLY! This will damage the Raspberry Pi rendering the GPIO pins useless.
Now you can connect the female barrel connector for the power to the ALITOVE WS2811 LED strand (figure 3).
The GPIO pin layout (figure 4a) is the same for the Raspberry Pi 3B/3B+/4B (figure 4b) and Raspberry Pi Zero W/WH (figure 4c).
Figure 1a. Raspberry Pi to WS2811 Connector Cable
Figure 1b. Raspberry Pi to WS2811 Connector Cable
Figure 2a. Power from the Raspberry Pi
Orginal image is
here
Figure 2b. Power from an external power supply
Orginal image is
here
Figure 3. Power from an external power supply for the ALITOVE WS2811 LEDs. The wiring to the Raspberry Pi in this photo was temporary for testing purposes. I then built the connector cable.
Figure 4a. GPIO Layout for Raspberry Pi 3 B/3 B+/Zero
Figure 4b. GPIO Layout for Raspberry Pi 3 B/B+/4 B
Figure 4c. GPIO Layout for Raspberry Pi Zero
Testing the LEDs
Now turn your Raspberry Pi on and open the file manager and go to /home/pi
then right-click on test_lights_all.py
and
choose 'Text Editor'. Change the LED_COUNT and LED_PIN if needed. If you want to test eight colors on each LED then change the TEST_COLORS
value to True
and save your changes
and exit the text editor. You should see the lights cycle between green, red, and blue for 2 seconds on each color to make sure all the LEDs work and then they will turn off. If you changed the
TEST_COLORS
value to True
then each LED will cycle through eight colors before moving to the next LED in the strand. If they worked, proceed to the next section (section 3).
Note that setting the TEST_COLORS
value to True
will test each LED for 5 seconds so 50 LEDs will take slightly more than 4 minutes to complete. Open a terminal window and
type the following to test the lights. NOTE: If you are not logging in with pi then the user needs root permissions to access the GPIO pins.
Building the Frame
The steps in this section are for building a 36x24 frame.
The outer frame (frame box)
First we will build the outer frame and then the frame face. Using a mitter saw (figure 5), cut two pieces of 1x3 Poplar measuring 24-1/2" long (these will be the top and bottom pieces).
Next, cut two pieces of 1x3 Poplar measuring 37-1/2" long (these will be the side pieces). The 24-1/2" long pieces will sit INSIDE the 37-1/2" long pieces. Now, put a little wood glue on the end of one
of the 24-1/2" long pieces and butt it against one of the 37-1/2" long pieces. Make sure the 24-1/2" long piece is flush with the end of the 37-1/2" long piece. Once it is flush, shoot two brad nails
into the end to hold it in place. Repeat this for the other end of the 37-1/2" long piece. And finally, do the same thing for the other 24-1/2" long piece. Once finished, the 24-1/2" long pieces should
be INSIDE the 37-1/2" long pieces. The inside measurements should be 36-1/2 x 24-1/2. The extra 1/2" will give a little play for the map to sit proplerly in the frame once we are done. Now take one
piece of a 1x1 or 1x2 and nail it across one corner (figure 6) after checking it with the speed square or framing square (figure 7) to ensure it is a perfect 90 degree angle. Then, repeat this for each
corner. If it is not a perfect 90 degree angle either you miscut a piece or misplaced a piece.
The frame face
Using the mitter saw, set the angle of the mitter saw (unplugged)to 45 degrees using a speed square to ensure a proper and tight 45 degree angle for the frame pieces that will be the
face. Next, plug in the mitter saw and cut one of the ends of the 1x2 Poplar at a 45 degree angle. Now take a tape measure and hook it on the point of the 45 degree angle and measure 37-1/2" with the
1x2 laying flat (not on edge) and mark it. Flip the 1x2 like a batton. The end that you just cut should have the 45 degree angle coming towards you, if not you flipped it wrong. You want the points of
the 45 degree angle on the same edge of the 1x2. Adjust the wood on the mitter saw to cut a tight 45 degree angle and cut it. Repeat this again so you have two pieces that are 37-1/2" long. Now do the
same thing again except this time the two pieces will be 37-1/2" (verify this by measuring the top or bottom of the outer frame). Now, put some glue on one side of the outer frame (the outer frame
should sit with the two corner braces on the bottom) and clamp the frame face to the outer frame ensuring that the edge is flush and the tips of the 45 degree angles are flush with the edges of the
outer frame. Once you are satisfied with it, shoot a few brads into the frame face to secure it to the outer frame. Repeat this process working your way around the outer frame. If your last piece is a
little bit short then just center it as best as you can because we will hide this in the next step.
Filling in gaps and painting/staining
Using either spackle or wood filler, fill in the nail holes and gaps around the frame (figure 8). Let this dry overnight and
then sand it down with some light grit sandpaper but nothing too rough because you want a nice smooth finish. Once you are satisfied with this step then you can remove the braces and paint or stain the
frame. I used Minwax solid color stain (black) (figure 9 and figure 10). This is actually a paint and not a stain so I rolled and brushed it on.
Figure 9. Minwax solid color stain (black)
Building the Map
Foam board
Get two pieces of foam board that measure 36x24. Using Elmer's glue, glue the two foam board pieces together making sure that the edges are flush all the way around and then put weight on
them such as books to keep them pressed together until the glue has fully cured.
Sectional maps
Use the sectional maps (called VFR Raster Charts) on the FAA's website here
to determine what sectional maps you will need for your METAR map and order them from Sporty's or
My Pilot Store. Start with the sectional map that has the airport or city that you want in the
center of your METAR map and then measure 24" with the 12" mark on the airport or city that you want in the center and mark at the end of the tape measure and at the 24" mark with a sharpie so that it can
be seen. Next, measure vertically 36" with the 18" mark over the airport or city and again mark the end of the tape measure and the 36" mark. If you need more than one sectional map, cut along a line of
latitude or longitude and join the maps together at a line of latitude or longitude (figure 11 and figure 12). Cut the map with a straight edge and razor (scissors will be too jagged to make a tight fit)
(figure 13). Once the foam boards are cured/bonded then you can glue the sectional map(s) to the foam board with Elmer's glue (figure 14). Make sure you spread the glue across the surface of the foam
board. This will prevent the sectional map from being torn when you drill the holes for the LEDs. If the map is loose, it will tear.
Figure 11. Joint along a line of latitude/longitude
Figure 12. Joint along a line of latitude/longitude
Figure 13. Cutting the sectional map with a straight edge
Installing the LEDs
Drilling holes for the LEDs
You can only get weather information from airports that have ATIS, AWOS, or ASOS information. Verify that the airport is listed
here before you drill the hole! With that in mind, mark your airport
locations with numbers (figure 15) to determine not only spacing but the number of LEDs required for your METAR map. If an airport is too close to the edge, skip it
because you don't want the frame face to interfere with the LED. Next, drill a hole using a 5/16" metal drill bit
on or next to each airport that you want to display METAR information for. I drilled mine directly over the airport symbols. The reason for the metal bit is because it won't tear the sectional map if
drilled properly but a wood bit will definitely
tear the sectional map. Make sure the area where you are drilling on the map is glued really well. If not, cut the map with an X-ACTO knife so that you can glue the area down really good by slipping
some glue through the hole you cut. This is the
key to the sectional map not tearing when you drill through it.
Adding the LEDs to the map
If you didn't draw out how your wiring will be laid out, now is a good time! Place the map in the frame and if you are satisfied with the
position then attach the map to the frame with either some hot glue or short pieces of pine moulding (Figure 15). Now you can add the LEDs to the map. Not every LED on the strand has to be used. The
spacing of the LEDs is only a couple of inches so if a LED isn't used and is behind the map, that is ok. It can be skipped in the sequence (Figure 16). You can splice in an extension to space out
some of the LEDs if needed but the signal will become degraded if the extensionn is too long. The LEDs will sit flush to the map in my project. The LED is actually narrower than the housing of the LED so
I pressed the LED into the back of the foam board so that the tip of the LED will sit flush against the map and then I would add hot glue (super glue may be better) to hold it in place. I would glue about
5-7 LEDs at a time and then get the next 5-7 LEDs in place. I knew how the LED strand would run because after drilling the holes I drew a lines between each hole on the back like connecting-the-dots. I
also measured the space between the LEDs on the strand and compared this to the spacing on back of the foam board based on the lines that I drew. This allowed me to identify where and how many LEDs
would be skipped so based on my measurements I would mark how many LEDs would be skipped on the lines that I drew on the back.
Test the LEDs and wiring
Once the LEDs are set in place on the map, connect the Raspberry Pi and all other wiring. Now we need to test the LEDs and wiring again.
Open File Manager and adjust the configuration
values for both test_lights_all.py
and test_lights_single.py
if needed. The LED_COUNT is the total LEDs in the strand(s), not the number of airport LEDs used. Only change the
value for TEST_COLORS
to True
in test_lights_all.py
if you want to test each LED using eight specific colors BEFORE you can identify each LED. Since this will
take a few minutes depending upon the length of your LED strand, the initial value is set to False
. If the LEDs worked then proceed to identifying the airports. Open a terminal window and
run the following line.
Identify which LED goes with which airport
Open the airports
file and look at the list and how it is formatted (capital letters and some NULL words) then
remove all the airports listed. Now run the following line.
Each LED will be lit green starting with LED 1. Now look at what airport this is and add it to the airports
file with the first airport at the top, the second airport below
the first, etc. You must list the ICAO code of the airport. The ICAO code
can be obtained/verified here. Press the 'Enter' key and repeat this process for each airport. If you did not
use all the
LEDs then some LEDs will be turned on behind the map. For a LED that is skipped or not used, type NULL
in the airports
file and then proceed to the next LED.
Starting it automatically
The last step is to setup the script to run automatically when you power/turn on the Raspberry Pi. To do this you need to edit the
crontab
(the task scheduler) by running the command below. This is one of the ways to automatically execute a scrpt(s) on a schedule. You need to edit the crontab and add the last two
lines in Phillip's sample crontab file, which is
here. This will run the refresh.sh
script every 5 minutes (the */5) between the hours of 7 to 21
(7am-9pm), which includes the 21 hour, so it means it will run until 21:55 (9:55pm). Then at 22:05 (10:05pm) it will run the lightsoff.sh
script, which will turn all the lights off. Adjust
these as needed. To save the crontab
press Ctrl + X (^X), confirm the overwrite with a 'Y', and for the location just press 'Enter'. This means the script will be executed Next, you have
to set execute and read permissions on certian files by following the command lines listed below. chmod +x filename
sets the file to execute and chmod +r filename
sets the
file to read.
Add the following two lines to the bottom of crontab
.
*/5 7-21 * * * /home/pi/refresh.sh
05 22 * * * /home/pi/lightsoff.sh
To save and exit press ctrl+x.
Now reboot the Raspberry Pi and leave it alone. Give it a couple minutes to aquire the METAR data and the LEDs should light up automatically.
To test refresh.sh
or lightsoff.sh
, just type the following command in a terminal window.
NOTE: If you need to test the LEDs after you set the crontab
and file permissions, you will need to remove some of the file permissions. You can
remove the file permissions using the following commands below. Now, you can test the LEDs. If you do not do this then during the LED test, if the refresh.sh
file is executed (executed
every 5 minutes), then it will conflict with the LED
test and your LEDs will not work and the LED test script will freeze.
Don't forget to put the permissions back when you are done
Advanced Scheduling
This section expands on the sample crontab that Phillip created (located here). In the task
scheduler (aka crontab), tasks are scheduled using a specific format on a single line that
contains six elements that are seperated by a single space. From left to right they are:
minutes / hours / days of month / months / days of week / the command to execute
Example:
*/5 7-21 * * * /home/pi/refresh.sh
Formatting
Using the minutes as an example, they are a number between 0 to 59. Minutes can be entered on the scheduling line as either an asterisk (representing all values), a number between 0-59, a comma
seperated list of numbers, a range of numbers, step values, or a combination of any of these commands.
Using an "*"
This means any value and will execute the script at every minute. For example, the script will execute every minute of the hour.
Using a number between 0 and 59
This will execute at a specific minute. For example, 5 would mean that the script will execute 5 minutes after the hour.
Using a comma seperated list of numbers
This will execute the script at specific minutes. For example, 15,20,40,45 would result in the script executing at minutes 15, 20, 40, and 45 after the hour.
Using a range
This is entered using a dash. For example, 5-45 would result in the script executing every minute between minutes 5 and 45 of the hour.
Using a step value
This would cause the script to be executed in a specific increment. For example, */5 would execute the script every 5 minutes of an hour (the equivalent of 5,10,15,20,25,30,35,40,45,50,55).
Issues/Debugging
If you have issues with the script, look at the comments at the bottom of Phillip's build log
here or my project Facebook group.
Additional Features
There are additional features in Philip Rueker's project that can be enabled/disabled. Details on these features are here on his project page.
Created by Robert Keith · © 2024