ULN 2803a and PWM

Hi all, I will be sinking the cathodes of 16 leds through 2 uln2803a darlington arrays to GND. They will be controlled by the GPIO of a mcp23017 so I can't dim them that way. I was wondering if I could use a transistor to dim on the common GND powered by a pwn pin on the arduino? I want all the LEDs to dim the same.

It is for a set of led ring illuminated push buttons that I want to be able to dim for at night etc.
Thanks

uln2803: ULN2803A Darlington Transistor Arrays datasheet (Rev. H) (ti.com)
MCP23017: MCP23017/MCP23S17 Data Sheet (microchip.com)
Button:
image

Take a look at the TLC5947 24-Channel, 12-Bit PWM LED Driver With Internal Oscillator. It has a Blank pin that will you to shut everything off.

Thanks, that is not I2C so I would need to put extra data wires to the arduino as my buttons are on I2C through another mcp23017 but that is possible. It also seems overkill since it drives 24 and I only need 16 but I suppose that doesn't matter.

Maybe replace the mcp23017 that's connected to the ULN chips with
pca9865 pca9685 or sx1509?

Also, I don't think you want to connect the COM pins of ULN2803 to ground:


Just leave them unconnected.

Connecting COM to ground will make all 8 outputs essentially GND.

Loads will ‘turn ON’.

Example, if there were 8 lamps connected to the outputs, COM going to GND would turn ON all the lamps (lamp test :wink: ).

Thanks for spotting the error. Also that chip looks interesting. I think it is a better option. I will design it in and report back

Sorry, I got the part number wrong, corrected above!

I worked out the part number thanks. What do we think about this:


Im only using 3 addressing pins which will be going to a dip switch. I presume OE goes to ground for arduino. Do you think I need the darlington arrays in this case?

i noticed the vss to gnd missing

Vss needs to connect to GND.

OE is LOW to enable the chip.

You need de-coupling on Vdd.


“ Do you think I need the darlington arrays in this case?”

If you are expecting to handle LED currents, yes.

what type of cap would you use? Considering smd manufactured pcb but the chip is not available so may have to solder this in myself. Trying to make compact.

Ceramic 100nF ( .1 µF ) from the VDD pin to GND.

100nF not 10uF

yeah i posted before i saw your post, changed that :wink:

o.1uF was recommended on the mcp but should i just use the same as the other one?

Also do you think I need both resistors on the SDA SCL lines or would one set be enough for both chips since they are right next to each other?

Remind us what Arduino board you will be using ?

it will be a nano 33 IOT

When two devices share SCL and SDA you only need one set of pullup resistors.

perfect and what do you think of the caps, should they both be the same? I am moving the final pieces on the PCB layout. I have looked up a lot on decoupling caps but it is a minefield

You need one capacitor for each chip; install close to the VDD pin.

should i use the same type of cap for each, I think it is easier for the pcb manufacture if I limit parts