Hi all,
Quick background: I built a water sampler with an on-board data logger for recording the volume of liquid pumped. I had it set up and working well, and after numerous short-term runs, I deployed it for a 3-week test run off a 12V battery. Everything worked great! However, after that long deployment, it started behaving very strangely.
Attached is a breadboard diagram of the circuit as a whole (the three dangling wires at the bottom go to a flow meter), but the issue is specifically with the motor-control circuit.
I'm controlling a 12V DC water pump with a 3.3V 8MHz arduino pro mini, using a 2N2222 NPN transistor. I have a 120-ohm resistor running from pin 6 to the transistor base, and have it programmed so that the pin goes HIGH for about 1 second every 2 minutes. I have the motor ground line connected to the transistor collector, and the emitter is connected to ground. I soldered a 1N4001 diode across the motor terminals as a flyback.
The issue is that after working great for a long time, the arduino pin now gets stuck in the HIGH position when I power the circuit on. Curiously, it's not the arduino hanging-- it's clearly looping through all it's other functions just fine. After poking around with my multimeter, I became concerned that perhaps voltage was flowing back from the transistor base, and so I inserted a 1N5817 diode (just because it was handy) in series with the pin. That didn't solve the issue. Then I checked to see if maybe the pin was damaged. However, when I remove the motor from the circuit, the pin behaves correctly from the get-go. When I add the motor back in, power it up and then hit the reset button, it also works normally. I've tried using different pins, but all with the same result. My conclusion is the pin isn't the issue.
From combing through the forums, I suspect my issue is latch up, but I'm afraid I don't know enough about the phenomenon to know why it's happening all of a sudden, and what I can do to fix it. The current being drawn from the arduino pin to the transistor base is about 14mA, which seems reasonable. The motor is only pulling at most 350mA from the battery, which is in spec with the 2N2222. My only hunch is that I might fare better using a TIP-120 MOSFET, but I have no basis for this other than I can't think of what else to try.
Any thoughts are extremely appreciated, I've been banging my head on this for days.


