MOSFET versus Relay with Arduino UNO

Thread Starter

Andreas

Joined Jan 26, 2009
90
Hello AAC,

I have built a project that uses an Arduino UNO Rev 3 with one of those funky 5V controllable relays. See photo.

I use the relay to deactivate (de-energize) two 24VDC (10W) electromagnets operating in parallel (giving a combined power of 20 Watts), and this all works fine, but as with any relay, it has a physical delay which I have measured with a DSO of between 1ms to 10ms. But I need to get this within sub-millisecond accuracy and am considering replacing the relay with a MOSFET output stage. Would this be the best way? and if so, can anyone point me in the right direction, as it's been a while since I have done any analogue electronics.

Thank you,
Andreas
 

Attachments

dl324

Joined Mar 30, 2015
14,689
Post a schematic showing how the electromagnets are being switched.

can anyone point me in the right direction, as it's been a while since I have done any analogue electronics
Lucky for you, you're not dealing with analog. The MOSFET will either be on or off.
 

ErnieM

Joined Apr 24, 2011
8,315
Yeah that sounds like the approach you need.

Make the Arduino and electromagnet grounds common (but pointing in opposite directions so EM current doesn't pass into the Arduino ground).

Then a simple logic level power MOSFT can switch the electromagnets to ground and get your desired timing.
 

michael8

Joined Jan 11, 2015
295
24 VDC @ 10 W * 2 electromagnets so thats 10/24 -> 0.416 amperes
of current per magnet, total 0.833 A

When you "attempt" to turn this off the inductance of the magnets will
try to continue the flow (and decreasing current as the stored
energy in the electromagnets runs down).

How high will the voltage from the magnets have to rise to enable the
.8 amperes of current to continue to flow?

Will this high voltage spike hurt anything?

I'm surprised you didn't report relay arcing..
 

Thread Starter

Andreas

Joined Jan 26, 2009
90
Yeah that sounds like the approach you need.

Make the Arduino and electromagnet grounds common (but pointing in opposite directions so EM current doesn't pass into the Arduino ground).
The Arduino uses a separate PSU to the Electromagnets, so they are totally independent of one another. See schematic. So I am not quite sure I understand what it is that you mean.

Then a simple logic level power MOSFT can switch the electromagnets to ground and get your desired timing.
Thank you
 

Attachments

Thread Starter

Andreas

Joined Jan 26, 2009
90
24 VDC @ 10 W * 2 electromagnets so thats 10/24 -> 0.416 amperes
of current per magnet, total 0.833 A
That sounds correct, but The Arduino uses a separate PSU to the Electromagnets, so they are totally independent of one another. The EM PSU can deliver 24VDC at 3A. I have attached a schematic.

When you "attempt" to turn this off the inductance of the magnets will
try to continue the flow (and decreasing current as the stored
energy in the electromagnets runs down).
That is true but in my application, which is not relevant here, is not a concern for me.

How high will the voltage from the magnets have to rise to enable the
.8 amperes of current to continue to flow?
As above

Will this high voltage spike hurt anything?
The relay has a diode for back EMF protection

I'm surprised you didn't report relay arcing..
Nope
 

Attachments

Thread Starter

Andreas

Joined Jan 26, 2009
90
Post a schematic showing how the electromagnets are being switched.
Done.

Lucky for you, you're not dealing with analog. The MOSFET will either be on or off.
I prefer analog over analogue, but I prefer colour over color. The joys of the English language, be it British or American!
 

Attachments

dl324

Joined Mar 30, 2015
14,689
I prefer analog over analogue, but I prefer colour over color. The joys of the English language, be it British or American!
As long as you understand that we're not going to change the way we spell words to suit personal/regional preferences...

1657031078046.png

Since you're driving the load high side, you need to use a P channel MOSFET to switch them. Assuming the control input on the relay module is positive logic, you'll need an inverter to interface your 5V control to 24V for the MOSFET.
1657031465298.png
I'd add a snubber diode across the coils if you don't use an avalanche rated device. Anode to ground and cathode to the drain of Q2.
 
Last edited:
Top