Here are a few more clues:
- Arduino PSU is dead - does not produce any voltage on output
- MCU is dead - does not function, does not properly enumerate via USB
- Both transistors seem ok
- Flywheel diodes seem ok
- Motor runs fine
Also always use a 1k-10k from the transistor's base to emitter to close the transistor fully when the mcu's pin is floating.
I don't think it's needed because the high impedance microcontroller output will not allow any current flow and the transistor is current (not voltage) controlled - i.e.
this answer - I was thinking of adding it anyway, but because I'm not doing a PCB for this I want to keep it as simple as possible to make it fit nicely on a perfboard.
Can your transistor handle 3A for at least some 100-200 ms, preferably for unlimited time?
Do you have the freewheeling diode, i.e., a half bridge? How about DC link decoupling?
Thanks for the rules of thumb. The 2N2222A is rated for 800mA continuous and that's all that is published. I tested the motor, the steady state current draw is 0.23A and stalled rotor is 1.35A.
I pulled the transistors to test them and they seem to work fine. I like the suggestion to use 2 in a darlington arrangement (thanks David Hess), but since I have some mechanical relays on hand I will just use those. For those that suggested a FET or opt-isolator - good ideas but I'm just trying to use what I have on hand.
Yes, freewheeling diode. No to half bridge - don't need the extra control.
I would suspect the voltage regulator on the Nano to have been smoked. That Meanwell S-25-12 can be 'tuned' to 10.8 V to 13.2 V output.
The Nano reference design utilizes a TI UA78M05CDCYR that is quite beefy, however a lot of clones get away with AMS1117 for example. 12 V is already the maximum nominal input for that LDO, while the TI part can handle more.
The LDO is dead. I bet you're right about it being the AMS. I know it's not great to disspate all that voltage as heat (12V-5V) but the total current shouldn't be more than 4.5 mA (31 mW) (and even less now with a relay). Thats only a 2.5 deg C juction to ambient increase in temperature on the AMS (assume 80C/W with 700mm2 ground plane, rated to 130C)
I'm not sure how to drop the voltage practically. I think I'll tune down the PSU as the solenoid and motor should easily run off less than 12V (wait, they were cheap and didnt even populate the pot...), and maybe get a genuine Arduino... the AMS is rated to 15VDC and was running fine for long periods of time (without the motor switching on/off), so my plan is to keep it as is - and hopefully the other changes fix the issue.
Also, this is a brushed motor and I see no external bypass cap.
True. I read that a bypass cap is really only needed to suppress noise, which I don't think would cause this issue?
But I did hook it up to the scope and there are some large voltage transients. The scope did not trigger when I connected the probes across the supply and started/ran/stopped the motor so I think the LDO wouldn't see higher than 15V and burn out... Nonetheless the voltage across the motor when stopping doesn't look great - just like you said. Didn't think we would see them since I have the diode on there - maybe the 1N4007 is just slow for forward recovery (i.e. slow is around a microsecond). I added a 10nF cap across the motor and it seems to have elimiated them though.
Also, it takes about 70ms for the inductive motor stopping current to dissipate through the resistor - seems a bit long, any comments?
So TLDR, going to add a cap across the motor, connect 0VDC to AC GND, and use a relay instead of the 2N2222A. I'll let you guys know what happens when I try again.