LedPanel project


Project description

Led panel in a project to realize a very bright and internet ready digital signage useful for a wide range of applications like message notifications, alarms, synchronized clock, scrolling text, etc. The project is open and based on the tiny Linux board Arietta G25 wired to a 32x32 RGB led panel and interacts with the user smartphone via a WiFi link.

As shown below all the electronic parts can be fixed inside a cheap and elegant IKEA RIBBA photo frame.

The whole project is based on the full color RGB led panel made by the Chinese company Linsn.

It is composed by 1024 rgb led ordered in 32 rows of 32 leds each and mounted with a lot of logic on a black PCB 19x19 cm size. Everything in enclosed in a plastic frame with a set on placement for M3 screws to use for mounting.

The cost of creating a panel like this for an European company could be around 200 eur just for manufacturing and components so the best thing to do is to buy it :-)

The datasheet of this panel with a correct explanation about how it works is not easily available. In this page I'll try to explain how "it seems to work" :-)

On the rear an Arietta G25 module is used to generate all the signals requested by the RGB panel starting from a 32x32 pixel graphic image.

The Pyhton graphic library called Pillow is used to create the image starting from graphic primitives, true type fonts, and jpg, png, etc images.

The WiFi capability of the Arietta G25 (also in Access Point mode) and the Python module for the networking, open a lot of possible uses of this project.

Linux is loaded in few seconds from an 8GB microSD with more than 7.8 GB free !!

Tons of softwares, tools, languages and libraries can be installed. Complete step by step guides are available on this site.

Software used

  • Linux Kernel version 4.2.3 and Buildroot Linux 2015.08.1 freely downloadable from this site or created from scratch following my guide on this site
  • Python interpreter
  • Python Web server made with Tornado. Any other web solution (Apache, lighttpd, etc) can be used instead
  • SSH server to access to the microSD contents via WiFi (other rete access systems can be used like Netbios, ftp, etc

How the RGB led panel works

The RGB led panel has a two 16 pins male connector where to send data using a synchronous serial transmission.

  • Three data lines are for the Red, Green and Blue (Rx, Gx, Bx)
  • One line is for the serial clock (CLK)
  • One line is for latching the data sent after 32 clock pulse (STB)
  • One line is to enable the latch output line to the led (OE)

The panel is logicaly splitted in two section:

  • Top 16 rows of 32 led each
  • Bottom 16 rows of 32 led each

R0, G0 and B0 are the data sent to the top block

R1, G1 and B1 are the data sent to the top block

Four address lines (A,B,C and D) select to which row of led are sending the data on Rx,Gx and Bx lines

This is the lock diagram of the internal parts of a RGB led panel

Pinout

This is the pinout of input data connector:

LED Pin # Signal Description Arietta pin # Line gpio ID
1 R0 Red 1st bank J4.10 PA21 21
2 G0 Green 1st bank J4.8 PA22 22
3 B0 Blue 1st bank J4.7 PA23 23
4 GND Ground J4.9
5 R1 Red 2nd bank J4.11 PA24 24
6 G1 Green 2nd bank J4.13 PA25 25
7 B1 Blue 2nd bank J4.15 PA26 26
8 GND Ground J4.9
9 A Row address J4.28 PA5 5
10 B Row address J4.27 PA6 6
11 C Row address J4.26 PA7 7
12 D Row address J4.25 PA8 8
13 CLK Clock J4.17 PA27 27
14 STB Strobe J4.19 PA28 28
15 OE Output Enable J4.21 PA29 29
16 GND Ground J4.9



On the output data connector just replicates the input lines for a wire another RGB led panel display.

The power supply connector needs 5 VDC @ max 3A. At this current all leds are on at maximum brightness.

The Linux driver ledpanel.c

All the rgb led panel are generate in bit banging mode using normal GPIO lines. To go as fast as possible a Linux driver written in C code is required.

The driver I wrote can update the whole panel contents 679 times per second leaving enough time to Linux to do other jobs in the meanwhile.

The main routine of this driver is a callback function called by a hrtimer 10800 times per second at interval of 92uS.

In just 22uS this routine check the brightness of each color and send a simulated pwm signal to any led (32 x 3 color = 96) on a single row then exit. It will be called again by the Kernel after 66uS.

The fully source code of this driver is available under GPL licence on GitHub: ledpanel source on GitHub

How the driver works

Compile and install ledpanel.c

To compile ledpanel.c it is requested a Linux Ubuntu PC on where install the cross compiler toolchain and Linux Kernel sources:

During the make menuconfg be sure to enable the High Resolution Timer Support:

General setup  --->
    Timers subsystem  --->
        [*] High Resolution Timer Support  

Clone the GitHub repository on your Linux PC:

$ git clone git://github.com/tanzilli/ledpanel.git
$ cd ledpanel
~/ledpanel$

Compile the module by typing:

~/ledpanel$ make -C ~/arietta/linux-4.1.10 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- M=`pwd` modules

and copy in inside Arietta G25

~/ledpanel$ sshpass -p acmesystems scp ledpanel.ko root@192.168.10.10:/root

Open a command session on Arietta and load the Kernel module:

root@arietta:~# insmod ledpanel.ko

Now you can try some example to show something on the display.

Examples

Here are some user space example to use our RGB panel led. All the examples are in Python and can be downloaded on your Arietta with a single git clone command:

~# git clone git://github.com/tanzilli/led-utils.git
Cloning into 'led-utils'...
remote: Counting objects: ..., done.
remote: Compressing objects: 100% (../..), done.
Receiving objects: 100% ..., done.
Resolving deltas: 100% ..., done.
~# cd led-utils
~/led-utils# ./clock-py

Install PIL

All the utilities use the Python Interface Library to manage images, font, etc so before trying any example install PIL on your Arietta G25 by typing:

# apt-get update
# apt-get install python-imaging

This is the list of utilities available. If you can't run something try to update your repository by typing: git pull.

Example: Convert and display any image from web

Let's see now how to convert an image to a byte array to be displayed on the led panel.

We will use, for example, this 256x256 pixel jpeg image but the same concept is valid for any images:

Download this image directly on Arietta G25 using wget and the image URL:

# wget http://www.acmesystems.it/www/ledpanel/right_arrow.jpg

Now launch convert.py with the local filename of the image:

~/led-utils# ./covert.py right_arrow.jpg
------------------------
[1] <- Brightness -> [2]
[3] <-  Contrast  -> [4]
[5] <-   Color    -> [6]
[7] <- Sharpness  -> [8]
[q] <-   Rotate   -> [w]
[i] Invert color        
[r] Reset               
[s] Save                
------------------------
Select (space exit):

With the keys [1] and [2] changes the brightness until the arrow color became equal t the original.

Pressing the [s] key it is possible to save a screenshot of the image with the name "panel_xxxx.rgb" where xxxx is an incremental counter.

The *.rgb file contains the raw byte array image at 3 bytes per color ready to be sent to /sys/class/ledpanel/rgb_buffer.

To display is return to the command line and type:

~/led-utils# cp panel_0000.rgb /sys/class/ledpanel/rgb_buffer

If you collect some screenshots it is possible to create a simple animation with a simple shell script like this:

#!/bin/bash
while [ 1 ]
do
    for f in *.rgb; 
    do
        cp $f /sys/class/ledpanel/rgb_buffer
        sleep 0.5
    done
done

Design a 32x32 icon from scratch

If you need to design a 32x32 icon from scratch you could use x-IconEditor.

X-IconEditor is an on-line graphic editor to create favicon.ico icons for the web pages but you can download and convert the favicon.ico file generated with convert.py and display it on your panel.

Source code: convert.py

Demo gallery

Example: Simple 2 digit countdown counter

This example written in Python shows a count down from 99 to 0 using a full size TTF font.

~/led-utils# ./counter.py

Source code: counter.py

Example: Sliding messages

This example, written in Python, shows a sliding message using a big TTF font

The RGB color and the message to display are given from the command line.

~/led-utils# ./text.py "text" R G B

The R, G and B values are in range of 0 (off) to 7 (max)

Source code: text.py

Example: Sliding clock

This example shows the system time in HH:MM:SS format using a big TTF font and slide the line horizontaly.

The RGB color is given from the command line.

~/led-utils# ./clock.py R G B

The R, G and B values are in range of 0 (off) to 7 (max)

Source code: clock.py

Is available a demo version of this programm called clock_demo.py which changes automatically the colors during the time sliding:

~/led-utils# ./clock_demo.py

Source code: clock_demo.py

Led panel

Kernel Linux 3.18.1 - Debian Wheezy 7.2 - WiFi

Version: 16-oct-2015
MicroSD contents for Arietta G25 to run Led Panel application

Binaries

How-to create a bootable microSD

A Linux Ubuntu PC is required

  • Format a microSD with gparted (read more) and mount it
  • Download the binaries
  • Uncompress the binaries to the microSD with the following commands:
$ tar -xvjpSf boot.tar.bz2 -C /media/$USER/boot 
$ sudo tar -xvjpSf rootfs.tar.bz2 -C /media/$USER/rootfs 
  • unmount the microsd and try it on your Arietta

Login data

  • Login: root Password: acmesystems

How to use

Access to WiFi LedPanel and go to these address from your browser:

Buy

LEDPANEL-01
EUR 75.00


Led panel 32x32 kit

All the electronic part you need to mount a RGB 32x32 Led panel:

  • Arietta G25 with 128 MB of RAM
  • RGB led panel 32x32 P6
  • 8GB microSD with Linux preinstalled
  • Wifi module and PCB antenna
  • 5V 4A wall adapter power supply
  • LPA-01 PCB, connectors and cables

IKEA RIBBA photo frame is not included

Parts

LEDRGB-02
EUR 36.00


RGB led module 32x32 pixel 192mm

Indoor full color LED module 32x32 pixel 19.2x19.2 cm

TS802
EUR 185.00


Sender card

RV908
EUR 35.00


Receiver card

PS5V4A-EU
EUR 14.00


Switching power supply 5V 4A with european plug

Switching wall mount power supply:

  • European AC input: 90-240VAC 50/60Hz
  • Output voltage 5V
  • Output current 4A
  • Power 20W

PS5V10A
EUR 14.00


Switching power supply 5V 10A for RGB ledpanels

CABLE-03
EUR 1.00


Data cable for LED panel

Flat data cable for RGB Ledpanel

CABLE-04
EUR 1.00


Power cable for LED panel

Power cable for RGB Ledpanel

CABLE-05
EUR 4.20


HDMI cable 0.5 mt
  • Connector 1: HDMI type A male
  • Connector 2: HDMI type A male
  • Legth: 0.5 mt

CABLE-06
EUR 1.20


Ethernet cable 0.5 mt
  • Lenght 0.5 mt
  • Flat
  • Color black

CON-01
EUR 3.00


DVI-D to HDMI adapter
  • Connector 1: DVI-D, (18+1), plug
  • Connector 2: HDMI type A, jack
  • Cable type: Single-Link
  • HDTV Standard: 1080p
  • HDTV Resolution max.: 2560 x 1600 Pixel, 60Hz
  • Hoods: molded
  • Shielding: single shielding
  • Connector surface: nickel-plated
  • Color connector: black

| datasheet |

LPA-01-PCB
EUR 4.00


RGB led panel adapter (PCB)

Adapter to mount an Arietta G25 on a 32x32 P6 RGB led panel model LEDRGB-02.

LPA-01
EUR 6.00


RGB Led panel adapter (mounted)

Adapter to mount an Arietta G25 on a 32x32 P6 RGB led panel model LEDRGB-02.

  • Power in connector for PS5V4A power supply
  • 40x2 female connector for Arietta G25
  • Screw terminal for Ledpanel power supply

Raspberry Pi

RPI3B
EUR 45.00


Raspberry Pi 3 Model B

Linux Embedded single board computer Raspberry Pi 3 Model B

RPI2B
EUR 40.00


Raspberry Pi 2 Model B

Linux Embedded single board computer Raspberry Pi 2 Model B

RPIBP
EUR 26.00


Raspberry Pi Model B+

Linux Embedded single board computer Raspberry Pi Model B+

PINOIR
EUR 26.00


Raspberry Pi NoIR Infrared IR Camera

The Pi NoIR gives you everything the regular camera module offers, with one difference: it does not employ an infrared filter. (NoIR = No Infrared.) This means that pictures you take by daylight will look decidedly curious, but it gives you the ability to see in the dark with infrared lighting.

MICROSD8G
EUR 12.00


Blank 8GB microSD HC card

Blank 8GB microSD memory card.

| Product description |