Arduino Uno, ULN2803, Relay, and 24VDC Pump

I am using an Arduino Uno to drive a single input on a ULN2803 connected to a 12VDC relay. The power for the relay and Arduino are from separate 5V and 12V outputs of the same power supply. The 12VDC relays is used to control a 24VDC pump (power supplied from a separate supply). After a few toggles of the output/relay/pump the Arduino freezes/becomes unresponsive).

I have used ULN2003 and ULN2803 for years. The ULN2803 pin 1 is attached to the Arduino output, pin 10 is connected to 12VDC, Pin 18 connected to the relay coil (the other relay pin also connected to 12VDC). Pin 9 is connected to the arduino ground and also the 12VDC ground, which end up being the same ground on the same power supply. Additionally, I have installed a snubber diode across the 24VDC pump (just in case).

I'm trying to figure out what is causing the Arduino to lock-up. Any thoughts?

Unless you made an error typing your description...
On the ULN2003 pin 9 is the free wheeling diode common and should be connected to the relay 12 Volts. Pin 10 is the 7th Darlington output. Your current setup is not quenching the kickback from the relay.

OOPS, you are using ULN2803, sorry! (Blasted 5 minute wait...)

Due_unto:
Unless you made an error typing your description...
On the ULN2003 pin 9 is the free wheeling diode common and should be connected to the relay 12 Volts. Pin 10 is the 7th Darlington output. Your current setup is not quenching the kickback from the relay.

Everything your said is true except that I'm using the ULN2803. The pinout of the ULN2003 and 2803 are not the same.

Show us an image of the wiring.
May have to insert some ferrite beads on power leads and/or add some capacitors across the pump etc.

.

I could take a picture but it would not be worth while as the boards and power supplies obscure most of the wiring and the pump is located in another enclosure. I don't have anything to draw a schematic. The wiring is very straight forward. Arduino -> ULN2803 -> Relay -> Pump.

What are you thinking?

If you have extra long wires in the shape of a birds nest :wink: you maybe experiencing crosstalk.

.

The wiring is all very neat. I build control panels for a living. The wiring is routed under the boards and the power supplies and boards are stacked to fit in the smallest enclosure possible.

Is the 24VDC supply for the pump isolated from the Arduino/ULN2803/Relay circuit (24V negative not connected to GND)?
Does the problem go away if you disconnect the pump?
What is the pump motor rating?
What is the rating of the reverse connected diode across the pump motor?

dlloyd:
Is the 24VDC supply for the pump isolated from the Arduino/ULN2803/Relay circuit (24V negative not connected to GND)?

Yes. And quadruple checked. Pump power supply ground to pump directly, power to relay COM contact and NO contact to pump.

dlloyd:
Does the problem go away if you disconnect the pump?

It appeared to, but the relay also stopped. I need to fire the relay without the pump and see if the problem still exists.

dlloyd:
What is the pump motor rating?

24VDC, 2A max.

dlloyd:
What is the rating of the reverse connected diode across the pump motor?

It is either a 1N4001 or a 1N914 diode. I have used either for years...on relays. This is the first time driving a 24VDC pump (motor) with an Arduino. At work I use Allen-Bradley PLCs and I/O modules.

Thanks for your reply.

It is either a 1N4001 or a 1N914 diode. I have used either for years...on relays. This is the first time driving a 24VDC pump (motor) with an Arduino. At work I use Allen-Bradley PLCs and I/O modules.

Unfortunately, both diodes are under-rated and it would have failed. Try a 1N5404 Datasheet (or similar)

Which rating do you think is under rated?

adwsystems:
Which rating do you think is under rated?

The current rating of the diode.

It would be the average forward rectified current. This should at least match the load current (2A max) but I think a 3A diode would be a better fit.
EDIT: Grumpy beat me to it ... yes, the current rating of the diode.

The diode is not passing any continuous or rectified current. It is reversed biased across the pump terminals. By that logic, the current is 0 and all diodes work.

The back EMF varies with the load on the motor, during startup and turn off.

True. But the back emf is generated and contained within the motor. This is indirectly related to the flyback voltage/current spike seen when the power is removed. If the motor is under more load, then it is drawing more current, therefore the fields within the motor are stronger. When the power is removed under heavy load the flyback surge is larger due to the larger fields that had been built up while running. The voltage and current spike are both instantaneous and enormous (actually infinitesimally short and infinitely large if you try to do the math). Neither the voltage nor the current ratings for the flyback spike are covered in a diode datasheet, other than to say they are so short as to not cause any damage. With that said, the blocking voltage applies directly. If I was using a 50V motor, then a 1N4001 (Vdc=50V) would be a bad one to use.

IMO both the 1N4001 and the 1N5404 would work however the 1N914 is really pushing the envelope.
I/we have used 1000s of 1N4007 diodes in similar situations.

If your are still having problems with the pump removed, you have to disconnect a bit more to see if you can trace things further.

Send continual pulses to the relay, see if you can see any spikes on key points with an oscilloscope.

.

A better link ...
http://forum.arduino.cc/index.php?topic=164421.0

Perhaps you could test your existing 1N4001 to see if it's defective?

By that logic, the current is 0 and all diodes work.

So that should tell you that logic is wrong shouldn't it?

dlloyd:
A better link ...
Understanding DC motor freewheeling - Motors, Mechanics, Power and CNC - Arduino Forum

Perhaps you could test your existing 1N4001 to see if it's defective?

That matches with my earlier post. Good point, I should check the diode is not an open. If was was installed backwards or a short the pump would not run and would have likely burned out during bench test while the cover was off the pump enclosure.

Grumpy_Mike:

adwsystems:
The diode is not passing any continuous or rectified current. It is reversed biased across the pump terminals. By that logic, the current is 0 and all diodes work.

So that should tell you that logic is wrong shouldn't it?

I agree, the logic of selecting a diode based on forward current is not correct.