How to protect the circuit if i use selenoid lock

I have this 5V solenoid cabinet locker: Link to the product on AliExpress

I am using an Arduino and an N-channel MOSFET to activate it. However, when I test for continuity between the 5V wire and GND wire of the lock, I observe continuity. How can I protect this from affecting the MOSFET or Arduino? Do I need to add any diodes or take any specific measures?

You should have a diode across the solenoid.
You should have a 220 ohm resistor between the arduino pin and the MOSFET gate and a 10K resistor from the arduino pin to ground.

2 Likes

so baiscally if i connect just to 5v adapter i need to do like image on the left right?

coz i did like that and my monitoring device shows that there is short circuit

The one on the left is correct.
Don't forget the resistors for the MOSFET

Which arduino are you using?
How are you connecing the 5V to the Arduino?

You can eliminate the diode with the appropriate avalanche rated MOSFET. Putting the diode in the circuit will not hurt but it will not conduct as its Vf is higher then the MOSFETs avalanche voltage. Nice part it is easier to wire.

You could, but that increases solenoid kickback voltage from 5.7volt to maybe 70volt, which could increase chances of the MCU locking up. I would only rely on that when solenoid release speed matters.
Leo..

The way this was explained to me was:

  1. An inductor opposes the change in current flowing through it.
  2. When current flows through an inductor, a magnetic field forms around
    the coil of wire.
  3. The strength of the magnetic field varies depending on the value of
    the current flowing.
  4. If the D. C. current flowing through an inductor is abruptly switched
    off, the magnetic field collapses.
  5. The falling field lines of force cut through the coil attempting to
    keep the same value of current flowing in the same direction.
  6. The inductor now becomes a current source.
  7. The inductor terminal voltage reverses when this happens.
  8. The inductor terminal voltage now depends on the load resistance seen
    by the current source, by Ohm's Law.
  9. So, if the driving current supply, coil and switch have a resistance
    of 5 Ohms, and the load resistance increases to 5000 Ohms (the open
    circuit and coil) then the inductor terminal voltage must increase
    1000 times in order to keep the same current flowing.
    Our task is to keep this high voltage from causing damage to the circuit.

When the magnetic field collapses the the polarity is reversed and the voltage will rise until something adsorbed it. The fly back diode has about a 0.7V forward voltage drop. This will clamp the voltage to approximately that voltage. The substrate diode in the MOSFET will drop about 0.1V depending on the energy available, it acts as a resistor. This is documented in the avalanche rated MOSFET data sheet. Simplify the circuit and the 0.1 volt will conduct before the 0.7 volt and dissipate the energy.

Not sure what you're saying.
With a diode, solenoid voltages are 5volt and 5.7volt.
Without that diode, the voltage on the drain of the fet rises to it's VDD breakdown voltage.
The fet now acts as a (~70volt) zener diode.
I don't see what the body diode has to do with it.
Leo..

Is there a short circuit, or just a very low resistance? It's not unexpected for a solenoid coil to have < 5 ohms resistance, which can trigger a continuity reading. Use your meter on the resistance setting instead of the continuity setting to verify.

Which two wires are you measuring continuity on? Should be RED and BLACK, not YELLOW.

Red black

1.9 ohm resistance between black and red wire

That's your solenoid coil for sure.
It does pretty much match the 5V/2A specification (1.9Ω at 5V comes to just over 2.5A - which is pretty much the same by Chinese standards). Make sure your power supply and transistor can handle this current.

i tried with 5v 1A but it doessnt work.

i have a ebike battery 30-40v and i have 5v and 12v selenoid locks. what is the best way open the 12v or 5v selenoid lock that u can suggest to me?

since selenoid will be active about 1-3 seconds . is there any cheap dc dc convertor or is there anything else to use so maybe i can use a relay from arduino or

if i put directly 40v to 12vselenoid will it burn?

12v is 6.5 Ohm
5v is 1.9 Ohm

Re think your logic, when the coil is switched off the polarity of the coil wire reverses which causes the substrate "diode "to conduct because the drain is now negative.

Not good.

Add a resistor in series, "16 ohms" (a big one, 2W or more)

@gilshultz
I think you have a fundamental misunderstanding of the subject.
Don't worry, most do.

When the coil is switched off the polarity of the coil wire reverses.
True.

which causes the substrate "diode "to conduct because the drain is now negative.
Not correct.

Coil negative is now connected to the supply, so coil positive must be higher than the supply.
Coil positive (drain) rises to the point that the fet starts to break down.
Leo..

It conducts through the power source. The + terminal is connected to the source with the power supply in-between.

Yes, without diode both active and kickback current returns to the power source.
But current flows in the same direction through the fet when active and during kickback.
Never through the body diode.
Active mode draws current from the power source, and so does kickback.

We should stop hijacking OP's thread. If you want to know more, then start a new thread.
Leo..