Hacker News new | past | comments | ask | show | jobs | submit login

I haven't done much electronic stuff in a good seven years, but this is typically what you would use a relay for, right?



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.


You'd still want a flyback diode, as the voltage spike will arc across the contacts of a relay as well, shortening their life.


Yep was going to say exactly this. Anything involving collapsing magnetic fields, eg solenoids, relays, motors, absolutely simply has to have a flyback diode.


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


> 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

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!).


Yeah the Tektronix HV probes used to come with an aerosol can and you had to fill them up.

Technically frequency compensation is required across all voltage dividers for scopes so not to accidentally create a low pass filter with the parasitic capacitance in the cables and input circuits. It's all quite fun.

Disclaimer: was an obsessive compulsive scope collector for a while.


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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: