[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Using Transistor as a switch

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 44
Thread images: 5

File: arduinouno.jpg (55KB, 479x348px) Image search: [Google]
arduinouno.jpg
55KB, 479x348px
Hi everyone,

I'm currently trying to control a load (requires 12V and something like 1 amp) with the logical output of my Arduino Uno (0-5 V, probably a few hundreds milliamps.). The emitter power supply delivers 12V at up to 1.5 amp.

So I have a few questions.

1) I guess my transistor must have a max. collector current above 1 amp (maybe more, to be sure) ?
2) This collector current must absolutely be limited by a resistor, right? But the voltage and current limits make it so that the resistor would be reaaaally low. Is there a solution? No resistor?
3) Have you got an idea as to which transistor i should use, and what schematic i should apply ?

thanks for reading !
>>
>>1033005
There are a couple of different types of transistor configurations, and the difference between them is how much current you will need on the base to activate the switch. In a typical transistor, the amount of current needed to put it in saturation mode depends on how much load you are switching. Since you are using an arduino, I would recommend a darlington transistor because you can only apply 40mA of current from any output pin. Use something like a TIP120 or TIP122.

As far as current limiting the load, you're right that if you use a resistor to limit it, it will end up being only a few ohms and will dissipate a lot of heat, which is wasteful. Your better bet is to use a power supply that is already limited to something close to the current that you want, or to add a second device to your first device, in parallel, to split the current between them. It's a tricky question and one that may have no "good" way of doing it.
>>
File: npn.jpg (193KB, 1355x1172px) Image search: [Google]
npn.jpg
193KB, 1355x1172px
>>1033011
Thanks for the quick answer !

A TIP120 has a max collector current of 5amp, and my power supply won't go over 1.5 amp (which is alright for the load). Does this mean that i don't have to use any resistor in my circuit? Like logic output goes to base, power supply Vcc+ goes to Emitter, load between ground and collector?
>>
>>1033011
Also, depending on what it is that you are powering, the load itself may be able to limit the current. That is, the load may only draw as much as it needs, so no additional current limiting would be necessary.

I think TIP120 is rated for something like 10A, so you shouldn't have any problems overloading that device (just be sure to put a heatsink on it), so as long as your device doesn't instantly self destruct when you apply the power supply to it without a switch in the middle, it should do fine when you apply power with a switch in the middle too.

I'm sure Google has some schematics for wiring up a transistor switch to an arduino, so check there if you need a wiring diagram.
>>
>>1033015
Yes, yes, and yes. Again though, don't forget to put a heatsink on the transistor, and put a current limiting resistor between your logic output and the base (usually around 1 Kohn, 1/4W).
>>
>>1033018
Whoops, looks like you have emitter and collector mixed up there. Power supply + goes to collector, then flows through the transistor when the base is activated, and comes out of the emitter and through your load to ground.
>>
>>1033019
Thanks a lot for the answers ! :)
>>
>>1033017
A heatsink is definitely not a bad idea but I thought I'd just chime in and say I have a bunch of TIP120s switching 12V 1.5A loads in live systems and they barely even get warm without a heatsink.
>>
>>1033019
And out comes something like 3.5V. No.

>>1033015
What is this load of yours? If it takes 1A at 12V and that's ok, then there's no need to add current limiting resistors.
In that pic of yours Rc would be the load. You also need a resistor between the transistor base and Arduino to limit current. Something like 330 or 470 ohms would be suitable. The value isn't horribly critical.
>>
>>1033029

It'as a magnetic door lock.
>>
>>1033031
If it's rated for 12V, then there's no need for resistors.
You should put a diode in parallel with it, though, or there's a chance that it zaps your transistor. Cathode to the positive side, anode to the transistor. Diode is not critical, 1N4001-1N4007 are suitable.
>>
>>1033039
Sorry, english isn't my mothertongue... What do you mean by "Zaps your transistor" ?
>>
File: FUCKBIPOLAR.png (56KB, 504x451px) Image search: [Google]
FUCKBIPOLAR.png
56KB, 504x451px
>>
>>1033041
Ruins it. Inductive loads like magnetic locks produce overvoltage spikes when they're de-energized.
>>
>>1033057
Yea, if you just need a low-speed switch,,,, mosfets are somewhat easier to use IMO because the gate doesn't really need current--only a voltage charge.

So you can set the pullup (1K) and pulldown(100K) resistors to draw as little current from the arduino pin as you want. That configuration (1K + 100K) draws basically no current off the arduino pin (1/200th of a milliamp?).

One I use for 5v arduino stuff is the IRLZ34, but there's others.
>>
>>1033057
Fuck bipolar is right! Listen to this guy, BJTs are antiquated. Why not use other old shit like vacuum valves? Fuckin N Channel Enhancement MOSFETs all the way. Just calculate how much base to collector current you draw and voltage you drop on a TIP120 to get it fully open. PLUS you're probably going to heatsink the damn thing! What a fucking waste.

Follow what this guy suggests. Welcome to the 21st century.
>>
use a relay and a diode if it's a slow thing, and i guess a mosfet if it's a fast thing
>>
when trying to order the TIP120, i noticed that it says "Collector Emitter Saturation Voltage Vce(on) : 2 V"

Does that mean that my Vce = 12V would be too much, and saturate the transistor without regard to Base voltage?
>>
>>1033415
Or does it mean that, if Ib isn't null, Vce has to be at least 2V to enter on-mode?
>>
File: tip120.png (78KB, 834x757px) Image search: [Google]
tip120.png
78KB, 834x757px
>>1033415
It means that when the transistor is fully on, the voltage drop in the transistor itself is at most 2V, leaving 10V to your load.
Well, under some test conditions. At 1A you can expect 0.8V loss or so. Picture related.
>>
>>1033005
TIPs are cool and all, but honestly you'll want a FET. Way less heat dissipation, and way less power needed to switch.
>>
>>1033005
for slow stuff an arduino relay on ebay will work. i use them and they work great. 1 line of code to use them too.
>>
>>1033057
>low side driver
absolutely_disgusting.jpg
>>
>>1033634
Not him, but care to expand on that? Genuinely curious.
>>
>>1033658

There's a caveat with switching a load on the low side; it raises the voltage of the _entire_ load and everything sharing that particular line to your voltage source. That is to say, the "ground" connection on your load can never actually be at ground voltage. At most, it will be at GND+(whatever resistive voltage or diode drop your switch exhibits). With the switch off, it will be sitting all the way up at +V.

This is only really a problem if you have some other circuitry attached to that load that is voltage-sensitive for one reason or another, be it some sort of sense line, data line, a plain-old max voltage rating, or what have you. Occasionally it can be a safety concern if you're working with voltages high enough to cause bodily harm.

In this specific case, however, there isn't any reason to hassle with high-side switching.
>>
>>1033658
>>1033661
Right. It's generally bad practice to leave a load at an elevated potential. PFETs with very low RDS(ON) are plentiful these days, and it's really not hard to set up a basic high-side switch.
>>
>>1033005
use a small power mosfet to control the power source with the arduino
>>
>>1033005
also if your going to use an n-channel mosfet as a high side driver your gate source voltage will need to be closer to the drain voltage (the +12v) to fully activate which your arduino cannot delive; you can get around this by using an optoisolator as a gate driver.
>>
>>1033759
Actually you can buy NFETs with "logic-level" gates to get around this.
>>
>>1033777
when I tested and IRFZ44N mosfet with a Vgs of 2 - 4V on a low side configuration I was able to fully saturate and I read 12V from the 12V to the drain.

as a high side configuration with 12V connected to the drain I wasn't able to get full saturation and only read 2.8V from the source to ground with 5V applied to the gate.
>>
I would use a 5v relay instead of a transistor at all OP, but that's just my opinion
>>
>>1033823
you would still need something like a bjt to drive the relay coil as the max current for each pin is 40mA
>>
>>1033005
I'm confused. Are you trying to drive the load with your Arduino, or use your Arduino as a control in tandem with a 12v source that will drive your load?
>>
>>1033005
https://en.wikipedia.org/wiki/Silicon_controlled_rectifier
>>
>>1033861
>SCR
>once triggered cant turn off without anode-cathode current falling below a threshold
>>
>>1033861
Good one retard. Here's your helmet and box of crayons.
>>
>>1033786
Yeah you need to use PFETs to drive a load from the high side.

With an NFET on the high side, any voltage across your load will reduce the NFET's VGS and thus reduce IDS.

I misread >>1033759 originally, my bad. FETs with "logic-level" gates are good for low-side drivers where level-shifting is for some reason taboo.
>>
>>1033005
Adruino is shit man... only for students of new entry
>>
File: 1305487523857.gif (32KB, 410x410px) Image search: [Google]
1305487523857.gif
32KB, 410x410px
>>1034258
>Adruino is shit man... only for students of new entry
This could be disproven a couple of ways:

The first point is the question "is shit for what?"
What have you built on a MCU board that could not have been done on any of the official arduino boardz??? (Due/ARM is discontinued but they have the smaller Uno-ARM thing now ?:[ .....)

The second point is that Arduino made MCU's easy.
Most china dev boards are cheap, but they suck for support.
Even if you pay for a better dev board, the docs may (should!) be better but they still often don't have a USB port for programming, and the toolchain is difficult to set up and use.

The guise who came up with Arduino knew what already existed, and why it was bad.

Arduino is great because of:
1. USB port for programming and
2. there is only ONE program to install to get coding.

(that it is easy to use as PC peripheral is very nice too)
>>
>>1034258
>Arduino is shit

Well, I know how to program µC, but this project is meant to be used/enhanced by engineers other than EIT. Therefore, i thought that the easier and more documented the platform, the better. The technical point isn't always the most important IMO.

Yet, even though, I don't see why it would be a problem to be a student of new entry... Everyone has to start somewhere, right?
>>
>>1034359
>USB port for programming

To me this is the main pull factor for Arduinos

There's no special cables or clips

If I'm in the workshop and I can;t find my Arduino™ USB Programming Cable - who gives a shit? I can just use the cable I charge my phone off.
>>
>>1033015
You need a resistor that connects the input signald to the base of the transistor
>>
Dumb shit. Just buy a $1 relay.
>>
>>1033005
Thanks a lot everyone, the TIP122 works like a charm !
Thread posts: 44
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.