[SOLVED] Output voltage < 3V

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
baschni
Posts: 4
Joined: Mon Nov 22, 2021 11:10 pm

[SOLVED] Output voltage < 3V

Post by baschni » Mon Nov 22, 2021 11:55 pm

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
Last edited by baschni on Wed Nov 24, 2021 11:09 pm, edited 1 time in total.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Output voltage < 3V

Post by Roberthh » Tue Nov 23, 2021 6:38 am

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).

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Output voltage < 3V

Post by pythoncoder » Tue Nov 23, 2021 9:36 am

Are you using current limiting resistors?
Peter Hinch
Index to my micropython libraries.

baschni
Posts: 4
Joined: Mon Nov 22, 2021 11:10 pm

Re: Output voltage < 3V

Post by baschni » Tue Nov 23, 2021 4:43 pm

So I am not so sure where my problem lies. Maybe it is better if I show all the wiring to you:

Image

Image

Here is the wiring:

Image

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)
This should light all leds in one row with a 1 second pause in between.

baschni
Posts: 4
Joined: Mon Nov 22, 2021 11:10 pm

Re: Output voltage < 3V

Post by baschni » Tue Nov 23, 2021 4:50 pm

What happens is visible in the following images:

Image

Image

Image

Image

Image

Image

Image

Image

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?

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: Output voltage < 3V

Post by karfas » Wed Nov 24, 2021 6:52 am

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.
baschni wrote:
Mon Nov 22, 2021 11:55 pm
When I now activate some pins (pin.value(1)) I get voltage output lower than 3V (e.g. 1,8V or 0,2V,
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! :D
My repositories: https://github.com/karfas

baschni
Posts: 4
Joined: Mon Nov 22, 2021 11:10 pm

Re: Output voltage < 3V

Post by baschni » Wed Nov 24, 2021 11:09 pm

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.

Image

Kind regards, Bastian

Post Reply