Wooden LED Gaming Display Powered by Raspberry Pi Zero

44,588

571

84

Introduction: Wooden LED Gaming Display Powered by Raspberry Pi Zero

About: Old school maker doing all kinds of electronic projects. I love to play around with adressable LEDs. Raspberry Pi collector ;-)

This project realizes a 20x10 pixel WS2812 based LED display with a size of 78x35 cm which can be easily installed in the living room to play retro games. The first version of this matrix was built in 2016 and rebuilt by many other people. This experience was used to sum up all improvements to build a new version of the matrix and bring this now to instructables.com. Main new features are the update to a Raspberry Pi Zero instead using and Pi A plus an Arduino and replacing the previous large controller with a Bluetooth gamepad. Also the software was improved including the simulator, which allows you to develop the code on a computer even if you have no access to the matrix hardware.

One special feature of this LED matrix is the special wood veneer, which is used to cover the LED and to hide them, when LEDs are disabled. This highly increase the acceptance factor of non-tech people ;-) Of course, if this special veneer is not available in your country, you can also use some other diffuse material like acrylic to hide the LEDs. It is also planned to provide some key parts in the future to make it easier to rebuild the project.

Supplies:

  • Raspberry Pi Zero W (with some adaption, all other models will also work)
  • 200 LED/s s (WS2812B LED stripes with 30 LED/m)
  • 4x SPI LED matrix display with MAX7219
  • Cables
  • Bluetooth gamepad (e.g. this from Pimoroni)
  • Power Supply 5V with at least 5A
  • MDF wood for laser cutting
  • Wooden veneer or diffusion acrylic plate
  • Capacitor, Resistor
  • Some screws

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Laser Cutting

Base structure of the matrix is made of MDF wood with a thickness of 3mm and cut by a laser cutter. If you do not own a laser cutter, you can use an online service like ponoko.com or formulor.de or contact the next fablab/makerspace in your environment. It is also possible to use cardboard or other lighter materials but the attached files are design for 3mm thickness, so thinner or thicker materials need a redesign of the files. Design was done in Fusion 360.
Most of the parts hold together just by sliding them in place, only some of the parts like the outer borders should be glued together using wood glue. Ensure that your matrix is fully working before applying any glue! Also the wood veneer has to be glued on, but this is the last step after ensuring that everything works.

At the right (lower) side of the backplane, there is a cut out segment to secure the electronic components to the matrix and still have access to this components when the veneer is glued on.

Step 2: Install LEDs

The LED stripes are standard 30 LED/m WS2812 stripes, which are available at Amazon, eBay or other online stores all over the world. This is normally also the cheapest addressable LED stripe available. If you want to use other LEDs, you have to ensure the 30 LED/m distance to fit to the matrix pattern. The lasercutted segments have small cut out regions to fit to the LED width of 10 cm. This LED stripes have double-sided tape on their back, so you can just glue them directly to the MDF after precise positioning. Check the correct orientation of every stripe before using the tape (DIN-DOUT direction).

Wiring pattern is a zig-zag so at the end, there is only one input pin to the matrix and cable lengths are as short as possible. To proper distribute the power and reduce the cabeling at the top of the matrix, every LED stripe is connected to 5V and GND at the bottom of the matrix. You can use either single wires or prototyping PCBs to distribute the 5V and GND line.

Step 3: Assembly

The explosion view helps to identify the correct pieces for the assembly. Just follow the step-by-step installation pictures. The backplane has cross structures to hold the long side walls and some of the short walls. If you have problems to install the pieces, use sand paper to fix it.

Step 4: Soldering

There are different ways to solder there power lines for the different stripes together. Either you can use single wires or some kind of common rail out of copper to solder the different wires. In this case, pieces of prototype PCBs were used to guide the power rails to the stripes. WS2812B stripes already have separate power cables which you can use to connect the power rail to the first stripe input (left side on the picture).

Step 5: Install SPI Display

To display game scores and text, a LED matrix display based on the LED driver MAX7219 is used. It is connected via SPI (Serial Peripheral Interface) to the Raspberry Pi. Four 8x8 displays are combined to a 32x8 pixel dot matrix display. You can buy this 8x8 pixel displays for e.g. at eBay, there are also combined 32x8 pixel displays available. Also you have different color options; in this case red displays were used. Because SPI works like a shift register, the displays are connected together in serial by connecting data out of the first matrix to data in of the second one and so on starting from the right side of the display.

This display is only readable from outside, if it is placed directly behind the veneer layer. If not, there is only a red blur visible. So you have to mount it on top of the backplane cut-out segment with a distance of 30mm between the surface of the backplane and the surface of the matrix. I have used some left over wooden pieces and screws to adapt the missing 19 mm between the backplane and the PCBs, but you can also any outer type of spacers.

Wiring of the display is shown in step 7.

Step 6: Install Pi

In this installation, a Raspberry Pi Zero is used. You can also use any other Raspberry Pi model, but newer ones with integrated WiFi and Bluetooth allow you to easily connect to wireless gamepads and simplify the programming.
You can secure the Pi by using at least two screws and small spacers to screw it to the backplane.

For the Raspberry Pi Zero W, the following pins are used:

  • PIN 2: 5V
  • PIN 6: GND
  • GPIO18 -> LED stripes
  • GPIO11: SPI CLK -> MAX7219 matrix CLK
  • GPIO10: SPI MOSI -> MAX7219 matrix DIN
  • GPIO8:SPI CS -> MAX7219 matrix CS

Step 7: Wiring and Power Supply

Wiring is done according to the wiring scheme. The power supply is a 5V DC supply.

For an easy on/off switching of the matrix, a switch is added between the power plug and the matrix circuits. Nevertheless, because the Raspberry Pi does not like hard switch off, there is a shutdown option in the software to safely shutdown the Pi via Gamepad before switching of the matrix.

The LED strip DIN pin is connected via a Resistor to the Pi, also a large capacitor (4700uF) is added to buffer the power supply. Please check out the Adafruit Überguide for Neopixels for more details.

LEDs are consuming a maximum current of 60mA per LED, so a maximum current of 200x60mA = 12A is possible!!! By reducing the brightness and not using all LEDs in full white, this is more a theoretical value, but it depends on the code which maximum current is reached. So selecting a large enough power supply is very important. For most of the applications a power supply with 5V/5A (25W) should be enough.

To fixate the backplane with the Pi and the Matrix display, some small pieces of wood can be used to scrum them in the edges and also use screws to hold the backplane in place.

Step 8: Setup Pi

1. Download latest Raspbian lite image from raspberrypi.org

2. Copy it to and SD card, 8GB is enough. You can use e.g. etcher to do this.

3. Before booting the Pi with the SD card, prepare WIFI and ssh access

4. Insert the SD card to any computer, a boot folder should be accessible

5. Copy the following lines to the file wpa_supplicant.conf (generate it if not exists) and change the parameters depending on your Wifi and region

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=US
update_config=1
network={
    ssid="Home Wifi"
    psk="mypassword"
    key_mgmt=WPA-PSK
}

6. Add an empty file called ssh (without any extension) to boot to enable ssh access

7. Now insert the SD card to the Raspberry Pi and boot it. Check your wifi router to get the IP address of the Pi

8. start a SSH connection to the Pi using a terminal (Linux, Mac) or e.g. Putty an Windows. Insert the IP of the Pi instead of 192.168.x.y

ssh pi@192.168.x.y 

9. Update the Pi (takes some time!)

sudo apt-get update

sudo apt-get upgrade

10. Install pip and setup tool

sudo apt-get install python3-pip

sudo pip3 install --upgrade setuptools

11. Install Neopixel driver, ws281x lib, pygame and libsdl

sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel

sudo pip3 install pygame

sudo apt-get install libsdl1.2-dev

sudo pip3 install --upgrade luma.led_matrix

12. Enable SPI by calling raps-config, navigate to 5 Interfacing Options / P4 SPI / Enable

sudo raspi-config

13. Add Bluetooth Gamepad

sudo bluetoothctl
[bluetooth]# agent on
[bluetooth]# pairable on
[bluetooth]# scan on
[bluetooth]# pair aa:bb:cc:dd:ee:ff
[bluetooth]# trust aa:bb:cc:dd:ee:ff
[bluetooth]# connect aa:bb:cc:dd:ee:ff
[bluetooth]# quit

where aa:bb:cc:dd:ee:ff is the MAC dress of your bluetooth gamepad. This address should be shown after calling the “scan on” command. Ensure that your Bluetooth controller is ready to pair, please check the manual of the controller how to do this.

14. You can now connect to you Pi via, default password is raspberry (Windows users may use Putty):

ssh pi@192.168.x.y

Step 9: Python Code, Test and Simulator

Code is available on Github. games_pi_only.py and all bmp files are needed.

git clone href="https://github.com/makeTVee/ledmatrix/tree/master/python/pi_only

The code has an option to run in simulation mode outside the Pi using pygame to simulate the matrix. This is very helpful to develop new features without having direct access to the matrix hardware. Also debugging is much easier. You have to set the PI constant to activate simulation mode (Line 15):

PI=False

In this simulation mode, alse the Keyboard is used instead of the Bluetooth gamepad. Buttons 1, 2, 3, 4 are mapped to A, B, X, Y of the gamepad, arrow keys for directions, “s” for start and “x” for select. You can use a standard editor plus the console or some integrated IDEs like Micosoft Visual Studio Code or Jetbrain PyCharm to do the development on your PC.

If you use the matrix and the Raspberry Pi, you have to define:

PI=True

To copy the code to the Raspberry Pi, you can use the scp command (Windows WinSCP). Open a console window, switch to the folder contenting the Github files and call

scp games_pi_only pi@192.168.x.y:/home/pi
scp *.bmp pi@192.168.x.y:/home/pi

then connect to the Pi via ssh (Windows users may use Putty):

ssh pi@192.168.x.y

after successful logging on, you can start the python code by calling:

sudo python3 games_pi_only.py

If the code runs correctly, you can enable autostart by calling:

sudo nano /etc/rc.local

and add the following line before exit 0:

/usr/bin/nice -n -20 python3 /home/pi/games_pi_only.py &

Save (Ctrl+O) and Exit (Ctrl+X)

Step 10: Final Test and Veneer

Before the veneer is glue on top of the front, the matrix should be tested to ensure, that all LEDs are working. It is much easier to fix something before the veneer is glued on.

The used wood veneer is a special maple veneer paper called Microwood, which is one-side covered with paper and has a thickness of 0,1 mm. The paper side can be glued directly on the mdf using standard water free paper glue.

Step 11: The Result

Have fun and enjoy the game!

Raspberry Pi Contest 2020

Grand Prize in the
Raspberry Pi Contest 2020

2 People Made This Project!

Recommendations

  • LED Strip Speed Challenge

    LED Strip Speed Challenge
  • Sculpting Challenge

    Sculpting Challenge
  • Clocks Contest

    Clocks Contest

84 Discussions

0
MIHegazy
MIHegazy

4 weeks ago

Congratiolations!
You deserve it...
Amazing project :)

0
maketvee
maketvee

Reply 27 days ago

Thank you!

1
bduijnhouwer
bduijnhouwer

4 weeks ago

Congratulations!
(I'm very glad I also won a price, but you really deserved to win!)

Again, it's an amazing project you created!

0
QuintBUILDs
QuintBUILDs

Reply 4 weeks ago

Echoing the same sentiment. Had my fingers crossed for the grand prize but am pleased to see who won it. It's the one entry I want on my living room wall RIGHT NOW! But it will have to wait until I have time to build one myself. Congrats!!!

0
maketvee
maketvee

Reply 4 weeks ago

Thank you very much for your kind words. And congrats too! Would be great to get a message when you have found the time to realize it!

0
maketvee
maketvee

Reply 4 weeks ago

Thank you, congrats to you!

0
Meglymoo87
Meglymoo87

4 weeks ago

This won grand prize!! Yay! Congrats! Super happy for you :)

0
maketvee
maketvee

Reply 4 weeks ago

Thank you!

0
electronicsmith
electronicsmith

4 weeks ago

I am a fan of pixels they have endless possibilities, If you want to make your own pixel madrix try
www.nextPCB.com. They surprise me with their PCB quality I recommend must try. they are the most budget-friendly PCB manufacturer.

WhatsApp Image 2020-03-11 at 6.37.40 PM (3).jpegWhatsApp Image 2020-03-11 at 6.37.40 PM.jpeg
0
ricardo.heypeppers
ricardo.heypeppers

Question 6 weeks ago on Step 11

Hey, I loved that project.
Do you think the base wood could be printed out in a 3D printer? If so, how do I get the *.stl files?
Congrats on that, by the way!

0
maketvee
maketvee

Answer 5 weeks ago

Maybe yes, but it will not be very efficient. Let me do some tests with thinner walls and I hopefully come back with some optimized .stl files.

0
maketvee
maketvee

Reply 4 weeks ago

Yesterday I did a quick test using black filament and 3x3 pixels. Wall thickness of 0.8 mm (2 lines with a 0.4 nozzle) is absolutely enough. Added a frame on the top with 3 mm thickness to separate the pixels. Works great! So now we have to think about a clever design to print a whole matrix... ;-)

3d_matrix.jpg
0
fox-scout
fox-scout

Question 4 weeks ago

Hi, it's me again: It figured out, that my SPI-display, which is a readymade 32x8 the orientation of the text is wrong. The text runs from the bottom to the top - on each 8x8 tile is the same text shown with a short delay.

After getting in more detailed touch with the luma.matrix-spec: https://readthedocs.org/projects/luma-led-matrix/downloads/pdf/latest/ I changed the codeline

device = max7219(serial, cascaded=4, blocks_arranged_in_reverse_order=True)
to
device = max7219(serial, cascaded=4, blocks_arranged_in_reverse_order=True, block_orientation=90)

Voila - its running!

0
maketvee
maketvee

Answer 4 weeks ago

Congrats! It would be great if you can publish a picture as a "make" on this site when it's finished.

0
fox-scout
fox-scout

Reply 4 weeks ago

I'will definitly do - currently waiting for the rest of the needed LED's - and to get a reservation at my makerspace for the laser.

0
maketvee
maketvee

Reply 4 weeks ago

Perfect, looking forward to the result.

0
prabbit237
prabbit237

6 weeks ago

That has got to be some SUPER-thin veneer (laugh.) I didn't realize they can/do shave it thin enough to let light come through. Makes me rethink some project ideas.

Do you happen to know just how thin it is?

0
darksb3r
darksb3r

Reply 6 weeks ago

It is indeed super thin. 0.1mm thickness.

0
prabbit237
prabbit237

Reply 6 weeks ago

For those others here in the US who aren't used to mm, that's about 3 mils or 0.003 inches (1/256th of an inch or so.) Literally "paper thin" as 20# paper is 0.004 inches and 24# paper is 0.0045 inches (no wonder the colors come through so well. As long as it's not backlit, the 0.1mm veneer would look pretty much the same as 1mm or thicker but it's the same as seeing a lady in a sheer dress with the sun behind her. You can see every detail.) Most copiers/printers use either 20 or 24# paper. Card stock is generally around 0.010-0.012". A quick Amazon search showed 10 mil veneer and thicker easily available but not sure about thinner. So finding this thin of veneer will definitely be a challenge. If I find a source, I'll post it in here.