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


  • \$\begingroup\$ If the relays are designed for 24V, then you don't need resistors. \$\endgroup\$ – HandyHowie Aug 8 '19 at 10:30
  • \$\begingroup\$ Even pull-up or down res? \$\endgroup\$ – Teoman Açıkgöz Aug 8 '19 at 10:35
  • \$\begingroup\$ The ULN2803 has built in pull downs, so additional pull downs shouldn't be needed. \$\endgroup\$ – HandyHowie Aug 8 '19 at 10:47
  • \$\begingroup\$ You don't need input or pull-down resistors and you don't even need the diodes (they are redundant with the COM connection to +24 - the ULN2803 has internal diodes for this exact purpose). \$\endgroup\$ – Spehro Pefhany Aug 8 '19 at 14:22

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.

| improve this answer | |
  • \$\begingroup\$ Did you mean the digital inputs? or Input side of the ULN (asking for pulldown res.)? \$\endgroup\$ – Teoman Açıkgöz Aug 8 '19 at 11:08
  • \$\begingroup\$ I meant the input side of the ULN, but as HandyHowie pointed out the ULN has internal pulldowns, so there is no need for additional ones. \$\endgroup\$ – K. Krull Aug 8 '19 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.