The solenoid requires a certain amount of current to generate its magnetic field. If the solenoid was a perfect inductor, the DC current would rise above all means and would most likely damage other circuit components. However, solenoids inherently have a significant amount of DC resistance used to limit the current magnitude.
Provided you place a bypass capacitor (to absorb high-frequency current pulses induced by changing the current magnitude) between GND (close to the mosfet source) and the 12 V connection solenoid, you do not have to worry about a significant overshoot. Your selected mosfet has breakdown voltage of 100 V, which is certainly an overkill.
The mosfet also has a non-zero on-state resistance Rdson (160 mOhm), which will slightly reduce the current through the solenoid. Another implication of Rds is mosfet power dissipation - which is negligible in this case (160 mOhms provided the channel is fully open).
1) Since this is semi-static application (no switching at tens of kHz), you only need to look at these parameters:
- gate voltage threshold (should be lower than you gate supply voltage)
- on-state resistance Rds (to calculate voltage drop and losses)
- allowed current (which is very much correlated to Rds)
2) One problem I see with your circuit is that the gate voltage will be 3.3 V but the MOSFETs gate voltage is specified between 2 and 4 V. In practice, it's fine because even if you get a "bad" part, the MOSFET will still partially close and allow current current to flow through its channel. An implication of low gate voltage is that the switch will work in the linear mode, where its on-state resistance is much higher than the guaranteed value.
EDIT The gate threshold voltage is the minimum voltage where the MOSFET starts conducting current; however, the channel current would most likely not be enough to turn on the solenoid. Look at Figure 1 in datasheet, which correlates gate voltage with drain current and drain-source voltage.
You could easily use this part :: FDN327N. The gate voltage is specified at 1.8 V and allowed average drain current is 2 amperes.
The value of R1 depends on:
- allowed source peak current - some PWM gate drivers can well support 30 A peak, which (with 10 Ohm gate resistor - R1) very quickly charges the gate and thus minimizes time spent in the linear mode.
- desired dv/dt, which significantly affect radiated and conducted emissions
- gate threshold voltage
I assume you drive the gate from an MCU pin - look at the datasheet on allowed pin current. That current is, however, the average current so you can drive much more on a peak basis. I would guess that 50 mA is fine -> 3.3V / 50 mA ~= 70 Ohms would be a good value for this application.
Basically it's your simulator - it can't ever be higher than the 5V supply and 4.2 is pretty normal. Check that your initial conditions don't include some form of charge on the capacitor. Simulators can throw curved-balls sometimes and you did the right thing by asking.
By the way I think @pjc50 may have misread your voltage as being 9V not 5V - or maybe it's me - the picture isn't all that clear.
Best Answer
YES. Arc temperatures exceed 5000'K when the switch opens for a few microseconds, and slowly erodes contact silver content and rises in resistance. Better contacts have a palladium-silver alloy which is more robust at higher temps. Cheap contacts have neither silver nor palladium.
This is why DC relay contacts with inductive loads are de-rated to ~25% of rated resistive loads.
Plan B
Upon reflection, I think a resistor snubber will work best. The diode method reduces EMI too much and slows down the flipper action to T=L/Rs
So measure solenoid series resistance (DCR) with a DMM and choose a resistor across the inductor about 50x this value. That will only increase current a bit but sped up solenoid response and reduce arc voltage to V=IR for solenoid current and snubber R value.
It depends on your DC solenoid.
If coil draws 0.1A at 5V, it is 5/0.1=50 Ohms ,
then use a 50x 50=2500 Ohms/=50% tolerance 1/2 W
plan A
The diode current or power rating must be similar to the coil so it conducts when the switch opens bypassing or shunting the arc voltage to 1 diode drop to the opposite rail. It is normally from the switch in reverse polarity to the opposite supply rail ( + or Return)
Shown below as High and Low side switch. FYI only.
Otherwise, without a diode, high EMI impulse noise is created where the contacts arc. You can hear this between channels on any AM/SW radio. ( as long as the flipper isn't too loud) hah.
Solution 1N400x x= number dont care about reverse voltage rating number) directly across switch in reverse polarity.
simulate this circuit – Schematic created using CircuitLab
The Power supply current does not spike since the diode acts as a bypass switch to the same DC current when the flipper is activated, so the current simply declines smoothly. But without a diode the supply must absorb any transient arc voltage drop ( which it usually does) and this also creates more radiated EMI. So use any 1A diode.
Plan B on left