1
\$\begingroup\$

IO Expander MCP23017 is used to drive ULN2003 which drives 24v relays.

60% PWM power to relays cause them to heat less. As MCP23017 doesn't have PWM output, thought of switching the ULN2003's GND (Pin 8)with a transistor at 1KHz.

Lots of IO expanders are required and the PWM IO Expanders cost almost double than that of MCP23017, have thought of this alternate idea.

Is this a right way? If so, will it cause any damage to ULN23007 in long run?enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Your pin 9 is wrong! As it is now it will connect your outputs to ground. It should go to 24VDC. \$\endgroup\$
    – Oldfart
    Dec 30 '19 at 10:29
  • \$\begingroup\$ Thanks for pointing out. Schematic updated. \$\endgroup\$
    – John
    Dec 30 '19 at 10:35
1
\$\begingroup\$

switching the ULN2003's GND (Pin 8)with a transistor at 1KHz.

No,that will not work.

At the moment that you 'switch' the ground off you have lost the reference against which the inputs switch. In other words: your whole ULN2003 is floating and you have no idea how the inputs will react to that, but my educated guess is bad.

Much better if you would switch the 24DC supply with a high-side switch.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks. Will the high side 1KHz switching cause any shortage of life span to ULN2003? \$\endgroup\$
    – John
    Dec 30 '19 at 10:59
  • \$\begingroup\$ @John probably not, no. By the way, your I²C IO expander should be plenty fast enough that you can change its state 1000 times a second, so a pure software solution might work. \$\endgroup\$ Dec 30 '19 at 11:10
0
\$\begingroup\$

As MCP23017 doesn't have PWM output, thought of switching the ULN2003's GND (Pin 8)with a transistor at 1KHz.

the MCP23017's I²C interface runs at 100, 400 or 1700 kHz – you definitely have plenty of time to just tell the IO expander to turn all outputs off, turn the right ones back on, turn them back off... to achieve a 1 kHz PWM fixed-duty cycle pulsing.

So, that's a pure software solution without any hardware implications.

Lots of IO expanders are required and the PWM IO Expanders cost almost double than that of MCP23017, have thought of this alternate idea.

How about not using expensive IO expanders, then? For the roughly 90ct that these things costs, you could have bought a beefy MCU with configurable I²C addreses, or the ability to daisy chain via SPI, lower power consumption, multiple independent PWM controllers, and the ability to process both in- and output signals locally.

I'm specifically thinking of ARMs, and here something like the least-end STM32 or SAMD families.

Of course, you can also really buy an MCU and just use it as a "puppet", i.e. as an IO expander that doesn't run any own firmware; see Micah Scott's article in PoC||GTFO 0x10, p. 26ff, where she controls ARM microcontrollers via their SWD programming/debug interface.

cost double...

while we're cost-optimizing: not only is the ULN2803A ancient and almost never the optimal part for any given job, it's also pretty expensive. You can buy lower Ron darlington transistors for 5.6ct per piece at 100 pieces, if you can live with the additional soldering work. Also, I'm not even sure you need darlingtons – driving a relay could very well be done with a simple BJT or logic-level MOSFET.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the valuable inputs. \$\endgroup\$
    – John
    Dec 30 '19 at 13:18

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.