32 x 32 LED Matrix setup on RPI2

After building a few LED matrices from LED strip lighting and soldering a ton of connections, I decided to give these pre-fabricated LED matrix modules a shot. After a bit of research it turns out that using only a Raspberry Pi and a fully functional Library from the Legend Henner Zeller, you can accomplish just about anything. The cheap Chinese panels that we sourced are fitted with a HUB75 connector which is easily interfaced with a breadboard and some jumper wires or using the opensource Active-3 board, again designed by Henner. His library can be found here: Rpi-RGB-LED-Matrix Library – https://github.com/hzeller/rpi-rgb-led-matrix


Bill of Materials (BOM)

  • LED Matrix: http://www.aliexpress.com/store/1239156 (P5 32x32 modules with Hub75 are a good starting point.)
  • A Raspberry Pi 2 or 3
  • A breadboard and T-Cobbler RPI 40 pin Breakout (Just to make life easier! You can grab these from Adafruit.)
  • Alternatively build an Active-3 adapter for easier chaining of Matrix Panels. (See hzeller github page for more details.)
  • Some Jumper Wires
  • A sense of adventure.....


Code

Assuming you are semi-proficient with Linux and have installed Raspbian than you can follow along here. Otherwise you first need to setup your RPI and access the terminal/SSH interface. The guide here will get you up and with the “NOOBS” installation for your pi.

Install Henner Zeller’s LED Matrix library onto your Pi:

sudo wget https://github.com/hzeller/rpi-rgb-led-matrix/archive/master.zip

Unzip the Archive:

sudo unzip master.zip

Once unzip completes you should then be able to view the directory and it’s contents:

cd rpi-rgb-led-matrix-master/

You then need to compile the library by running the command:

sudo make

Once compiled, you can run the following command, this will give you an output of all the available switches:

sudo ./led-matrix

This command will output the following for your reference:

$ sudo ./led-matrix
Expected required option -D <demo>
usage: ./led-matrix <options> -D <demo-nr> [optional parameter]
Options:
        -r <rows>     : Panel rows. '16' for 16x32 (1:8 multiplexing),
                        '32' for 32x32 (1:16), '8' for 1:4 multiplexing; Default: 32
        -P <parallel> : For Plus-models or RPi2: parallel chains. 1..3. Default: 1
        -c <chained>  : Daisy-chained boards. Default: 1.
        -L            : 'Large' display, composed out of 4 times 32x32
        -p <pwm-bits> : Bits used for PWM. Something between 1..11
        -l            : Don't do luminance correction (CIE1931)
        -D <demo-nr>  : Always needs to be set
        -d            : run as daemon. Use this when starting in
                        /etc/init.d, but also when running without
                        terminal (e.g. cron).
        -t <seconds>  : Run for these number of seconds, then exit.
                        (if neither -d nor -t are supplied, waits for <RETURN>)
        -b <brightnes>: Sets brightness percent. Default: 100.
        -R <rotation> : Sets the rotation of matrix. Allowed: 0, 90, 180, 270. Default: 0.
Demos, choosen with -D
        0  - some rotating square
        1  - forward scrolling an image (-m <scroll-ms>)
        2  - backward scrolling an image (-m <scroll-ms>)
        3  - test image: a square
        4  - Pulsing color
        5  - Grayscale Block
        6  - Abelian sandpile model (-m <time-step-ms>)
        7  - Conway's game of life (-m <time-step-ms>)
        8  - Langton's ant (-m <time-step-ms>)
        9  - Volume bars (-m <time-step-ms>)
        10 - Evolution of color (-m <time-step-ms>)
        11 - Brightness pulse generator
Example:
        ./led-matrix -t 10 -D 1 runtext.ppm
Scrolls the runtext for 10 seconds

Now its time to get some output onto the panel. If you are running a singular 32×32 panel, you should be able to run the example without issue.

sudo ./led-matrix -t 10 -D 1 runtext.ppm

If your panel is connected correctly and powered up you should see a scrolling image pass through the panel. With the example above it will only last 10 seconds. You can now begin to experiment with the above switches to see what output you can achieve.


Advanced

  • Output RPI GUI to Matrix Panels (Coming Soon!)
  • Output Twitter msg to Matrix Panels (Coming Soon!)
  • Use Pixelpusher Protocol on Matrix (Coming Soon!)


Media


DIY NFC Door Entry - PN532 Module

I decided it was unacceptable to NOT utilise the RFID/NFC implant in my hand for anything at home, so I had to dream up a little project for it. After a little bit of brainstorming and no really good ideas coming to mind, I decided that you can’t have an implant without an RFID door entry system. Not very original I know, but this seemed to be the most practical application. I managed to scrape together the following components for the basic install. I have not yet progressed to a fully installed setup due to being in a rental and not wanting to attack the door frames. I guess I should be looking for a mechanism to replace the built-in dead-lock I have here.


Bill of Materials (BOM)

  • 12v Door strike. (I happened to get both fail-safe and fail-lock versions from Jaycar at a very good price. ~$18ea)
  • NFC Module V3 from Elechouse. (NFC is RFID, just a different flavour! NFC utilising the HF band for comms.)
  • Freetronics DLOCK shield (Jaycar ~$20 – In the end i didn’t really require this…but hey makes things pretty easy hook up wise.)
  • Arduino UNO (Had one lying around. Will most likely find a smaller Arduino for the install)
  • RFID/NFC Tags compatible with your reader.
  • Manual Override switch (Any type of switch you want - maybe a nice face plate of some description.)
  • 12v Power supply (1-2A should suffice.)


Code

Some code for you to play with. This was working with my setup, however it may need some tweaking from your end. You will also need to grab the Adafruit library and change out the RFID card values in the code. (Lines 55-58). You can get these values by running the library demo code and looking at the serial output.


Media