Transistor/Mosfet as switch - Page 1
Forum section: electronics / beginners

author: Bryan
author_rank: Frequent Contributor
timestamp: August 19, 2020, 09:39:00 pm
content: Hello:Working on a small project and would appreciate some guidance. Problem is minor and zillions of how or what to do on the net, but it all gets confusing. In short I am putting together a project using a 556 timer to control a pneumatic electronic valve (Clippard).One stage of the timer will generate a pulse of around 25ms, the second stage of the timer will allow pulses every couple seconds to 3 or 4 per second adjustable by a pot. The purpose is to drive a miniature pneumatic valve to supply CO2 to a aquarium. The valve I assume is a solenoid type and draws around .67 watts.I understand the output of a 555/556 can source/sink 200ma so I suppose I could connect direct to the solenoid but this would probably be a bit dangerous.So I think I should use a transistor or Mosfet. So first transistor or Mosfet?. Would think a small transistor like a 2N2222/2N3904 is plenty, but not sure as to the resistor value to the base. All the calculations on the net get confusing as much of it contradicts itself.If a Mosfet I understand I should use a small value resistor ~47 ohms to the gate along with a 10K pulldown from gate to ground? Can I use a standard 2n7000?The 556/circuitry and valve would be powered by a 12v source, and I would assume a 1n4001 in parallel to the solenoid to prevent any high voltage from the solenoid windings damaging the transistor. Assume it is some type of solenoid inside?https://www.clippard.com/part/EC-2-12

author: ledtester
author_rank: Super Contributor
timestamp: August 20, 2020, 12:20:03 am
content: Quote from: Bryan on August 19, 2020, 09:39:00 pmFor small BJTs like the 2n3904 I just assume a beta of 100 or so and compute the resistance needed to put the required current through the base. Here's a tutorial on that calculation:https://youtu.be/8DMZSxS-xVcOption 2: Use the tried and true ULN2003 relay driver. Can sink 500 mA and designed to interface with digital logic (CMOS, TTL, uC's)Option 3: The MOSFET -- I've typically seen a 100R or so gate resistor with a 10K pull-down. From the datasheet the \$I_{\text{D(ON)}}\$ current at \$V_{\text{GS}} = 4.5V\$ is 600 mA, so it should also work.

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 04:43:16 am
content: Thanks for the reply, couldn't access the Utube video. Are you able to post the title and I can search for it. I think a 2N3904 or 2N2222 should suffice. Not like it hasn't been done a zillion times before.

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 05:04:09 am
content: Too funny, but wander over to Utube and this video shows up in one of my lists. The same valve I am using and exactly the what I was looking for. Sometimes google scares me, might be the same link you referenced <lol>https://youtu.be/8DMZSxS-xVc

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 07:56:21 am
content: As a rule of thumb, for saturated switching with an ordinary single common emitter BJT, you want to drive the base with approx 10% of the expected collector load current. Some high gain small signal transistors let you get away with less, some antique power transistors need even more, but 10% is likely to work well with any simple BJT currently in production. Darlingtons are a different matter - see individual datasheets.A gate pulldown is needed for a MOSFET when there is any possibility of the gate being left floating e.g. if its driven high by a switch, or from a MCU I.O which will be tristate during reset and until the code has configured the pin as an output. Its not needed for a MOSFET driven by a simple push-pull output stage (i.e. 555/556 timers). In all cases a series gate resistor (typ. between 10 and 100 ohms) as close as possible to the MOSFET is advisable to prevent RF power oscillation during transitions.Worst case, at high temperatures a 2N7000 can have a Rds_on of up to 9 ohms, and at room temperature, 5 ohms, which makes it unsuitable for switching more than several tens of mA. It will probably be OK with your load, (which if the wattage you gave is correct, is about 55mA), but I'd prefer something a bit beefier, with an order of magnitude lower Rds_on.A ULN2003 or similar comes into its own when you need to drive four or more separate loads and don't care about its relatively high voltage drop when on. For a single load you'd be moderately crazy to use one vs a single MOSFET + gate resistor.

author: ledtester
author_rank: Super Contributor
timestamp: August 20, 2020, 12:11:50 pm
content: Quote from: Bryan on August 20, 2020, 05:04:09 amYep that's it -- I just fumbled the link when shortening it.

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 06:58:49 pm
content: Quote from: ledtester on August 20, 2020, 12:11:50 pmAnd he did all he work for me, 4.7K resistor for 5v or around 12K if I use 12v for the 556. Of course based on the 2N2222, but now I have a good understanding as to how the calculations are done.

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 07:07:52 pm
content: Quote from: Ian.M on August 20, 2020, 07:56:21 amExcellent, thank you for the tips. Any recommendations for a common general purpose readily available Mosfet in a TO-92 package that would be suitable. For safety I am sure 100-200 ma should be fine. Perhaps a BS170 (using 12v to switch the gate, believe it is spec'd for a drive voltage of 10v) ?Even though a pulldown is not needed for this application, would it be a good idea to incorporate it, or just a waste.

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 07:52:02 pm
content: MOSFET power and current ratings are often pure bulls--t and only achievable on an actively cooled heatsink. To keep the mounting surface of some of the larger ones at 25 deg C at nominal rated power you'd probably need liquid Nitrogen flowing over the heatsink! Small packages not intended for heatsinking are usually more realistically rated but there are still some devices that need to be soldered to a massive area of copper with very short leads to have any hope of operating anywhere near their rated power.Hit your preferred major distributor's parametric search and see what's available (in stock) with 300mA or thereabouts Ic, Vgs_max >=20V and a Rds_on of no more than a couple of ohms. Constrain it to thruhole early but don't constrain the package till the crunch time at the end!A pulldown is pointless unless your 555 or 556 is socketed!

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 07:58:00 pm
content: Quote from: Ian.M on August 20, 2020, 07:52:02 pmThanks, have been looking on Digikey, but all the specs get daunting, but at least with your recommendations on what to look for I have a start. Out of curiosity why would a socketed part vs a soldered require the pulldown? Potential corrosion causing noise?

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 08:04:23 pm
content: Nope. Its nice if the MOSFET doesn't cook itself if some numpty powers it up with the chip out!

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 08:08:11 pm
content: lol...well I am that numpty.

author: Bryan
author_rank: Frequent Contributor
timestamp: August 20, 2020, 08:35:13 pm
content: I think the BS270 should do nicelyCurrent - Continuous Drain (Id) @ 25°C400mA (Ta)Drive Voltage (Max Rds On, Min Rds On)4.5V, 10VRds On (Max) @ Id, Vgs2Ohm @ 500mA, 10VVgs(th) (Max) @ Id2.5V @ 250µAVgs (Max)±20VPower Dissipation (Max)625mW (Ta)Operating Temperature-55°C ~ 150°C (TJ)Supplier Device PackageTO-92-3Drain to Source Voltage (Vdss)60VInput Capacitance (Ciss) (Max) @ Vds50pF @ 25V

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 08:38:06 pm
content: Yep, looks good. Vgs(th) is low enough that a bipolar 555 can certainly turn it off properly.