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

Monday, August 1, 2016

Gaze Across the Solar System with a 3D-Printed, Raspberry Pi TelescopeThese moon photos were taken by Brett Porter with his PiKon telescope.

https://school.codequs.com/p/SkuuRcw_

The PiKon telescope is a DIY astro-camera you can easily build at home, based on two disruptive technologies: 3D printing and Raspberry Pi cameras. Andy Kirby and I started it as a project for Sheffield University’s “Festival of the Mind” in September 2014 (with much duct tape and over-engineering!). We wanted to show how these technologies could put a homemade reflector telescope within the reach of anyone. The response was fantastic, with national press coverage in the U.K., and a successful Indiegogo campaign partnering with Darren Barker and WeDo3DPrinting in Sheffield.

We’re now offering everything from 3D files to a complete kit with 3D-printed components and optics. We even offer fully built PiKons for those who just want to create Raspberry Pi programs for astronomy. But we’re sharing our design and 3D files freely because we hope to establish a community where makers, astronomers, Pi programmers, and educators can share information, experiences, and of course, images.

HOW IT WORKS

The PiKon telescope is based on the Newtonian reflecting telescope. This 350-year-old design uses a concave mirror (objective) to form an image, which is examined using an eyepiece. The objective mirror is mounted in a tube and a secondary mirror is placed in the optical path at a 45° angle to allow the image to be viewed from the side of the tube.

The PiKon telescope is similar, but the image formed by the objective is focused onto a digital camera sensor instead. Because of the small size of the Pi camera board (25mm × 25mm), we can mount it directly in the optical path at prime focus. The amount of light lost by doing this is similar to the losses caused by mounting the 45° mirror in a conventional Newtonian design.

https://school.codequs.com/p/SkuuRcw_

BUILDING YOUR OWN PIKON

The PiKon telescope consists of two main assemblies based on 3D-printed parts. At the bottom of the scope, the mirror assembly holds a standard 4½” diameter spherical mirror.

https://school.codequs.com/p/SkuuRcw_

At the top of the scope, the spider assembly supports the Pi camera and lets you move it back and forth along the telescope axis to focus the image, using a rack and pinion setup. The camera sensor is exposed by unscrewing the lens on the Pi camera.

https://school.codequs.com/p/SkuuRcw_

The two assemblies are mounted into a simple telescope tube made of 6″ plastic pipe. In the U.K. we use ventilation duct; in the U.S., Scott Miller of San Francisco Amateur Astronomers worked with Make: to modify the 3D parts to fit standard PVC pipe.

Finally, we 3D printed an astronomical dovetail wedge mount that’s also fitted with a standard ¼-20 (¼” Whitworth) thread, so you can mount the telescope on either astro or photo tripods.

Images captured by the Pi camera can be viewed on a monitor plugged into the Raspberry Pi, then transferred to PC or Mac from the Pi’s microSD card or uploaded from the Pi straight to Dropbox (or similar) using an internet connection. (We’re excited to try it with the new Raspberry Pi 3’s built-in Wi-Fi!)

https://school.codequs.com/p/SkuuRcw_
These moon photos were taken by Brett Porter with his PiKon telescope.

https://school.codequs.com/p/SkuuRcw_

MIRRORS AND MAGNIFICATION

The PiKon telescope has a magnification factor of about 120X (based on the 600mm focal length and 3.6mm×2.4mm camera sensor) and a field of view of about ¼ degree. The moon subtends ½ degree at your eyeball, so the PiKon can see about half the moon at a time.

Spherical or parabolic mirrors can be used. Different focal lengths may also be used; just cut the telescope tube to length accordingly. To determine the focal length of a third-party mirror, simply image a distant object onto a piece of paper and measure the distance between mirror and paper. The PiKon is designed with a long travel on the focusing rack so it’s forgiving of small inaccuracies in measurement.

ASSEMBLY

UK builders can proceed directly to the PiKon assembly instructions online at PiKon’s Dropbox. These include a complete illustrated materials list, step-by-step photos, and tips for printing your own parts.  This page also includes the latest STL files for you to download for 3D printing.

US builders should first download the 3D files that Scott Miller is using with US-standard 5″ PVC pipe. Then proceed to the PiKon Assembly Instructions online at PiKon’s Dropbox.

Builders in any country should inspect all of these 3D files, and adjust their dimensions if necessary to fit standard pipe or duct that’s found in their area, different Pi enclosures, etc.

Here’s what Scott Miller had to say about his revised files in the US:

“I could not find lightweight 5 inch duct, so I used heavier 5 inch PVC pipe that had approximately the same inside diameter. I printed all of the UK files using black PLA and mounted them on the 5 inch PVC. (Except for the UK tripod mount because my scope was too heavy.)
“To improve aesthetics, I created three new parts printed with blue PLA:• Tubular adapter to fit over the front of the scope and covering the UK spider (Pipe Adapter.STL)• Round plate to attach to the back of the UK mirror base (Mirror Adapter.STL)• Tubular adapter to fit over back of the scope  (Mirror Extension.STL)I used the maximum length M8 bolts I could to attach the UK mirror mount to the UK mirror base and my mirror adapter, by trimming long M8 bolts to fit with a hacksaw.
“The UK Raspberry Pi Mount was too small for my Pi case, so I scaled it up a bit for a better fit.  (RaspPi Mount-scaled.STL)    I also printed and used two instead of just one of the UK Pi brackets that hold the Pi Mount to the telescope tube.
“I printed a more-weather-resistant Raspberry Pi case with red PLA by altering an OpenSCAD design I found on Thingiverse.  (raspi3-camera-top.STL and raspi3-camera-bottom.STL)
“Finally, to reduce the camera mount wobble/loose fit in the spider, I scaled up the width of the camera mount shaft and added a slight bezel to the shaft to provide more clearance with the cog I was using.  (camera mount-bezel.STL). “
TOUCHSCREEN CONTROL

https://school.codequs.com/p/SkuuRcw_

Brett Porter built the PiKon kit and wanted to make his telescope portable for field trips, so he baked his own touchscreen controller with a 2.8″ TFT display, 4 programmable buttons, and a 5200mAh lithium-ion battery that also powers the Pi and camera. It’s mounted right on the side of the scope. You’re looking at Brett’s moon photos above.

WIRELESS IPAD CONTROL

https://school.codequs.com/p/SkuuRcw_
Scott Miller’s PiKon telescope is controlled by his iPad.
If you’d rather take the control the telescope wirelessly, why not use a tablet? Scott Miller writes: “I’m using my iPad to control the PiKon via an ad-hoc network and the RPI-Cam-Web-Interface app instead of a hardwire connection to a PC.  The app allows you to take videos as well as images, and has a preview/download feature built in.”

Here are Scott’s “first light” moon photos:

https://school.codequs.com/p/SkuuRcw_
These moon photos were taken by Scott Miller with his PiKon telescope.
https://school.codequs.com/p/SkuuRcw_

https://school.codequs.com/p/SkuuRcw_

GOING FURTHER

One member of Newcastle Maker Space even mounted an accelerometer on the telescope to synchronize with a star map — we’re excited to hear more about that idea.

Build one and share your ideas with the community!
Written by :  Mark Wrigley and Matt Stultz

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