dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Led Matrix With pi

Sat Jul 24, 2021 10:05 pm

Hello,
this might be a stupid question but is it possible to connect a 8*8 led matrix directly to my pi or do I have to use the Logic Level Converter, if I can't, can anyone explain me why please?

here's the led matrix that I want to use : https://www.az-delivery.de/fr/products/ ... 6983&_ss=r

on the website they said that I have to use the Logic Level Converter because the module pins are working in the 5V range but can't I directly connect the +5 to the 5v power on the pi and DIN directly to a GPIO ?

thank's :D

User avatar
neilgl
Posts: 3512
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Led Matrix With pi

Sun Jul 25, 2021 4:26 pm

As they say in their Datenblatt, “ use the device called TXS0108E 8ch Logic Level Converter that AZ-Delivery offers”, and a separate 5V power supply for the matrix.
It would draw too much current from the pi 5V pin, and the pi 3V3 on GPIO18 (PWM) may not trigger correctly when running LEDs at 5v. The max current is 3.84A.

W. H. Heydt
Posts: 14974
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Led Matrix With pi

Sun Jul 25, 2021 5:44 pm

dali wrote:
Sat Jul 24, 2021 10:05 pm
Hello,
this might be a stupid question but is it possible to connect a 8*8 led matrix directly to my pi or do I have to use the Logic Level Converter, if I can't, can anyone explain me why please?
Have you considered using the RPF Sense HAT, which includes an 8x8 RGB LED array?

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Sun Jul 25, 2021 6:59 pm

W. H. Heydt wrote:
dali wrote:
Sat Jul 24, 2021 10:05 pm
Hello,
this might be a stupid question but is it possible to connect a 8*8 led matrix directly to my pi or do I have to use the Logic Level Converter, if I can't, can anyone explain me why please?
Have you considered using the RPF Sense HAT, which includes an 8x8 RGB LED array?
yes i considered to use the Unicorn hat from Pimoroni but I need to use the GPIOs for other stuff so I don't want to connect a HAT, I just want to connect a Led matrix to my pi with 1 gpio a ground and a 5v.

Thnx for the answer guys

jbudd
Posts: 1898
Joined: Mon Dec 16, 2013 10:23 am

Re: Led Matrix With pi

Sun Jul 25, 2021 11:27 pm

The datasheet shows connections for the Raspberry Pi.

They specify the logic level converter because the board expects 5V data signal and a Pi's GPIOs are only 3.3V
Maybe you would get away with it with just one matrix, maybe it wouldn't work or even fry your Pi.

Actually the diagram shows 5V, GND and two GPIO connections so 4 wires.

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Sun Jul 25, 2021 11:54 pm

jbudd wrote: The datasheet shows connections for the Raspberry Pi.

They specify the logic level converter because the board expects 5V data signal and a Pi's GPIOs are only 3.3V
Maybe you would get away with it with just one matrix, maybe it wouldn't work or even fry your Pi.

Actually the diagram shows 5V, GND and two GPIO connections so 4 wires.
What about the 5V gpio on the pi ?

jbudd
Posts: 1898
Joined: Mon Dec 16, 2013 10:23 am

Re: Led Matrix With pi

Sun Jul 25, 2021 11:59 pm

Yes you can supply 5V from a 5V pin. But can it supply enough current for the LEDs?
You can't turn the 5V pins on and off. Thus you can't use them as data outputs.

I think you should consider two Pies. One for a Unicorn Hat and one for your other experiments.

pidd
Posts: 2520
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Led Matrix With pi

Mon Jul 26, 2021 12:12 am

jbudd wrote:
Sun Jul 25, 2021 11:27 pm
Actually the diagram shows 5V, GND and two GPIO connections so 4 wires.
The data out is for cascading to another matrix/string it doesn't go back to the Pi.

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Mon Jul 26, 2021 12:13 am

What will happen if I connect the input on a Gpio the ground to the ground gpio and finally the 5v to the 5v gpio ?

I just want to use one 8*8 led matrix

jbudd
Posts: 1898
Joined: Mon Dec 16, 2013 10:23 am

Re: Led Matrix With pi

Mon Jul 26, 2021 12:19 am

At the worst you will have gained experience and lost £35. Or more if its a Pi4 8GB

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Mon Jul 26, 2021 12:24 am

and what are my chances ?

pidd
Posts: 2520
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Led Matrix With pi

Mon Jul 26, 2021 2:56 am

Assuming the Pi is a 4B? I don't think you have stated. If its a Pi Zero then just don't put that sort of current through the board (without a fire extinguisher handy).

Damage to the gpio pin is unlikely with it driving a WS2812 or WS2812B

Have you got a 7A power supply? Even with nothing else connected you will still need a 5A supply.

Damage to you Pi is likely if you expect up to nearly 7A to flow through it, however if you have nothing else connected to the Pi the risk goes down to moderate.

Chances of your Pi working with up to 7A flowing through the USB cable is low, however if you have nothing else connected to the Pi then it should work but may have glitches with sudden large changes on the matrix.

Damage to your USB cable - if its 22AWG cable or thicker it will be ok, if thinner than 24AWG keep a fire extinguisher handy.

Chances of the matrix working is low if it uses WS2812 and fair if the matrix uses WS2812B, I think elsewhere we measured 60-70% success rate with a WS2812B on a 3.3V derived signal.

Total disclaimer if anything gets destroyed, its your risk!

User avatar
Imperf3kt
Posts: 4646
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia
Contact: Twitter

Re: Led Matrix With pi

Mon Jul 26, 2021 3:39 am

dali wrote:
Mon Jul 26, 2021 12:13 am
What will happen if I connect the input on a Gpio the ground to the ground gpio and finally the 5v to the 5v gpio ?

I just want to use one 8*8 led matrix
Just to clarify, there is no 5v gpio. The 5v pins on a pi are merely power pins, they are not gpio - general purpose input output.

Worst case scenario, you destroy your Pi.
This is also the most likely scenario.

You could use a separate power supply (common the ground between both power supplies) or use the suggested extra items the store listing told you to.
Last edited by Imperf3kt on Mon Jul 26, 2021 3:40 am, edited 1 time in total.
55:55:44:44:4C
52:4C:52:42:41

Rose tinted glasses are difficult to see through.

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Mon Jul 26, 2021 3:40 am

In the Datenblatt they use a DC power supply but what if I dont ? sorry for being a total noob but why this work with an arduino and not with a pi ?? and i have a raspberry pi 4b.
thnx

pidd
Posts: 2520
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Led Matrix With pi

Mon Jul 26, 2021 4:05 am

dali wrote:
Mon Jul 26, 2021 3:40 am
In the Datenblatt they use a DC power supply but what if I dont ? sorry for being a total noob but why this work with an arduino and not with a pi ?? and i have a raspberry pi 4b.
thnx
A Pi isn't an Arduino, just like the computer in your Microwave Oven isn't the same as your PC. Also the Pi is fundamentally a 3.3V computer not a 5V computer like the Arduino.

Some Arduino boards (not all) are designed for supplying power, the Pi isn't, the Pi is designed for low power accesories.

The Pi4 is designed for a maximum of 3.1A input you can't expect it to supply itself and nearly 4A output when it is only designed for 3.1A input.

And what power supply are you planning to use, if it is a 3A power supply it cannot supply a Pi4 plus 4A for the matrix.

The connection diagram https://cdn.shopify.com/s/files/1/1509/ ... 1608116819 has two diagrams, the one for the Pi shows a separate power source for the matrix. You could use the same supply to power the Pi either from the Matrix or from the power supply ...... but you cannot power the Matrix from the Pi.

User avatar
neilgl
Posts: 3512
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Led Matrix With pi

Mon Jul 26, 2021 9:50 am

As they say in the data sheet, it can be connected to the pi for testing, but brightness of LEDs must be kept low so that not too much current is drawn.

katesimon123
Posts: 41
Joined: Sun Jun 13, 2021 2:45 am

Re: Led Matrix With pi

Mon Jul 26, 2021 2:08 pm

Even if you keep the LED brightness LOW, there's still a possibility that you might burn your Pi pins.

Happened to me once, the board kept on working but that pin(where I connected the third-party module) started showing 2.5V(something). I couldn't make it work again. So, stay safe !!!

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Mon Jul 26, 2021 7:28 pm

thnx guys, I'll stay safe but can anyone explain me the logic behind this ? why with the 5v out from the pi the led will not work ? why if I connect the matrix to the pi like I said (5 pin out to the 5v of the matrix, the gpio to the matrix in and the ground pin to the matrix ground) the pi gonna burn ?

User avatar
neilgl
Posts: 3512
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Led Matrix With pi

Mon Jul 26, 2021 7:32 pm

It will probably work but only if you do not take more current (Amps) than the pi can safely output.

jbudd
Posts: 1898
Joined: Mon Dec 16, 2013 10:23 am

Re: Led Matrix With pi

Mon Jul 26, 2021 8:49 pm

dali wrote:
Mon Jul 26, 2021 7:28 pm
thnx guys, I'll stay safe but can anyone explain me the logic behind this ? why with the 5v out from the pi the led will not work ? why if I connect the matrix to the pi like I said (5 pin out to the 5v of the matrix, the gpio to the matrix in and the ground pin to the matrix ground) the pi gonna burn ?
I'm sorry, I thought several people had explained why but obviously not clearly enough for you.

1. The Raspberry Pi might not be able to provide enough current at 5V to turn on the LEDs.

2. In order to control which LED is on and how bright, the board needs to get a digital signal either 5V or 0V.
You cannot use a 5V pin on the Pi for this because you cannot turn it on and off.
The GPIO pins, which you can control, can only provide 3.3V and this may be too low for the LED board to recognise as logical HIGH.

3. It might work, it might not. It might damage the Pi, it might not.
Since you don't believe the datasheet for the LED board or the advice of people here, why don't you try it and tell us what happened?

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Mon Jul 26, 2021 10:16 pm

Okay so the matrix need two 5v entries a 5v for the power and a 5v for the input ?
sorry I'm just a curious full stack developer I'd never worked with such cards before.

dali
Posts: 9
Joined: Sat Jul 24, 2021 9:51 pm

Re: Led Matrix With pi

Mon Jul 26, 2021 10:27 pm

jbudd wrote:
Mon Jul 26, 2021 8:49 pm
Since you don't believe the datasheet for the LED board or the advice of people here, why don't you try it and tell us what happened?
[/quote]

I'm here to learn new stuff I just wanted to understand so in the future when I'll be facing the same problem I'll know how to bypass it

Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime

User avatar
davidcoton
Posts: 6524
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Led Matrix With pi

Mon Jul 26, 2021 10:35 pm

There is a difference between power and signals.
Power at 5V is there constantly, and can require significant current (3A for a Pi4 with peripherals, over 3A for some LED arrays)
Signals at 5V switch between 5V and 0V, and convey information (data).
Location: 345th cell on the right of the 210th row of L2 cache

katesimon123
Posts: 41
Joined: Sun Jun 13, 2021 2:45 am

Re: Led Matrix With pi

Tue Jul 27, 2021 9:36 am

It's a simple thing, you are just getting confused.

You need to design a new power supply for your LED Matrix, I normally use LM7805 IC to power up 5V modules/sensors.

The power supply is normally of 12V, so place this IC 7805 in front of your power supply, which will convert 12V to 5V and then supply this 5V to your LED matrix.

If you use RPi to power up the LED matrix, the matrix will demand current, which Pi won't be able to deliver, and thus it may prove fatal for your Pi.

User avatar
davidcoton
Posts: 6524
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Led Matrix With pi

Tue Jul 27, 2021 10:14 am

katesimon123 wrote:
Tue Jul 27, 2021 9:36 am
It's a simple thing, you are just getting confused.

You need to design a new power supply for your LED Matrix, I normally use LM7805 IC to power up 5V modules/sensors.

The power supply is normally of 12V, so place this IC 7805 in front of your power supply, which will convert 12V to 5V and then supply this 5V to your LED matrix.

If you use RPi to power up the LED matrix, the matrix will demand current, which Pi won't be able to deliver, and thus it may prove fatal for your Pi.
7805 is only capable of 1A5, which is inadequate. It is also inefficient, because it is a linear regulator.

In this case, IF a 12V supply is available (and it hasn't previously been mentioned), a 5V 5A switching regulator would be more appropriate.
Better still, use an independent 5V 5A supply. Or get a 5V 7A supply to power both the Pi and the LED matrix -- in which case a 3A polyfuse is recommended for the Pi supply.

tl;dr Do not use a 7805 in this application.
Location: 345th cell on the right of the 210th row of L2 cache

Return to “Beginners”