I want to enable/disable 20V current with my ATmega pin. How can I connect transistor and what transistor?
-
1\$\begingroup\$ How about you tell us more about your application? \$\endgroup\$– Matt YoungCommented Apr 1, 2014 at 18:59
-
1\$\begingroup\$ One clarification: You switch (not "steer") voltages. Also, "20V current" does not make sense. \$\endgroup\$– JYeltonCommented Apr 1, 2014 at 19:45
2 Answers
Try this: -
A GPIO pin from your MCU going high activates the BC547 and this draws current through the 1 kohm resistor and applies about 15V on the P channel FET's gate-source. This turns on the FET. When the GPIO pin goes low the BJT turns off and the P channel FET's gate-source voltage discharges in a few microseconds to zero thus turning it off.
Pick a P channel FET that has suitably low on resistance to cope with the load current and there should be no need for a heatsink in most cases. There are plenty of P channel FETs to choose from and I'm not picking one for you - you have to decide what package suits your circuit. If in doubt ask.
-
\$\begingroup\$ are there no solutions using one transistor? because I need to steer 8 channels with 20v \$\endgroup\$ Commented Apr 1, 2014 at 18:52
-
\$\begingroup\$ Not clean solutions - it would depend on load current and be much more critical (and restrictive) on the type of P channel FET. It can be done but the 20V range needs to be adequately described and the load conditions min and max are more critical- a BJT would be replaced by a zener diode - not much saving I'm afraid so I can't recommend. \$\endgroup\$– Andy akaCommented Apr 1, 2014 at 19:15
For just enabling and disabling you're best off with an N-FET type transistor. It is most commonly used between GND and the load. Connections go like so:
Load +: supply + rail Load -: FET Drain ATMega output pin: FET Gate FET Drain: supply GND
In essence the N type FET is a voltage controlled switch, where voltage between Gate and Source controls the switch channel conductivity.
A technical discussion regarding load switching including oscilloscope screenshots and all. I linked this one, because they put a nice illustration of a low side FET switch circuit. They also mention in the discussion that the 1N4001 really is too slow for catching switch off ringing and you should select a fast diode.
-
\$\begingroup\$ and will that be suitable for steering 20v from 5v ATmega? \$\endgroup\$ Commented Apr 1, 2014 at 19:00
-
\$\begingroup\$ As long as you select a FET that will turn on at 5V. Usually they are labeled as Logic Level in component catalogs. You can also use some gate driver circuits enabling you to select non-logig-level FETs that have better other parameters. \$\endgroup\$ Commented Apr 1, 2014 at 19:05
-
1\$\begingroup\$ No, an N channel FET will not be suitable for steering 20V from a 5V atmega! It is suitable for "steering" 0V to a load that is connected to 20V but that is different to hard-switching the 20V. \$\endgroup\$– Andy akaCommented Apr 1, 2014 at 19:12
-
\$\begingroup\$ Well yes. My solution switches the load to ground connectivity while yours switches the positive supply to load connectivity. Both work fabolously well. I've used a high side P-fet in a software controlled PSU with a driver looking very much like your 547 one: github.com/Ell-i/Hackathon/wiki/… \$\endgroup\$ Commented Apr 2, 2014 at 5:14