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.
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.
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 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.
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.
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..
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.
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.
??? 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.
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).