Skip to content

gazunder/dc-metro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Washington DC Metro Train Sign

This project contains the source code to create your own Washington DC Metro sign. It was written using CircuitPython targeting the Adafruit Matrix Portal and is optimized for 64x32 RGB LED matrices.

Board Showing Train Arriving

How To

Hardware

Tools

  • A small phillips head screwdriver
  • A hot glue gun (optional)
  • Tape (optional)

Part 1: Prepare the Board

  1. Use a hot glue gun to cover the sharp screws on the right-hand side of the 64x32 LED matrix. This step is optional, but it will prevent wire chafing later on.

    64x32 Matrix with Hot Glue on Screws

  2. Lightly screw in the phillips head screws into the posts on the Matrix Portal. These only need to go down about 60% of the way.

    Matrix Portal with Screws

  3. Using the power cable provided with 64x32 matrix, slide the prong for the red power cable between the post and the screw on the port labeled 5v. Tighten down this screw all the way using your screwdriver. Repeat the same for the black power cable and the GND port.

    Matrix Portal with Separate Cables Matrix Portal with Connected Cables

  4. Connect the Matrix Portal to the large connector on the left-hand side of the back of the 64x32 matrix.

    64x32 Matrix with Connector Highlighted

  5. Plug one of the power connectors into the right-hand side of the 64x32 matrix.

    64x32 Matrix with Power Connected

  6. You can use masking tape (or painter's tape) to prevent the cables from flopping around.

    64x32 Matrix with Cable Management

Part 2: Loading the Software

  1. Connect the board to your computer using a USB C cable. Double click the button on the board labeled RESET. The board should mount onto your computer as a storage volume, most likely named MATRIXBOOT.

    Matrix Connected via USB

  2. Flash your Matrix Portal with the latest release of CircuitPython 6.

    • Download the firmware from Adafruit.
    • Drag the downloaded .uf2 file into the root of the MATRIXBOOT volume.
    • The board will automatically flash the version of CircuitPython and remount as CIRCUITPY.
    • If something goes wrong, refer to the Adafruit Documentation.
  3. Decompress the lib.zip file from this repository into the root of the CIRCUITPY volume. There should be one folder named lib, with a plethora of files underneath. You can delete lib.zip from the CIRCUITPY volume, as it's no longer needed.

    Lib Decompressed

  4. Copy all of the Python files from src in this repository into the root of the CIRCUITPY volume.

    Source Files

  5. The board should now light up with a loading screen, but we've still got some work to do.

    Loading Sign

Part 3: Getting a WMATA API Key

  1. Create a WMATA developer account on WMATA's Developer Website.
  2. After your account is created, add the Default Tier subscription to your account on this page.
  3. After doing this, you will be redirected to your profile.
  4. Under the Subscriptions section on your profile, select the show button beside the Primary Key. This is the key that allows the board to communicate with WMATA.

Part 4: Configuring the Board

  1. Open the config.py file located in the root of the CIRCUITPY volume.
  2. Fill in your WiFi SSID and password under the Network Configuration section.
  3. Under the Metro Configuration section:
    1. Select your station and lines from the Metro Station Codes table, and set the metro_station_code value to the corresponding value in the table.
    2. For train_group, the value needs to be either '1' or '2'. This determines which platform's arrival times will be displayed. This value isn't well documented by WMATA, so your best bet is to try one value, and if it's the wrong direction, use the other value.
    3. Set the metro_api_key value to the API key you got from Part 3.
  4. At the end, the first part of your configuration file should look similar this:
#########################
# Network Configuration #
#########################

# WIFI Network SSID
'wifi_ssid': 'Grindr Pickup Zone',

# WIFI Password
'wifi_password': 'MyMetroBoardBringsTheBoisToTheNavyYard',

#########################
# Metro Configuration   #
#########################

# Metro Station Code
'metro_station_code': 'D02',

# Metro Train Group
'train_group': '2',

# API Key for WMATA
'metro_api_key': 'd3adb33fd3adb33fd3adb33f',
  1. After you save this file, your board should refresh and connect to WMATA.

Troubleshooting

If something goes wrong, take a peek at the Adafruit Documentation. Additionally, you can connect to the board using a serial connection to gain access to its logging.

Appendix

DC Metro Station Codes

Name Lines Code
Addison Road-Seat Pleasant BL, SV G03
Anacostia GR F06
Archives-Navy Memorial-Penn Quarter GR, YL F02
Arlington Cemetery BL C06
Ballston-MU OR, SV K04
Benning Road BL, SV G01
Bethesda RD A09
Braddock Road BL, YL C12
Branch Ave GR F11
Brookland-CUA RD B05
Capitol Heights BL, SV G02
Capitol South BL, OR, SV D05
Cheverly OR D11
Clarendon OR, SV K02
Cleveland Park RD A05
College Park-U of Md GR E09
Columbia Heights GR, YL E04
Congress Heights GR F07
Court House OR, SV K01
Crystal City BL, YL C09
Deanwood OR D10
Dunn Loring-Merrifield OR K07
Dupont Circle RD A03
East Falls Church OR, SV K05
Eastern Market BL, OR, SV D06
Eisenhower Avenue YL C14
Farragut North RD A02
Farragut West BL, OR, SV C03
Federal Center SW BL, OR, SV D04
Federal Triangle BL, OR, SV D01
Foggy Bottom-GWU BL, OR, SV C04
Forest Glen RD B09
Fort Totten RD B06
Fort Totten GR, YL E06
Franconia-Springfield BL J03
Friendship Heights RD A08
Gallery Pl-Chinatown RD B01
Gallery Pl-Chinatown GR, YL F01
Georgia Ave-Petworth GR, YL E05
Glenmont RD B11
Greenbelt GR E10
Greensboro SV N03
Grosvenor-Strathmore RD A11
Huntington YL C15
Judiciary Square RD B02
King St-Old Town BL, YL C13
L'Enfant Plaza BL, OR, SV D03
L'Enfant Plaza GR, YL F03
Landover OR D12
Largo Town Center BL, SV G05
McLean SV N01
McPherson Square BL, OR, SV C02
Medical Center RD A10
Metro Center RD A01
Metro Center BL, OR, SV C01
Minnesota Ave OR D09
Morgan Boulevard BL, SV G04
Mt Vernon Sq 7th St-Convention Center GR, YL E01
Navy Yard-Ballpark GR F05
Naylor Road GR F09
New Carrollton OR D13
NoMa-Gallaudet U RD B35
Pentagon BL, YL C07
Pentagon City BL, YL C08
Potomac Ave BL, OR, SV D07
Prince George's Plaza GR E08
Rhode Island Ave-Brentwood RD B04
Rockville RD A14
Ronald Reagan Washington National Airport BL, YL C10
Rosslyn BL, OR, SV C05
Shady Grove RD A15
Shaw-Howard U GR, YL E02
Silver Spring RD B08
Smithsonian BL, OR, SV D02
Southern Avenue GR F08
Spring Hill SV N04
Stadium-Armory BL, OR, SV D08
Suitland GR F10
Takoma RD B07
Tenleytown-AU RD A07
Twinbrook RD A13
Tysons Corner SV N02
U Street/African-Amer Civil War Memorial/Cardozo GR, YL E03
Union Station RD B03
Van Dorn Street BL J02
Van Ness-UDC RD A06
Vienna/Fairfax-GMU OR K08
Virginia Square-GMU OR, SV K03
Waterfront GR F04
West Falls Church-VT/UVA OR K06
West Hyattsville GR E07
Wheaton RD B10
White Flint RD A12
Wiehle-Reston East SV N06
Woodley Park-Zoo/Adams Morgan RD A04

About

This is the home for the software that can turn a 64x32 RGB LED matrix into a WMATA Metro sign.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%