Lurker News

Comments (181) 53 threads

Show all comments

Showing thread 12 of 53

lloydjatkinson2 replies#
Hmm. A MOSFET for a motor switch might be overkill. Also, there's no flyback diode. So your Pi pretty much will let its blue smoke out when you get a flyback voltage, or at least the MOSFET.
mtlynch4 replies#
That sounds... undesirable. Electronics is definitely not my area of expertise, so I'm very open to feedback. What do you recommend?
motardo#
When MOSFETs get hot, that usually means the gate voltage is too low. It looks like your driving the MOSFET gate through a resistor voltage divider. It would be better to drive the gate straight from the PI's GPIO pin. Also a flyback protection diode would be a very good idea.
Jaruzel1 reply#
Wouldn't a relay be easier to integrate? and also keep the pump power circuit isolated from the pi power circuit?
lloydjatkinson1 reply#
Anything involving collapsing magnetic fields, eg solenoids, relays, motors, absolutely simply has to have a flyback diode.

So your suggestion is actually introducing a second magnetic field, so now you've doubled the chances of blowing up your Pi and or the MOSFET.
Whether you're using a transistor/MOSFET directly with a motor or instead with relay + motor you need the flyback diode.

Continue this thread — 1 reply

lloydjatkinson#
Read up on flyback diodes. There are additionally numerous motor driver IC's specifically for this purpose.

A flyback is critical in anything involving a magnetic field, especially a collapsing magnetic field from a motor that stops spinning. The field collapse induces a relatively huge current which will be many many many times greater than anything a normal component is designed for.
Not having one is like driving your car down the highway without any breaks. The only way to stop is to crash.

nerdponx2 replies#
I haven't done much electronic stuff in a good seven years, but this is typically what you would use a relay for, right?
dhartsfield2 replies#
You'd still want a flyback diode, as the voltage spike will arc across the contacts of a relay as well, shortening their life.
lloydjatkinson1 reply#
Yep was going to say exactly this. Anything involving collapsing magnetic fields, eg solenoids, relays, motors, absolutely simply has to have a flyback diode.
setq2 replies#
Incidentally you can demonstrate this by wiring up the relay so it oscillates i.e. use the NC contacts in series with the coil. Then stick your fingers across the coil. It'll give you a nice shock. Not enough to hurt you but enough to go "hmm, I'm not going to do that again" like licking a 9v battery.

Attempts to measure these spikes on a cheap scope years ago ended up blowing the scope input FET up. Whoops. Good job it was a university owned scope :D

Continue this thread — 2 replies

cr0sh#
Something that also exists (but are mainly used on pure or nearly pure electrical systems - think old-school, pre-microcontroller/cpu ladder logic relays and controllers) are "quencher resistors"; these were resistors placed across the coil to absorb the voltage spike. You sometimes see them on automobiles, mainly older vehicles.
kefka#
Long and short, motors store power in magnetics when electricity is flowing. When its not, the coil loses its magnetization and turns back into electricity.

Now think of all the electricity as one big wave. Cause that's what it is. If you were running 12v , you can see upwards of 30v surge. This is bad.
The key is to equalize the power on the motor. And that's done by putting a diode in the reverse flow across the terminals. So that big flow of electrons can equalize itself BEFORE hitting other silicon (like the MOSFET or your RasPi).
Ideally, you want to do this for motors, electromagnets, solenoids, and inductors(well, unless you're doing an L-based filter , but aside the point). They all have this magnetic energy->electricity->surge thing going for them.