Switching on a solenoid

Hi Pix, Gerard
Looking at the graph that one is pretty much full on at 5V gate voltage so should do nicely if Gerards level converter will do as we hope.
Cheers Bob

easy to do.

1 Like

Hi Gerard

Not terribly hard to do but could be a bit messy at the hobby level.
The system has to be high side switching with say a 12V supply for the high current and a separate 6V supply for the low current (this is just an example) connected via a diode to prevent the 12V backfiring into the lower V supply.
At switch on both supplies are switched to the solenoid. After a time to allow the solenoid to operate switch off the 12V supply. The lower V supply keeps the solenoid actuated at a lower current.
Cheers Bob

1 Like

Hello all,
A lot of reading, but could not see what is the function of the said solenoid ?
Regards

1 Like

Hi Bryan

From my end it does not matter. Looking at the board design pic the end result could be complicated.
Cheers Bob

1 Like

There has been a lot of back and forth on the solenoid drive process, for my self I would need to know the acceptable solenoid capacity, is it operating a hydraulic valve, the power requirements are substantial. I would suggest in this example the operating voltage be much higher to keep he required current down. We use HV power transmission for long distances to minimize the losses and so forth, a low current reduced copper losses, etc. It is best to sort what we are trying to control and the rest is fairly easy.
Regards

1 Like

The solenoid enables water flow. The DC resistance is about 23 ohms.

I didn’t want to get too distracted with the ‘pull then hold’ theory, I was just mentioning for the sake of it.

Anyway, I have made up the test jig…

Back left is the resistor than can be easily swapped. The yellow wire allows me to source either 5v or 12v to that resistor. Up front is a 7805. Ignore the 3 x 1N4007.

Out of sight is the solenoid and the red/yellow wires heading off board go to it.

(The PCB holder is one I 3D printed.)

I’ll do readings in a minute and report back.

1 Like

Hi Gerard

Yes your duty cycle would not warrant it I don’t think. Would be used where there is probably quite a few solenoids with a high duty cycle. It is to reduce solenoid power dissipation thus heat.
Cheers Bob
That set up looks pretty tidy
I assume the TO220 device at the rear is the Mosfet or Darlington Transistor. Which one??

1 Like

TIP122, Bob.

OK Thanks
Cheers Bob

Source R Vb Vc Ic
5v 500 1.435 0.744 0.41A
5v 1k0 1.44 0.754 0.41
5v 2k0 1.398 0.76 0.41
5v 3k0 1.38 0.768 0.41
12v 500 1.468 0.736 0.42
12v 1k0 1.455 0.748 0.41
12v 2k0 1.432 0.751 0.4
12v 3k0 1.416 0.752 0.4

R = base resistor

I work out the base current to be…

Source R Vb Vc Ic Ib (mA)
5v 500 1.435 0.744 0.41A 7.1
5v 1k0 1.44 0.754 0.41 3.56
5v 2k0 1.398 0.76 0.41 1.8
5v 3k0 1.38 0.768 0.41 1.2
12v 500 1.468 0.736 0.42 21
12v 1k0 1.455 0.748 0.41 10.5
12v 2k0 1.432 0.751 0.4 5.3
12v 3k0 1.416 0.752 0.4 3.5
1 Like

Hi Gerard
That is good. Ib Calc is spot on.
Pretty much says that the Darlington Transistor is turned on under all of the above conditions. Could be starting to slip down the curve at Ib of 1.8 and 1.2mA but I would not say for certain.
I think we could safely say that this TIP122 would safely switch at or above Ib of 2mA.
I am expecting my level converter tomorrow or Thursday and as soon as I get it I will check if the current capability is anything like the quoted (in one place anyway) the 50mA. Hoping this will be so in which case you can drive the TIP122 (or a suitable Mosfet) directly with it.

If the converter does live up to expectations I would suggest a 1k base resistor or gate resistor if using a Mosfet. This will enable an Ib of 3.6mA or a Gate charging current of 5mA. Note if you use a Mosfet you will need a 10k resistor from gate to source to discharge the Gate cap during the OFF period.
Cheers Bob

I did some more current checking.

The above Ic numbers are read from the bench power supply. I checked the current flow using my DVM.

At +12v through the 1k0 R, the reading from the PS is 0.41A but my DVM records is at 0.50A which, I think is more accurate. When I put the solenoid directly across the PS, it draws 0.54A.

From those current readings, we can work out R (the solenoid). They should be the same (obviously).
Across the PS… 12.1v, 0.54A =22.4 ohms.
In circuit (12.1-0.748)v, 0.50A= 22.7 ohms … (reference the above row at +12v, 1k0 R)

To me, that would indicate that the TIP122 is fully on…or am I missing something?

Edit: the DVM reading of the solenoid under test is 23.6 ohms.

I think the hfe of the TIP122 is 1000? If so, then that current range should be fit for purpose.

Hi Gerard

I think you are right. If your solenoid is 23Ω the 0.5A figure is the more accurate.
Putting a lot of these discrepancies down to practical measurement errors and differences between instruments there is little difference across all measurements. They are close enough to say the TIP122 is fully ON. I was just being cautious when I suggested a base current of 2mA and upward to be sure.

Yes. Now all that has to be done is make sure the converter is up to it. As soon as I get it I will let you know. Fingers crossed.
Cheers Bob
PS:

The difference between 0.5A and 0.54A could be explained because with a direct connection you don’t have the TIP122 resistance in circuit. When it is in the 12V power supply sees this resistance in addition to the solenoid. Although this is small so is the solenoid resistance so forms a fair percentage of the total and becomes more significant as a result. Slightly higher resistance, slightly lower current.

Yes, hopefully the level shifter is up for the task.

I worked out the theoretical resistance in circuit and out of circuit to be 22.7 ohm and 22.4 ohm respectively so I’m sure the TIP122 is good for the task.

What I will do is turn it all on and soak test it for an hour or so (and keep the local fire brigade on speed dial :grin:.)

Hi Gerard
The logic level converter board (SKU BOB-19626) arrived this morning and I was able to carry out the following test
The test set up.


I connected a 5k1 resistor from output to Gnd. designated RL (Load).
RS (Source) resistance is within the converter.
Measured 2.65V across RL = 0.52mA
Now the same 0.52mA flows through the source resistance which works out at 4k5Ω. The data sheet indicates 4kΩ which we will have to accept is the pull up resistor value and this device WILL NOT I don’t think provide enough current to be of any use. Theoretically if connected directly without a base resistor the base current should be 0.9mA. This might work but I would not guarantee it to be reliable.

The block diagrams in the converter data sheet show this 4k pull up resistor and it has a Mosfet across it driven by a “one shot” pulse. This bypasses the 4k for a very short time to charge any load capacitance (like a Mosfet gate) and improve switching time. I believe it is this current referred to in the maximum ratings as 50mA short circuit current. After the Mosfet switches off the 4k is in the supply circuit and becomes the source resistance. The source then becomes the “several hundred µA” stipulated in the text.

Well we tried. I am sure there is an opto solution that can be driven directly from the MCU. Maybe the TIP 122 can be driven directly but I don’t know the current capability of your MCU.
With the 3.3V source voltage (MCU output) and a 560R base resistor you should get a base current of about 3.4mA which should work.

I know you want to keep the MCU isolated but I think the only way here is to insert an OP Amp as a voltage follower (very high input impedance) to boost the current capability or look at Opto isolator options.
Will have a look
Cheers Bob

Bugger.

From what I can gather, each GPIO pin on the ESP32 can deliver a maximum of 40mA when sourcing current (i.e., providing power to an external component).

I have the datasheet (more of a book) and will look further into it.

Hi Gerard
I note you had a deleted topic re a 2N2700. If you have one of these you could try this little circuit which should work (it is untried) if you still want isolation.


Note the TIP122 base current control resistor is in the drain code of the Mosfet. That is to make sure the Gate / Source voltage remains great enough to keep the Mosfet ON.

I would consider driving the TIP122 direct from the MCU with the aforementioned 560R Base resistor. Even if the TIP122 went short circuit base to ground the 560R would limit the current to about 6mA. The biggest danger is of the TIP122 went short circuit collector to base. Then the 12V collector voltage would appear at the base. You could overcome this possibility with a diode in series with the base resistor but the voltage drop across this diode would have to be considered and the 560R reduced accordingly.
Cheers Bob
PS. I just had a thought. I don’t know if with this arrangement the 2N2700 would turn on. As I said the circuit is untried, you will haf=ve to try it and see.