Electronic – ULN2803 not working like I expect, or at all

raspberry piuln2803

I am a total electronics noob trying to build a simple circuit for a jukebox that I'm making using a Raspberry Pi and an old jukebox wallbox. I'm a computer systems engineer by trade. And it's my first time asking a question on SE, So please go easy 🙂

I am integrating a Raspberry Pi with a 3 digit LED display. Each of the numbers uses a single ground across all 7 segments, and each segment is tied together on the numbers. (IE, the top segment is a common input across all three digits, and if I wanted to light it up on the first digit only I would connect the ground on the first digit only.) The Pi is capable of lighting up all 7 segments at a time on a single digit using GPIO, but that would be too much current to sink with a single ground GPIO on the Pi. I saw somewhere a recommendation that a ULN2803 could be used for switching common connections. By taking a GPIO high on the Pi it would connect the corresponding pin on the ULN2803 to common, completing the circuit. Basically acting as a solid state relay. So I got a small breadboard and some ULN2803APG and tried building the circuit with an LED. I have common from the breadboard bus connected to pin 9, and common from the LED going to pin 18, and the LED connected to the + bus. My understanding of how this should work is that when I take ULN2803 pin 1 high by connecting it to the power supply positive lead the LED should light because the ULN2803 is connecting the negative lead. But that doesn't happen. If I move the LED connection from ULN2803 pin 18 to common the LED will light, so I know the LED is good. But I have no idea why this isn't working. Do I have the wrong idea of how this should work? Or do I have the wrong ULN2803? Or am I too low voltage? Or am I doing something else wrong here?

For a ULN2803 pinout I'll reference this drawing:
https://components101.com/asset/sites/default/files/component_pin/ULN2803-IC-Pinout.png

Hopefully I've explained everything well enough. The LED and keyboard work the same way with common grounds so I have to figure this out to be able to integrate with them. Altering them is out of the question, nothing good will come from trying to alter 40 year old PCB. Thanks for your help.

Here's my breadboard circut:
enter image description here

The eventual LED matrix that I need to integrate with:
enter image description here

EDIT– So I was partially mistaken… the LED does light, but it's so faint that unless you're looking straight on at it (IE, not from the side) you can't see it. Not sure what that means.

Best Answer

Ah, ULN2803 is a 8-channel (low side switching) sink driver, for common anode LEDs.

For common cathode LEDs, you need the complement/mirror: UDN2981 (high side switching) 8-channel source drivers.

The following schematic might help to tell the difference between high side and low side switching.


h/l side switching


Appendices

Appendix A - 7-segment LED Circuit Design v0.1


7 seg led cct v0.1


Appendix B - Using software switchable PSUs to replace UDN2981

Idea: one switchable PSU per LED.


switch psu