5 ms·
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 vo
by lloydjatkinson 9y ago
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.
- mtlynch 9y agoThat sounds... undesirable. Electronics is definitely not my area of expertise, so I'm very open to feedback. What do you recommend?
- dbrgn 9y agoThis helped me to understand flyback diodes: https://learn.digilentinc.com/Documents/390 https://learn.digilentinc.com/Documents/390
- motardo 9y agoWhen 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.
- Jaruzel 9y agoWouldn't a relay be easier to integrate? and also keep the pump power circuit isolated from the pi power circuit?
- lloydjatkinson 9y agoAnything 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.
- cr0sh 9y ago> 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. No. You haven't fixed the original problem, but your motor is now isolated from the rest of the circuit. You've just now have a relay with an inductive element instead of a motor. Ultimately, you haven't solved anything (unless you are using an AC motor, and you don't have a triac or something else solid state to control the motor). You still need the flyback diode. But you haven't doubled your problem by introducing a relay, merely moved the issue to another part. Now - in regards to the mosfet - many mosfets (not all!) have a built in protection diode between the source and drain. Check your datasheet for details (including what kind of back-feed voltage/current can be handled by them - some may need an added diode with better ratings in detail). EDIT: Also - some relays have built-in protection diodes (or can be ordered as such) as well (again, check the datasheet). You see this more on relays for automotive applications (ie - standard BOSCH style relays) than ordinary bare PCB relays.
- lloydjatkinson 9y agoRead 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.
- nerdponx 9y agoI haven't done much electronic stuff in a good seven years, but this is typically what you would use a relay for, right?
- dhartsfield 9y agoYou'd still want a flyback diode, as the voltage spike will arc across the contacts of a relay as well, shortening their life.
- lloydjatkinson 9y agoYep was going to say exactly this. Anything involving collapsing magnetic fields, eg solenoids, relays, motors, absolutely simply has to have a flyback diode.
- setq 9y agoIncidentally 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
- cr0sh 9y ago> Attempts to measure these spikes on a cheap scope years ago ended up blowing the scope input FET up. Yeah - they make special high-voltage probes for this kind of thing (some can go up to 10 Kv and beyond - just depends on how much money you want to spend). I believe that the main difference between a standard probe and an HV probe is one of resistance; I think the HV probe puts a large value (mega-ohm) resistor into the mix (not sure if it's in series, or between the probe input and ground - see my further note below). If you have a scope, it's handy to have one around "just in case" if you can afford it. I got lucky myself; I found one for a few dollars at a local Goodwill thrift store (the strange stuff you can find there...) Note: Hmm - I decided to look a bit more into this - I guess things on HV probes can get complicated quickly! https://www.repairfaq.org/sam/hvprobe.htm https://www.repairfaq.org/sam/hvprobe.htm So - a basic probe is just a voltage divider with large value resistors (like I alluded to earlier); but as the frequency increases, lots of other weird and fun stuff come into play (and in the comments section of that article, someone mentions special chemicals that had to be added to certain special probes he used in the past!).