Switching on a solenoid

Hi Gerard

That would be good. and would help if you state the TIP122 Base voltage, Collector voltage and collector current for each resistor value. Also the starting base voltage (5 or 12). All this to make sure the TIP122 is fully on or otherwise it will get hot. Thanks.

Good idea.

That would work. I believe the output current of this device would be closer to 50mA than 1.3mA but we can only try it. If it is already there and set up to go no harm done either way. If the TIP122 will work happily at a base current of somewhere 5mA as i believe it should then this converter should (I hope) do the job nicely.
Cheers Bob

OK, I’ll redo the measurements and apologies for lack of same.

I have to head away for a day so I won’t be doing this until Sunday.

Thanks for all the assistance.

Gerard

Hi Gerard
I don’t quite know how to interpret the data sheet but I found the following

“Because the high bandwidth of these bidirectional I/O circuits is used to facilitate this fast change from an input to an output and an output to an input, they have a modest DC-current sourcing capability of hundreds of micro-amperes, as determined by the internal pull-up resistors.”

Which makes me think that these devices DO have a very limited current capability and may not drive anything requiring a few mA.

One can only try but.
Cheers Bob

Dropping in on this conversation a bit late. A FET is best suited for switching relays. If it is being switched at a low rate (say once a second or longer) then the gate capacitance issue is not so important. What happens is while the gate capacitance is being charged or discharged the FET appears as a variable resistance in series with the relay and will have to dissipate some heat. But this will be for typically less than a millisecond. You can look up the gate capacitance, the supply current and work out the time. E.g a 5V supply to a 1000pF gate through a 10K resistor has an RC constant of 10us (10 microseconds) and full switching is a few RC constants, say 50 microseconds. The gate current draw is a maximum of 500uA. So what is needed is a FET with the desired ON voltage (I haven’t looked if there are devices with low resistance at 3.3V gate, maybe. Certainly many are OK with 5V). And handle the current (plenty handle 20A in a TO220 package, just what you can get your hands on). Hope this doesn’t derail the conversation.

1 Like

Hi Alan

Agreed. But irrespective of what the time constant is the charge current has to be provided from somewhere. By the way, 5V or 50V does not alter the time constant.

If Gerard was working with 5V most of his problems would go away. I knew there was a reason I avoid 3.3V like the plague. All very well commercially in a power saving scenario but for some hobbyist applications can be a bit messy. As you say there are plenty of “logic level” Mosfets out there quite happy with 5V but I think pretty borderline at 3.3V.

Yes you have Logic Level converters but most are unlikely to source any worthwhile current so need to work into high impedance loads. Gerard is using one but I am a bit confused. One part of the data sheet says it can source up to 50mA while other parts suggest only µA. I am going to order one of these and find out which part of the data sheet is correct.

It is this current to drive a switching device that is most of the problem. Theoretically it is not hard to do by inserting a unity gain OpAmp as a voltage follower to provide this bit of current but it becomes messy sometimes. You can use an NPN/PNP transistor driver but I think the initial driving voltage would need to be more than 3.3V. And there are ICs floating around which are dedicated Mosfet drivers and look after the initial current up to a couple of amps. I might even have one of these somewhere but I would have to find it.

I think the easy solution would be an opto coupled interface to switch high side or low side. I don’t think this matters. I think the MCU has enough grunt to do this. Core have a couple of high side switches which I am going to order to see just at what point they will reliably switch. For me to be certain of reliability at 3.3V they would have to switch at about 2.5 to 2.8V max. But I like certainty and don’t like this “they might work” approach.

A native 5V control voltage would have been much simpler.
Cheers Bob

1 Like

Thanks for your interest, Alan.

Bob,
Vbe readings:
R4…Vbe
1k0…1.414v
2k0…1.38v
3k0…1.37v
3k9…1.36v

From everything I’ve found, the TXS0108 will deliver up to 50mA on the +5v side.

The other problem I have is that this IC is a SOIC package and impossible to prototype easily.

There will definitely be +5v on the solenoid driver side as this will come from the TXS0108. Current is still up in the air.

Duty cycle is measured in minutes. Switch on…wait for several minutes…switch off.

Hi Gerard
I asked for this.

And got one of them.
I asked for all of the voltages in one measuring session as by my reckoning you were using a base “start” voltage of about 10V which does not seem right.
If we can have all of this info from the one session things will be much clearer.

I hope this is so as it will solve pretty much everything. SparkFun have one on a breakout board and available from Core. I am going to order one today just to see what it will do. If it will source 50mA it would be a far more useful converter (albeit limited in voltage) for 3.3V to 5V transitions than the Mosfet type.

This is what I hope to find out.

But I did find the paragraph quoted above in the data sheet on page 18 under the heading

"Feature Description (continued)

9.3.2 Input Driver Requirements"

Now the wording is a bit ambiguous and they may be referring to the current “sourcing” of the device in input mode in the case of 0V input. All confusing but I am going to find out soon.
Cheers Bob

1 Like

Did you note the maximum charge current required in the example is 500 microamp (that’s why I quoted a 10K resistor). Which most devices will source without stressing, even the CMOS ones. The longer the time constant, the less current required over a longer period. But the more heat generated in the FET while switching. In this project with time between switches over a second I’d think any old TO220 FET with a reasonable current handling would handle it comfortably. I had a look at Jaycar offering, they have STP16NF06 which looks OK except Mouser says it is obsolete.

1 Like

Hi Alan

No I did not notice that. In that case a level converter 3.3 to 5V of the “usual” variety being fed by a 10k pull up resistor could possibly be directly connected .

But. You did not specify the FET you were talking about. That is one reason I could have missed it.
But we are still cursed with that 3.3V from the MCU. Would be a lot simpler if it were 5V
Cheers Bob

1 Like

Apologies for the lack of coherent information, Bob.

What I will do is wire it properly with suitable gauge wire and soldered connections so we can test this whole thing reliably. At the moment, there’s too many loose and unreliable connections.

1 Like

Hi Gerard
Good idea at this stage. I have ordered one of those converters so I can try it. I will have another look at the data sheet. It might be me going in circles. Your wiring tidy up might save us all going in the same circle. Should have the converter by wed AM so be patient and we can do something definite. This is doable and I think all going well, simply.
Cheers Bob

I’m glad you mentioned the converter as I thought about it and realised that I do have one in my drawers of bits’n’pieces. So I can test here when you get yours.

I’m also happy to further look into Alan’s FET ideas.

I’ll head to my local Jaycar (local=30km) and get some proper prototyping breadboards that one can solder!

Gerard

Hi Gerard

Fet or darlington. Both have their pros and cons. The Mosfet has the advantage of only a few mV voltage drop when fully on. If we can get 5V to drive it with a mA or few up our sleeve a "logic level’ Mosfet is very viable and probably superior to a darlington for this use. The Darlington only came up because you started out with 2 transistors.

Unlike a Transistor which is current controlled a Mosfet is voltage controlled and the only real current required is to charge the gate capacitor, once the Mosfet has turned fully on the gate current is only a few µA.

Most of the more common high current Moafets require a gate voltage of 8 to 10V or more. The data sheets are usually written around 10V. There are others termed as “logic level” Mosfets which are ON at a gate voltage of 5V. Some people claim these work at 3.3V but in my opinion this is pretty marginal. This probably puts them in the variable resistance region and for high currents this could be a disaster with overheating.

It could be said that your requirements are modest which is pretty true but I don’t subscribe to this perhaps it is OK situation. My attitude with this sort of application is don’t pussy foot around. Turn the thing ON, not half way on. Then you will have no trouble.

As I said the Darlington connection came up because you were using transistors. I agree with Alan that probably a Mosfet is a better choice but I think you need 5V. With any sort of luck your converter will be suitable.

You might live somewhere near me, my nearest Jaycar is some 30km, round trip 60km.
Cheers Bob

I’ve been enjoying following this thread.
By complete co-incidence I’m about to have to make a solenoid go.
I’ve decided to use a mosfet instead of a transistor.
I’m going to try this circuit tomorrow.
I’ll let you know if it works or not :slight_smile:

EDIT : IRLB8721!

1 Like

Hi Gerard
I missed this previously

Be a bit careful here. Some time ago I purchased a couple of these boards. There are 2 popular sizes laid out in the breadboard style. One of them I think the larger one had the holes at 2.5mm pitch instead of 2.54mm. This might be OK fir an 8 pin DIP IC but anything more won’t align the pins with holes. The first thing I wanted to do was fit a row of about 20 pin header. The holes were way out.

I did alert Jaycar regarding this and they may have fixed it. There again they may not.

Just be aware and check.
Cheers Bob

1 Like

Thanks for the alert on that. I lucked in then.

The catalog number of my board is HP9556. I should have it built by tomorrow.

1 Like

Hi Gerard
That one probably OK> A check is see if it aligns with breadboard or header pins. I think the faulty one was HP9572.
Cheers Bob

2 Likes

Hi Pix
That solenoid probably would not work very well. The 1k resistor would only allow 12mA with 12V directly across it without any solenoid. Get rid of it.

Where did you find 1RLB8771 Mosfet. I went to look at a data sheet and only found a picture and a link to some Russian (I think) page which did not say much. Nothing else. Tried Element 14 with no luck.

If the Mosfet will switch hard on with 5V it will work. (without the 1k resistor)
Cheers Bob

That spooked me for a second.
I recon it’s this one but on the picture it’s b8721.
The markings on mine are so worn out I just must have misread it when drawing the diagram.

I’m actually hoping for a really weak action for my solenoid which is my motivation for the 1k resistor. However I’ll take it out per your advice on testing to make sure it has the full current it wants to draw.

1 Like

Back in the day when I worked for Control Data Corp (RIP), some of the electro-mechanical stuff had electronics designed such that there was a high initial current to pull the solenoid armature but then a much smaller current to just hold the armature.