0
\$\begingroup\$

I have put together the following circuit to drive some 12V pumps from a micro-controller using a ULN2003, but it has a few issues.

First issue is that the relays click in immediately. I want the relays to only kick in when signalling from micro.

The second issue is that when the motor comes on, it stays on. I think it is browning out everything and causing havoc. With the motor running I read 2-4V at the com pin of the ULN2003.

enter image description here

Does this schematic look correct? What would cause the motor to do that?

\$\endgroup\$
2
  • \$\begingroup\$ So what's the question? Edit your question. You suggest that you have a power-supply brownout problem but you give no details of it. We can't guess. \$\endgroup\$
    – Transistor
    Apr 15 '16 at 8:43
  • \$\begingroup\$ Try pull downs on all the ULN2003 inputs and how about fitting some capacitors on the power rails. \$\endgroup\$
    – Andy aka
    Apr 15 '16 at 8:45
1
\$\begingroup\$

Your schematic is missing some very important components that must be in place to produce a stable design. Adding these will go a long way towards fixing the problems with the upsets that happen when the relay clicks in or out.

enter image description here

Add the 1N4001 diode as close across the relay coil as possible.

Place the 10uF capacitors near where shown.

Place the 0.1uF capacitor as close to the MCU pins as possible. It would actually be good to place a second 0.1uF capacitor at the MCU VIN pin as well.

The problem with the initial click in of the relay is due to the inputs of the ULN2003 going high right as the MCU power goes on before the software gets a chance to get the corresponding port pins programmed as outputs that are driven low. The likely way that this can be fixed is to add a 1K or 1.5K ohm resistor from the input of the ULN2003 to GND. Note that there are some microcontrollers where this solution will not work but since you did not specify your MCU type it is not possible to be fully sure.

\$\endgroup\$
5
  • \$\begingroup\$ Good catches, Michael. I would have assumed that the ULN2003 internal diodes would suffice for the relay flyback. Have you seen problems with this approach? \$\endgroup\$
    – Transistor
    Apr 15 '16 at 10:01
  • \$\begingroup\$ I have read that the internal freewheeling diodes in the ULN2003 should handle flyback, but extra protection can't hurt. Would you suggest tantalum or ceramic caps? \$\endgroup\$
    – TheGwa
    Apr 15 '16 at 10:05
  • \$\begingroup\$ The diode wants to be right at the relay coil so as to keep any high voltage transient off the circuit board. The internal diode(s) inside the ULN2003 usually end up too far away due to trace lengths. \$\endgroup\$ Apr 15 '16 at 10:06
  • \$\begingroup\$ @TheGwa - Use ceramic capacitors for the 0.1uF capacitors. The suggested 10uF capacitors can be multilayer ceramic, tantalum or even decent quality aluminium electrolytic. Make sure the voltage rating is well above the VCC rail voltage. \$\endgroup\$ Apr 15 '16 at 10:09
  • \$\begingroup\$ I will give this a try. \$\endgroup\$
    – TheGwa
    Apr 15 '16 at 11:50

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.