• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Solenoid control with mosfet

Status
Not open for further replies.

drkidd22

Member
Hello,

I have the below circuit to control a solenoid with a micro-controller.
The solenoid will be drawing about 1.2A and I will also be measuring the current drawn.

My question is with the gate driver for Q2, I think I will need a zener or a divider with maybe 2 1K resistors so I don't blow the gates of Q2 and Q3.
Also on D2, D3, D6, not sure if D6 and D3 and really necessary here. Maybe it would be fine with just D2 as flyback. What's the purpose of D3?

Capture.jpg
 

ronsimpson

Well-Known Member
Most Helpful Member
Very complex circuit for a simple job.
How accurate do you have to measure the relay current? If you only want to know if the relay is burned out then this could be simple. Do you need 5% or do you only need to know if there is/is not current? (test for broken relay)

Why Q1/Q2.

What other voltages do you have? +24V and ??
 

drkidd22

Member
It was actually more complex than this, I've simplified it a lot.
It's actually to just tell if there is or isn't current which I could've done with a comparator and set a reference, but I want to record actual current within 10%.
Also to clarify a little, It is a valve with a plunger, pulsed at 2Hz.

The pic voltage is at 3.3V.
 

ronsimpson

Well-Known Member
Most Helpful Member
record actual current within 10%.
The MOSFET Q2 has resistance. (not real accurate) Some times I just measure the D-S voltage when the MOSFET is on.

Q2 should not have more than 20V on the gate. Many "drivers" are not built for more than 20V.
Give me a minute and I will sent a schematic.
 

ronsimpson

Well-Known Member
Most Helpful Member
Assumptions: D3 is there so the "valve" operates faster. I put a 0.1uF cap across D3 because Zeners can be slow.
Question: What is D3 voltage? Probably 24V?
Your 3.3V Zener is in the wrong place.
Question: Can the Diff-amp operate from 3.3V? (maybe not)
Added a zener to the MOSFET driver supply. Need to bring down the supply voltage. (almost any voltage will work. depends on MOSFET. 10 to 20 volts is good)
MOSFET (when first turned off) will see a voltage of 24V + D3 + 0.7V. So check the voltage rating on MOSFET.
Question: Why are driving the "coil" with PWM-24khz? Are you turning on/off at 2hz or are you really turning the MOSFET on/off at 24hz. I can see turning on the coil for 100% for 200mS then drop back to 50% for the rest of the time to save power.



upload_2017-10-4_9-20-32.png
 

drkidd22

Member
Thanks, this is close to what I was thinking of doing, but instead of a zener on U2 I had a divider at the output to drive the gate.
D3 is 33V and MOSFET is rated for 100V.
Yes the Diff can operate from 2.7V - 26V.
Your assumption is correct, turn on is 100% for 20ms and hold at 50% for different timings, which are programmable.

I think I will build this and see how it operates.
Any advantages/dissonances of using a zener on supply of U2 vs the divider on the output?Untitled.jpg
 

ronsimpson

Well-Known Member
Most Helpful Member
If U5 is operating on 3.3V then D6 can be removed.

I need to think about your PWM coil circuit.
1) if no PWM. Only on or off. (D3 removed, only D2) Then you put 24V on the coil for turn on. But for turn off there is only 0.7 volts across the coil and it will respond slowly. (it takes time for the 1 amp to reset back to zero with only 0.7 volts)
2) With D3 in circuit; 50% of the time your 0.5A will be passing through the Zener (half the time). I think it will be hot! This is interesting. You need the Zener when you go to 0%. (off) But I think the Zener is wrong when you are at 50%. (not saving much power)
3) If you are at 50% and the current is at 1/2 then the current reset time is 1/2 so maybe that time is OK.

Do you have a data sheet on the coil/valve? Some time they say what the reset time is at 24V and 0.7V.
 

drkidd22

Member
I do not have a datasheet, but I do have some waveforms from some testing I did a while ago.
Ch1 is current though coil and Ch2 is the voltage. You can see the spike at closing time, goes up to about 60V.
Is the reset ~400us, that what you looking for on the closing time?

solenoidTimes.jpg o with a similar circuit to the original I posted.
 

ronsimpson

Well-Known Member
Most Helpful Member
Putting 24khz sharp edges on the coil will cause RF radiation noise.
This is what I am thinking. After looking at your wave forms, this should work.
Put a non polar 1uF cap on the connector so high frequency noise does not exit.
The MOSFET will be switching between 0 and 24V.
2mH inductor and cap will filter to a voltage at about 12V with ripple.
(if 100% then coil will have 24V)
(if 50% then 12V)
(if 0% then Zener will eat up the stored energy then the voltage will drop back to 0V)
upload_2017-10-4_12-1-27.png
 

drkidd22

Member
OK so I had already built a PCB with the circuit shown as in the original post and seems to be working on so far.
But my signal is pretty noisy when I connect the solenoid. Ch1 is the PWM output from the micro and Ch1 is at solenoid return.
Not sure why this is so noisy, I added a 100uF cap to the 24V line and that didn't help, seems as if the solenoid return is affecting the entire ground system.
If I remove the solenoid the PWM signals look clean.

2.png
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top