Hello!
I am trying to use an 8x8 LED-Matrix without a shift register just for experimenting. This matrix has 16 pins, which I have connected to the GPIOs 12,14,27,26,25,23,22,21,19,18,5,17,16,4,2,15. When I now activate some pins (pin.value(1)) I get voltage output lower than 3V (e.g. 1,8V or 0,2V, which I measured using a multimeter) and this voltage is not enough as input on the LED-Matrix.
Does anybody know why this is happening? How can I fix this?
Kind regards
Bastian
[SOLVED] Output voltage < 3V
[SOLVED] Output voltage < 3V
Last edited by baschni on Wed Nov 24, 2021 11:09 pm, edited 1 time in total.
Re: Output voltage < 3V
The LED matrix max to require s higher current than the ESP32 can supply. Then, the voltage drops. If the signal at the output is pulsed, then a voltmeter will also display a lower voltage, which is about the average voltage (Vcc * duty_rate).
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Output voltage < 3V
Are you using current limiting resistors?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Output voltage < 3V
So I am not so sure where my problem lies. Maybe it is better if I show all the wiring to you:
Here is the wiring:
The source code is here:
This should light all leds in one row with a 1 second pause in between.
Here is the wiring:
The source code is here:
Code: Select all
from machine import Pin
from time import sleep
pin_wiring=dict()
# Here comes how the GPIOs are connected to the lower pins and upper pins of the led matrix
rows_wiring=[2, 16, 15, 4, 17,5,18,19]
cols_wiring=[12,14,27,26,25,23,22,21]
# create a dictionary for pins 1-16 (1-8 lower connectors of LED-Matrix, 9-16 upper connectors)
for i in range(1,9):
print(i)
pin_wiring[i]=rows_wiring[i-1]
pin_wiring[i+8]=cols_wiring[i-1]
print(pin_wiring)
rows=[]
cols=[]
pins_rows = [1, 6, 9, 4, 16, 10, 15, 12]
pins_cols = [8, 7,3, 11, 2, 13, 14, 5]
# as column and row pins are mixed through lower and upper part of LED-Matrix, create correct mapping now
def initialise_pins(pins, pin_wiring, pin_numbers):
for number in pin_numbers:
pins.append(Pin(pin_wiring[number], Pin.OUT))
print(pin_wiring[number])
initialise_pins(rows, pin_wiring, pins_rows)
print(" ")
initialise_pins(cols, pin_wiring, pins_cols)
def set_value(rows, value):
for pin in rows:
pin.value(value)
set_value(rows, 0)
set_value(cols,1)
#try to light all leds of one row
rows[0].value(1)
cols[0].value(0)
sleep(1)
cols[0].value(1)
cols[1].value(0)
sleep(1)
cols[1].value(1)
cols[2].value(0)
sleep(1)
cols[2].value(1)
cols[3].value(0)
sleep(1)
cols[3].value(1)
cols[4].value(0)
sleep(1)
cols[4].value(1)
cols[5].value(0)
sleep(1)
cols[5].value(1)
cols[6].value(0)
sleep(1)
cols[6].value(1)
cols[7].value(0)
Re: Output voltage < 3V
What happens is visible in the following images:
While the output is as expected for columns 1, 2, 4, 5 and 8, for columns 3, 6 and 7 instead of the one expected led three other leds are lighted up. How can I find out where the problem is?
While the output is as expected for columns 1, 2, 4, 5 and 8, for columns 3, 6 and 7 instead of the one expected led three other leds are lighted up. How can I find out where the problem is?
Re: Output voltage < 3V
When you try to power the LEDs of an entire column at the same time, the LEDs here are in fact parallel to each other. As I learned in ancient times, this should not be done with most semiconductors (MOSFETs may be an exception here).
In your case, the LEDs with the lowest forward voltage will "win" and will not leave enough voltage for the others in the row.
A voltage of 1.8V is way too low for a static value(1). 0.2V are OK for a value(0). You might want to double-check your measurement, wiring and programming.
Is the voltage OK (over 0.8*Vcc) when you disconnect the matrix or power only one LED statically ?
Regards,
Thomas
In your case, the LEDs with the lowest forward voltage will "win" and will not leave enough voltage for the others in the row.
This is most likely also caused by the parallel LEDs. At least the lighting ones in a row will pull ~7mA (limited by the 220 Ohm resistors) each; when a few of them light up, you get close to the max. output current of the ESP32 (see datasheet).
A voltage of 1.8V is way too low for a static value(1). 0.2V are OK for a value(0). You might want to double-check your measurement, wiring and programming.
Is the voltage OK (over 0.8*Vcc) when you disconnect the matrix or power only one LED statically ?
Regards,
Thomas
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
My repositories: https://github.com/karfas
Re: Output voltage < 3V
Thank you Thomas, measuring again helped.
I figured out, as I used a breadboard for the first time, I used it in the wrong way.
Kind regards, Bastian
I figured out, as I used a breadboard for the first time, I used it in the wrong way.
Kind regards, Bastian