SOLVED: LED matrix with ULN2803 and P-channel MOSFETs

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having trouble with my LED matrix setup. This is relevant part of schematic:

 

 

 

So, rows are controlled by MOSFETs. LR1, LR2.... LR6 are connected to ATmega32u4. Those pins are set as outputs. When one of the outputs is low, MOSFET is active, and voltage on row is VCC (5V). Yes, I realize those row resistors are low, but user is supposed to add additional external resistor - irrelevant for this discussion. When I set output to high, MOSFET is off and voltage on row is 0V. This part is okay and it works.

 

Second part of matrix is controlled by decoder and ULN2803 sink (LED columns). For testing, I am not switching columns at all - only the first output from decoder is active which activates first column (I've checked this - Y0 really is set to 5V, rest of the outputs are 0V). Now, when I connect positive side of LED to any LED row (all are activated - 5V on each) and negative side to first column connected to ULN, LED should be on, but it's not. I'm struggling to find out why. Am I missing something obvious here?

 

LED works if I connect anode to any active row and cathode to any GND pin - it won't work if cathode is connected to any ULN-connected column though.

Last Edited: Thu. Aug 24, 2017 - 03:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it really a uln2803 or 4?
What is the voltage on lc_1 when that column is activated?

Also if your programmer is plugged in, does that not share the spi pins? This might cause some conflicts with the column selects.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Is it really a uln2803?

 

Yes.

 

Kartman wrote:
What is the voltage on lc_1 when that column is activated?
 

 

40-60mV between GND and active column, and same voltage between GND and non-active columns.

 

Kartman wrote:
Also if your programmer is plugged in, does that not share the spi pins? This might cause some conflicts with the column selects.
 

 

It's unplugged during testing (connected to USB).

Last Edited: Fri. Nov 20, 2015 - 09:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shantea wrote:
40-60mV between GND and active column, and same voltage between GND and non-active columns.

 

Something doesn't sound quite right. Being darlington, the on voltage of the uln2803 is usually >1V. Also, the same voltage for active and inactive columns?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Shantea wrote:

40-60mV between GND and active column, and same voltage between GND and non-active columns.

 

 

Something doesn't sound quite right. Being darlington, the on voltage of the uln2803 is usually >1V. Also, the same voltage for active and inactive columns?

 

 

I think I have some other issues as well. Sometimes I don't have voltage across GND/COM pins on ULN at all, and sometimes it's 5V. Here's the full schematic, but ignore the LP2985IM5 4V voltage regulator that's supposed to power LED matrix - it's not connected at the moment so I'm using Vcc as power supply.

 

https://github.com/paradajz/Open...

 

And here's screenshot from relevant part of the PCB:

 

 

Highlighted line is connected to VCC at the moment, again, there is no regulator present on board at the momet. And yes, 238/2803 are soldered in correct direction.

Last Edited: Fri. Nov 20, 2015 - 11:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Where is 0V connected to pin 9 of the uln2803?

How much current do you expect to pass through 12thou tracks? Your pcb does not look viable.

Last Edited: Fri. Nov 20, 2015 - 11:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Where is 0V connected to pin 9 of the uln2803?

 

GND.

 

 

Kartman wrote:
How much current do you expect to pass through 12thou tracks?

 

12thou? Not sure what you mean by that. But, around 40mA max for single LED row, so trace width shouldn't be issue.

 

Kartman wrote:
Your pcb does not look viable.

 

I don't understand this part.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shantea,

 

I cannot see any connection from pin 9 of the ULN2803. That is what Kartman was hinting you should investigate.

 

12thou is the "estimated" width of the copper tracks.

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:
I cannot see any connection from pin 9 of the ULN2803. That is what Kartman was hinting you should investigate.

 

EAGLE and my multimeter seem to suggest otherwise (both ULN and decoder are turned upside down, if that's what you're trying to suggest). It's soldered correctly.

 

 

valusoft wrote:
12thou is the "estimated" width of the copper tracks.

 

Ah. It's 10mil.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just tried to tie one of ULN inputs (second one, more specifically) directly to Vcc. Now that column really is active, and connecting LED between any row (all are active) and 2nd column lights up the LED. So, logic would suggest something is wrong with decoder, however, I *do* get 5V from Y0 on decoder which *should* activate first ULN output, but it doesn't. Hm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The circuit says you use a 74ac11238 which is different to a 74hc238. You've designed the pcb for a 74hc238. So what is correct?

Whilst the 10mil track should be able to pass 40mA, you've not taken into account the impedance of the track and where currents are going to flow when you turn the leds on and off. Your 0V tracks need to be more substantial.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Although not the issue, you should have a resistor per LED not one per row as the LED current will vary depending on the number of LEDs that are on.

 

David

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
The circuit says you use a 74ac11238 which is different to a 74hc238. You've designed the pcb for a 74hc238. So what is correct?

 

My bad on schematic. It's 74HC238.

 

Kartman wrote:
Whilst the 10mil track should be able to pass 40mA, you've not taken into account the impedance of the track and where currents are going to flow when you turn the leds on and off. Your 0V tracks need to be more substantial.

 

I'll take that into account for next board revision.

 

Anyways I've fixed this. I managed to burn every single input pad for ULN on PCB so, of course, there was no connection between decoder outputs and ULN inputs. Ugh. Soldered the same components more carefully with lower temperature and everything works.

 

DAFlippers wrote:
Although not the issue, you should have a resistor per LED not one per row as the LED current will vary depending on the number of LEDs that are on.

 

How so? There are 6 resistors for 6 rows. Only one column is active at the moment, while all rows can be on. I don't need one resistor on each LED.

 

EDIT:

 

I did find another error on my PCB design - it hasn't affected me yet because there is no voltage regulator preset at the moment. By mistake, I connected EN pin to Vout instead of Vin (it's connected correctly on screenshots few posts above, I'm using a bit older design so I haven't noticed it). Will the regulator work that way or I need to cut the trace and connect it to Vin to work correctly?

 

Here's the datasheet (LP2985-N, 4V).

Last Edited: Sun. Nov 22, 2015 - 04:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My bad on schematic. It's 74HC238.

Then, as kartman said, the pins are connected wrong.

 

 

74ac11238

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John, but he'd laid out the board for a 238. Talk about a turkey shoot. Even Protel98 won't let me do that!

Anyways, it looks like a case of dodgy soldering. When the evidence suggests a violation of natural laws, there's got to be a fundamental reason.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
John, but he'd laid out the board for a 238. .

 

Yeah, it's working now.

 

Kartman wrote:
Anyways, it looks like a case of dodgy soldering. When the evidence suggests a violation of natural laws, there's got to be a fundamental reason.
 

 

Indeed, works on new board. I really need to invest in SMD soldering gear.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For soldering soics, i just use a standard soldering iron and some flux gel. I use a hot air tool for qfn and desoldering.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear , Why dont you use  fet  instead of ulnxxx ???

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The thread was markd as SOLVED 2 years ago - a bit late to be suggesting changes now!!

Topic locked