Both motor and circuit protection?

Is there a good way to protect both the digital circuitry and the motor itself when the motor is run intermittently? Like where the motor runs for a few minutes a couple times a day. Obviously I'd like to squeeze as much longevity out of the motors as possible.

Right now I'm going to use a cheap ebay peristaltic pump with a brushed 12v DC motor.

My thoughts right now involve a PWM pin of the arduino connected to an optoisolator, which is connected to a mosfet which turns the motor on and off. I think the optoisolator will provide all but absolute protection to the arduino, but that leaves the question of how do I protect the motor from itself? Currently, I'm thinking about soft starting and soft offing the motor by ramping the pwm up over the course of say... a second or two. Should I add anything else to the circuit?

Also, if there is no real good way to protect such motors in such conditions, would it be wise to change over to a stepper motor? And if so, what sort of precautionary measures should I take with these?

I am thinking in other directions.

The optoisolator is very good.
An other point of interest is the power supply for the Arduino. If that is 12V, the voltage regulator might get hot. And heat on the board might reduce the life time.

I hope you have a fly-back diode to protect the mosfet ?
A snubber circuit will further reduce voltages peaks. It can be a capacitor over the motor, but I prefer a capacitor and a resistor.

Starting the motor without a ramp or with a ramp does not make a difference in my opinion. The mechanical wear on the motor itself will not be a lot different. A pwm signal introduces higher frequency vibrations in the coil. But it is impossible to say if that would be bad.

You have to buy a good quality motor.
Suppose you have a very cheap motor, that runs at 12V beyond the border of its specifications. I think most 12V toy motors are like that.

A stepper motor needs a driver. Perhaps the extra electronics of the driver will break down sooner than a normal DC motor.

What about the gear, the rollers and the tube ?
In my opinion the motor is not the problem. The gear might get dirty and the tube will break some day.

If you want go over the top, have a look at brushless motors. They will even continue to work under water. But they need a driver, and again, extra the electronics of the driver might reduce the life time of the project.

I have very cheap 12V pumps, to be used for blood pressure meters. They are designed to be on for only a short time. I suppose the copper commutators are weak. But they run for hours a day for a few years now. I guess I'm in luck.

Alright. So the soft start/stop isn't going to do much then? I figure I might as well do it anyway, because its like 2-3 lines of code and it can't hurt anything I guess.

Flyback diode on mosftet sounds good.

I guess the longevity I'm looking for probably isn't going to outlast the circuits, but rather that the motor is 'rated' for 3-5 months of intermittent use and 9 months of constant. I'd really rather not have to replace a motor every 3 months. If I can squeeze a year or two out of it I'd be happy. To that end, a cheap ebay motor probably wasn't the best choice, but it was cheap and I'm not 100% sure the form the end project will eventually take on yet.

So with the precautions I'm taking could I squeeze a year or two out of it?

You post raises many questions :roll_eyes:

The flyback diode is to protect the mosfet, but is parallel to the motor.
Card 5:

If a cheap motor from Ebay is rated 3-5 month, it might last just one or two.
So I can't tell how to make it last for a year.
I don't understand how it is lasting so much shorter with intermittent use.
Are those numbers for the complete pump or just the motor ? I think it is the complete pump, inclusive the gear, the rollers and the tube.

Perhaps you can measure the start current, or see if the PWM generates too much vibrations (just listen to the motor and let it run with 50% pwm).

In the end, you get what you paid for $)