Electronic – How to calculate current limiter resistors for ULN2803 and Relay

current-limitingmicrocontrollerpulluprelayuln2803

I'm designing a digital I/O, and for the outputs I have ULN2803 and relays. I have the schematic below.

The coil current of relay is 16.7mA, ULN2803's max input current is 1.35mA and output current is 500mA/per channel used.

How should I calculate the current limiter resistors? My MCU works with 3.3V, driving the relays with 24V. What happens if a current flows more than 16.7mA to the relays?

And should I use pull-up or down resistors for input and outputs. I don't want any floating pin and activate the relay when I don't want.

enter image description here

enter image description here

enter image description here

THANK YOU!

Best Answer

The ULN2803 is a darlington transistor array, meaning it works basically just like a normal transistor - a current controlled switch. This switch does not push current through the relay, it is merly closing the circuit "VCC-Relay-ULN-Ground".
You can also see this in the datasheet: the 500mA are an absolute maximum rating, not a characteristic that is simply always fulfilled. Therefore, you do not need any current limiting resistors on the output side.

If you used a single transistor, you should use a current limiting resistor on its base, but this is handled by the ULN.

Concerning pullup/pulldown resistors: I would recommend to use a ~10k pulldown on the input side. Generally you don't need it, but it can prevent the relay from switching on when the uC is in reset state.