Solenoid Help and Suggestions, Please

Hi Guys,

Just wanted to start off with I am not an EE, but rather a hobbyist (My actual profession is a Network Engineer), so if I am making an obvious mistake, as from an EE's standpoint, it wouldn't surprise me. I also want to preemptively say thanks to any help that I may get. Here is my situation:

I have an Arduino Uno Rev 3. I am trying to drive a 12V choke solenoid on a gas-powered motor. Obviously, I cannot directly drive that voltage or amperage from my little Arduino. So, on my D4 port, I connected a 10K resistor to a NPN Transistor (BC547) which gives ground to a little 5V SPST relay. I am using a fly-back diode (1N4004) right on the poles of the relay. When ground is given to that relay, it bridges 12V from a lawn mower battery over to the solenoid. The problem is there isn't any fly-back diode on the solenoid and it's grounded to the chassis of the motor.

If I just disconnect the solenoid, I can have the Arduino turn the choke "relay" on and off practically forever it seems with no issues, but the instance I put the solenoid back into the circuit, the Arduino will freeze after the choke opens and closes once or twice. I have to unplug the Arduino and plug it back on to get it work again after that.

The solenoid draws around 1.0 amps when I put my amp-meter on it and have it engaged. I suspect fly-back noise is what is causing my problem, and I would guess placing a fly-back diode on the solenoid would resolve this. However, the issue becomes problematic as I can't really get to the solenoid to solder anything on it, and it one has one lead. It's other "lead" is that it is grounded to the motor chassis, so I am forced to turn it on by giving it 12V.

I read another post on here (SOLVED: Solenoid woes - causing arduino to freeze up when used via relay (Help!) - General Electronics - Arduino Forum) that this guy had a similar problem, which he eventually fixed by simply putting on a fly-back diode on the solenoid. I cannot do this. Basically I have a 10 foot AWG-16 wire coming out of the relay that runs to the solenoid, giving it it's 12V to turn on.

What suggestions could be done to resolve this issue?

Please, let me know if there are any questions I can answer to derive a more correct answer?

Have you got a common ground between the 12v and arduino ground? If so I'd suggest you shouldn't have.

evincent:
this guy had a similar problem, which he eventually fixed by simply putting on a fly-back diode on the solenoid. I cannot do this.

Of course you can!

Not only is it not necessary to put the diode directly across the solenoid, it even is the wrong practice to do so!

So you can put the diode between relay terminal and the lawnmower battery negative. Anode to ground.

In regard to KenF's comment, if the lawnmower battery is only powering the lawnmower, then there should be no connection between the Arduino and relay coil circuit, and the lawnmower battery - keep the negative terminals separate. Equally important, is that your lead to the lawnmower be a cable carrying both connections together, so that there is no "loop" formed between the two wires. Similarly for all other connections; keep them closely together; keep the connections to the Arduino and relay coil well away from the connections to the relay contact, lawnmower battery and solenoid.

Sorry for the late reply. KenF, I unfortunately do need to tie the grounds together, as after this, the arduino and the solenoid will both be on the 12V battery (the arduino on a step down regulator, of course).

As of Paul, I do believe putting the diode on the output of the relay side, as you described it, has worked. Thanks for the help!

If you want to be really thorough you could add a diode directly across the solenoid
too, since that protects against arcing damage if any of the intervening cabling has a
dodgy connection.

There's no problem with just having the diode on the solenoid, BTW, that will stop the
voltage spike quite happily. With long cables you could get ringing along the wiring
on turn off, but that won't be more than twice the supply(*), whereas the inductor voltage
spikes could be 1000's of volts.

(*) In particular the RFI generated is about the same as the wiring generates on switch-on.