Wednesday, August 3, 2016

Build a DIY Weather Forecast Display With a Raspberry Pi and a LED Matrix_part1

LED Weather Words Forecast

This project utilizes a 22 x 13 matrix of addressable RGB LEDs to visualize a weather forecast pulled from the Weather Underground API.

A Raspberry Pi runs a python program designed to fetch weather forecast data from the API at regular intervals, parse the data into temperature, wind speed, and weather condition arrays, and then light specific sets of LED's that represent words in the LED matrix.

Mounted in its own enclosure, the project can set on a shelf, desk, or hang on a wall as a visual display for upcoming weather conditions over the next 12 hours.

The inspiration for this project comes from the beautiful LED Word Clocks that captured my imagination when they first began showing up on maker community forums. After a lot of research, tinkering, programming, and several failed attempts, I'm happy to have a version with a twist that I can share with the community that inspired me.

Step 1: Materials

Hardware

  • Raspberry Pi with Raspbian installed and configured to connect to the internet (for this project, I prototyped with the 3 and later installed the Zero*)
  • 5 Volt Power Supply, 4 Amps or greater
  • 2.1mm Female Barrel Jack Adapter or MicroB USB Connector (depending on your power supply jack)
  • Micro USB Connector Shell
  • Capacitor - 1000 µF, 6.3V or higher (I used a 1000µF, 16V that I had on hand)
  • Resistor (300 to 500 Ohm)
  • 74AHCT125 Level Converter
  • 5 Meters Addressable 5V RGB LED Strip (60 LEDs per meter) - 286 LED's are used in this project
  • Breadboard, Connecting Wires, and Headers

* Note that if you choose to use the Zero, you will need a USB hub, a Micro USB Male to USB Female Adapter, and a Mini HDMI to Standard HDMI Jack Adapter to interface with the Pi for software setup and troubleshooting.

Software

  • NeoPixel Library for Raspberry Pi - rpi_ws281x library (available here)
  • Program Files - apiboot.txt and weather_word.py (available here)
  • API key from WeatherUnderground (available here)
Other Materials

  • 11" x 14" Shadow Box Frame (or other enclosure to suit)
  • 11" x 17" Copy Paper and Transparency Film (Acetate)*
  • Cardboard
  • Black Garbage Bag
  • Vellum (optional)
  • Hot Melt Glue Gun and Glue (for mounting cardboard to cardboard)
  • Suitable Double Sided Tape (for mounting LED's, Breadboard, and Pi to cardboard)
  • Suitable Glue (for mounting printed templates to cardboard)

* Note that my local copy shop did not carry the needed transparency film. I purchased the film online in a bulk quantity which was an expense that was not anticipated at the start of this project. You might get lucky or be able to negotiate with a shop in your area on carrying this material.

Special Tools

  • You will need to be able to solder for this project. The rows of addressable LED's will need to be soldered together to connect their inputs and outputs. The Raspberry Pi Zero will need to have at least two headers soldered for GPIO connections.
  • Beside basic cutting tools (scissors and hobby knife), a craft/scrapbooking paper trimmer will aid greatly in cutting evenly dimensioned "light baffles" from thin cardboard.
  • Laser printer for printing on the transparency film (I utilized the local copy shop laser printer).

Templates


Step 2: Prepare the Bottom and Top Weather Word Templates




For this project, it will be important to center the bottom and top Weather Word Templates in the enclosure so that when the two are mounted together, the light baffles will lay between the rows and blocks of words.

Measure and record the innermost length and width of the enclosure. Mine measured 11" x 14-1/16". Cut a sturdy piece of cardboard to this dimension and check that it fits snuggly in the enclosure. This piece will serve as the base for mounting the LED's, light baffles, and assembled electronic hardware. Cut another sturdy piece of cardboard that is approximately 14" long and 4" wide. This piece will be cut into light baffle sides at a later step.

Print out two (2) copies of the "Bottom Word Template" on 11" x 17" paper. Be sure to print it at 100% scale (not "scaled to fit"). Measure and trim one of the templates to center it to the cardboard base. Glue this template firmly to the cardboard ensuring that the majority of the paper is adhered (this is important because the LED's and light baffles will be adhered to this base at a later step). Set the second copy of the Bottom Template aside for later reference (it will be useful for measuring and comparing your Top Templates at a later step).

Print out one (1) copy of the "Side Baffle Template" on 11" x 17" paper. Be sure to print it at 100% scale. The lines on this template are meant to align with the word rows on the bottom template and to serve as an aid for obtaining straight and square light baffle rows later in the project. Measure and trim the template to center it to the 14" x 4" piece of cardboard. Glue this template firmly to the cardboard ensuring that the majority of the paper is adhered.

Print out three (3) copies of the "Top Word Template" on 11" x 17" transparency film (acetate) using a laser printer (I utilized the local copy shop for this step). Again, be sure that these are printed at 100% scale. Also check that the top template is roughly centered on the width of the acetate (my enclosure width was exactly the width of my acetate ... maintaining centering at this step helped to ensure I was roughly centered to my bottom template). Before proceeding, compare the printed top templates to the saved copy of the bottom template. The two should be a close match (there will be some difference top to bottom as the acetate shrinks under the heat of the laser printing, but the difference should only be slight). Measure and trim each of the top templates to center them to the enclosure dimensions recorded previously and check that they fit snuggly in the enclosure. Align the words of each copy of the top template together and adhere the copies together using double sided tape.


Step 3: Prepare the LED Rows





The LED matrix consists of (22) rows of addressable RGB LED strips (13 LED's per row). Because the LED strips are purchased in meter plus lengths, each row for this project was cut across the copper terminal pads between the 13th and 14th LED of the purchased strip.

Use double sided tape to adhere each row of LED's to the bottom template. Start with the travel of the data from left to right on the top word row (look for the arrows on your LED strip) and then right to left on the next word row. Alternate the data travel in this fashion down through all 22 rows of the template.

The rows of LED's will be connected in groups of 5 (and then 2 at the end). All of the rows will be connected at the data points (to make a fully addressable block of 286 LED's) but the rows will only be powered in parallel groups of 5.

Before soldering the rows together, you might consider cutting holes or slots through the bottom template at the end of each row to feed the wire through. You can see from the pictures that I looped the wire directly between the rows and later needed to cut slots in the side baffles to accommodate. The baffle slots worked fine and did not cause any excess light bleed outside of the intended area, but they took extra time to cut and fit properly over the wires.

Now solder each row together using short (approximately 2") wire to connect GND-to-GND, DIN-to-DOUT, and VDC-to-VDC in the direction of data travel stopping at the end of the 5th row. Only solder the DIN-to-DOUT between the 5th and 6th row. Solder short wire to the GND and VDC of the 6th row and leave those free to connect power later. Continue in this fashion down all 22 rows of the template.

Step 4: Prepare the Light Baffles



Obtain some thin(ish) cardboard for cutting into light baffle rows (I used cereal boxes). Measure and trim the cardboard into (46) strips that are 8-5/8" long x 1" wide. Use double sided tape to adhere the strips together in pairs to obtain (23) light baffle rows (the baffles seemed flimsy individually and I thought that two together would provide better stability across the rows ... in hindsight this may of have been overkill, but I can't speak for whether a single strip is sufficient).

Cut an extra (5) strips for use as word block baffles at a later step.

Use a hot melt gun and glue to adhere each light baffle row to the line on the bottom template. Be sure to use plenty of glue and work quickly to obtain strong adhesion between the baffle rows and the bottom template. Also be sure to try to keep each baffle row aligned along and end-to-end of the printed bottom template line.

Measure and trim the 14" x 4" piece of cardboard with the adhered side baffle template into two strips that are 13-1/4" long x 1" wide. Fit check the sides to the bottom template. Each line on the side baffle template should align with the word rows on the bottom template. There should also be some overhang of the side baffle at the top and bottommost rows.

Use a hot melt gun and glue to adhere the side baffles along the left and right hand sides of the bottom word template. Again being sure to use plenty of glue and working quickly to obtain strong adhesion between the sides and the bottom template. Now use the hot melt glue to adhere each end of the baffle rows to the baffle sides.

Next, cut and adhere the (47) word block baffles. These baffles will block the light between the lighted weather words. Using the bottom template as a guide, trim individual block baffles and use hot melt glue to adhere each into place. Trim each to obtain a snug fit ... enough to block the light but not enough to distort the baffle rows.

The final step in the light baffle process is to cut a black plastic garbage/trash bag to size that completely covers the light baffles. The bag serves two purposes ... it diffuses the light from the bright LED's that can be seen through the clear transparency lettering and it serves as an additional black barrier to prevent the light from showing through the black transparency layers and highlighting the baffles behind.

As an optional step, I cut vellum paper to size and curved it slightly over the LED's in each word cell. This method cancelled the effect of seeing each individual LED when viewed directly through the clear transparency lettering.
Written by AughtNaughtZero

If you found this post interesting, follow and support us.
Suggest for you:

Raspberry Pi 3 Day Project: Retro Gaming Suite

IoT enabled Aeroponics using Raspberry Pi 3

Raspberry Pi: Full Stack

Hands on Internet of Things: Get started with a Raspberry Pi

No comments:

Post a Comment