Arduino Randomly dieing underload!

Hello hope you guys are having a wonderful day, here is my circuit, instead of the dc motor I have a pump that turns on and off due to the value of A0. The pump is intended to turn off and on, due to commands sent over the internet. The circuit works perfectly out of water with no problem. However when the motor is in water and the load is high, occasionally the arduino breaks and the serial connection is severed, and the arduino needs to be reset. Let me know how I can fix and address this issue thanks so much :slight_smile: I was thinking about a relay circuit but I am unsure where to put it!

I see 2 possible problems:

  1. power supply too weak
  2. missing flyback diode across the pump

yea I think thats a good solution, I do have a flyback diode but I was considering, adding an extra one to the ground of the motor let me know what you think

That won't work.

Try using a MOSFET instead of an NPN BJT and connect it as a low-side switch instead of a high-side switch.

can you explain why a mosfet would fix it, I dont have one atm, so it would be a bit tricky to get it, what about my current circuit is wrong

An appropriate NPN would work too, but only if configured as a low-side switch. However, a MOSFET is more common in an application like this especially because you're trying to run a relatively high-current device (motor) controlled by a high-impedance GPIO. A MOSFET is more usual in this application.

To select the right transistor (MOSFET or NPN if you're married to the latter), indicate the specifications and particularly the stall current of the motor.

You're trying to switch the positive supply to the motor with an NPN transistor and that won't work, since the base-emitter voltage is limited by the load the motor poses. You'll end up having to drive the base higher than the supply voltage, which your GPIO won't do. And this could also lead to problems violating the base-collector voltage (which you'd drive negative to some extent), frying the transistor. So simply put: it won't work because the transistor won't switch, and if you try to make it work, you'll kill the transistor.

Google "low side switch mosfet".

The diagram posted cannot work. You cannot power a motor / pump from the Arduino's 5V pin. What kind of pump has 3 wires? What is the pumps current rating?

Thank you for your amazing explination, One question, if instead of using arduino 5v if I used an external powersources 5v would that fix it? sorry for bad spelling, I can only code no spell. If not ill go get a mosfet. The transistor is not bieng fried, this is a 5v motor, and it only breaks while under load when the motor goes against high resistance. I think you could be right, I am just wondering if I can fix with just an external power supply

wdym, Yes I can the motor powers up and works well when connected just to 5v and ground, the problem is when turning it off and on. The pump only has 2 wires power and ground

Indicative of an inadequate power source. Need more current.

ok ill try it with an external power source today, It is ok if the motor is slow I just dont want the circuit to break! Thanks for the help

The external power supply will surely help; see the other responses. But in addition to this, it would make sense to configure your transistor as a low-side switch instead of a high-side switch. Even if it works, you're probably driving it into its linear region, which means it burns energy and heats up, which is unnecessary.

A MOSFET will be more efficient anyway because an appropriately selected MOSFET will hardly drop any voltage (if connected properly).

Here's the proper way to connect an NPN transistor and motor.
NPNMot_1

1 Like

My man/woman/nonbinary person thank you so much bro cheers will give it a shot

it worked thanks bro, made my day

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.