Erratic performance when pulsing solenoid

The circuit shown below works perfectly except when attached to the solenoid. I thought I'd protected it from inductance spikes with the usual diode but it's stuttering and sometimes locking up (D9 staying high) when operating the solenoid under load.

If I replace the solenoid by a purely resistive load such as several 12V lamps, with a current consumption of 3A (i.e. more than the solenoid's 2.4A max), there's no problem. Unless I've somehow damaged D9 I guess there must still be a noise issue. Could it perhaps need another snubber diode across the solenoid itself? Before I try that and more diagnostics I'd appreciate others' thoughts please.

Yes a diode across the solenoid is required.

Let’s assume the solenoid requires 1A, you will need a 1A diode across its terminals.

BTW, in your schematic, the diode is incorrectly connected, it should be across the relay coil.

2 Likes

Hi,
besides correcting the diode that should be in parallel with the relay coil as mentioned by @LarryD ,
Electrical noise greatly affects the correct functioning of micro controllers.
I suggest using a snubber on the relay contacts to reduce the production of electrical noise.

" Snubber - Wikipedia "

Thanks Larry. Just came back to report that meanwhile I went ahead and soldered in a diode across the solenoid and it has fixed the problem. It’s another 1N4006, so ample for the 2.4A solenoid.

Careless drawing error I missed! Not reflecting the actual wiring of course.

Thanks, yes, see my reply to Larry just now.

Are you recommending a third diode?

A 1N4006 is only 1A.

In you schematic the solenoid has a fuzzy "5V" near it. Is that a mistake, or is it a mistake to feed it 14.4 volts?

a7

Thanks, I’ve been labouring under that misunderstading for years!

Although it’s apparently working I’ll find a 3A replacement.

You probably will get away with it, but then, it will fail short when you want to use the circuit the most :scream:

Thanks a7, that 5V smudge must be a spurious result of my editing. After drawing in Circuitmaker I then had to use my image editor to add the doted lines, Guess it arose there.

The solenoid is rated at 24V but works fine from my ancient, heavy duty, power supply at 14.4V.

1 Like

There is a peak current rating where the diode will accommodate much more than its continuous rating, however, the rule of thumb is to use the same amperage as being drawn.

If I ever knew, I’d certainly forgotten that handy rule of thumb, thanks!
Ordered these from amazon.uk
1N5402 Rectifier Diode 3A 200V (Pack of 25)

The 1N5402 is a good choice.

3k3 is a way to high base resistor value, assuming you use a 5volt/75mA sugarcube relay.
Lower that to 470ohm.

I would drop that relay altogether and use a logic level mosfet to drive the solenoid directly.
That relay won't last long with a 700ms cycle and no diode across the solenoid.
Leo..

1 Like

Thanks, I’ll open the case and power up the soldering iron again. Didn’t give due thought to the base resistor’s value.

Will also consider a MOSFET, although as per post #4 I did quickly add the solenoid’s protective diode. (Albeit a poor choice!)

Re the MOSFET alternative, I'm considering rebuilding in a slightly larger case to accommodate greater control. At present the existing ones are minimal:

  • Applying power (no on/off switch or button).
  • Duration options (5/30/60/90/120/300 s) are made with a 10k preset accessible through a small hole.

However I'm now considering adding options for high and low pulse lengths to extend application potential beyond the simple spray can shaker. At present I've been doing so by tediously removing the 328 from its socket, editng the code in a UNO, and replacing it. If I do rebuild then I'll take the opportunity to replace the NPN and relay with a MOSFET as you suggest.

Revised schematic:

@ruilviana
I found this discussion about where to place the flyback diode:

https://electronics.stackexchange.com/questions/93452/correct-use-of-flyback-or-snubber-diode-across-motor-or-transistor

Hi,
No,
no more diodes.
I'm recommending the use of a snubber with capacitor and resistor in parallel with the relay contacts according to the link I posted.

" Snubber - Wikipedia "

1 Like

??? A 470R resistor would feed 10mA into the transistor base and even a pretty grotty transistor should have an Hfe of 100 or so. Hfe of 100 and 75mA implies base current of 0.75mA or 6.67k. 3k3 should be just fine.

2 Likes

Thanks, I'm reassured, and pleased that I had not yet changed it. As I always do, I measured the Hfe it to ensure it was over 100 (think it was over 200).

Understood. Does 120 R in series with 0.1 uF, across the relay contacts (not the solenoid) sound OK?

I'll add it if/when I do the rebuld I mentioned in post #15