Feed on
Posts
Comments

A while ago I bought ten 8×8 LED matrix from Ebay for about $7 and was thinking what I could do with them. Initially I was going to hook them up in a 3×3 arrangement but thought I could a better use if I connected them all together in a row to display text and potentially I could make this all wireless. Also I could use this to display the time as 10 LED matrices are just enough to fit the time, e.g, 12:34:00PM.

I milled out a quick board to mount the LED matrix, 595 shift register, connected it to an ATtiny84 and got it to a working point. It wasn’t really worth my time to mill out 9 more so a few weeks later the PCBs arrive and I start putting everything together.

IMG_4109

On the PCB there were some headers which would connect each matrix to each other but what I didn’t realise is that connecting the boards together was a very long process as I had to individually wire each header to each other, a few hours later and it’s done. If I were to re-do this project I would have laid out the PCBs better so they could just connect to each other without wires.

I was able to re-use some of my LED matrix code from the AT Mini Matrix Ctrl and initially tested 2 matrices together and used the ATtiny to sink the LEDs. Download ATtiny84_LED_Matrix_Test. Once I got to 3-4 matrices I started to notice some slow down when scrolling the text so I bumped the clock speed to 8MHz and that sorted it out and when connecting 10 matrices together I used an ULN2803A to sink the current and switched over to the ATmega for more pins.

IMG_4112

Transmitter

tx-matrix

The transmitter uses an ATtiny84 with a 16MHz crystal, runs V-USB and uses the nRF24L01. We have 3 actions that we can send over the wireless – program, execute and wakeup (similar to the RGB Wifi Controlled LED).

While we’re polling the USB and once we receive the complete data by checking if send_text is true (I say complete because USB doesn’t always transfer the whole data all at once, took me a little while to find that out) then we send a wake up packet, transfer the data which is entered from the PC and then send the execute command.

Here’s the wake up code, all we do is transmit the same packet for 1 second. We also include the text message size that we will be sending (up to 250 bytes) and the speed which I have pre-programmed in a variable as I don’t need that to change.

When transferring the text over wireless we can only send 32 bytes at a time so we’ll just break up the string and loop until it’s all been sent and the receiver will put it back together. Then we just send the execute command.

Transmitter USB Program

In the program which transmit our input over the wireless there isn’t much to it, we grab the string length that was entered and put that in the first byte of the usb_data variable and copy the text to the 2nd byte of the usb_data using memcpy.

Receiver

rx-matrix-2rx-matrix

In the receiver we listen for packets for 10 ms and then sleep for 1 second.

Once we receive a wake up packet, we start an 8 second timer and listen for the program packets. I used to check for the RX_DR pin on the nRF24L01 but this time I might as well use the RX Fifo to read out packets so we don’t have to clear the fifo like I used to (so we knew we got new packets).

Once the execute packet is received we run the loop for displaying the text. There’s more happening in the background like converting the text received whether uppercase or lowercase to be all uppercase, accounting for spaces plus all the shifting of data but I’ll leave that up to you to explore as I’ve explained some of this before. Download 8x8_x10_LED_Scrolling_v1.0

Leave a Reply