I think you should have explained the voltage drop over B-E. So the B resistor is = Output voltage (Arduino) - voltage drop over B-E /output current = 5V - 0,7V = 4,3 4,3/1mA = 4K3 Ω Anyway I thing it is lovely you teaching a little "analog" 😊 👍 to you
@RalphBacon4 жыл бұрын
Oh, believe me, Allan, there was so much more info I could have included but I was absolutely determined to give only what would fit into 15 minutes. My cutting room floor is littered with good stuff. But there is always the possibility of another video on transistors that would include this. Thanks for the 👍
@prlombaard4 жыл бұрын
Very nice explanation in brief terms of how to use the good old NPN transistor. Thanks again.
@RalphBacon4 жыл бұрын
Glad it was helpful!
@miriamramstudio39824 жыл бұрын
That was an excellent explanation. Looking forward to watch the one about MOSFET. Great video !!
@RalphBacon4 жыл бұрын
Glad you liked it! MOSFET coming soon (after caps and resistors).
@ForwardGuidance4 жыл бұрын
Excellent refresher or introduction too for the beginners. This series will make for a nice playlist. All videos from you Ralph are good, the long ones with so much great detail and shorter ones like this with still all the necessary details.
@RalphBacon4 жыл бұрын
Many thanks! You've summarised my intentions perfectly. I need a good PR man... unpaid, of course!
@iancooper4184 жыл бұрын
A clear and concise explanation. Big thumbs up.
@RalphBacon4 жыл бұрын
Glad you think so Ian, that's great!
@jparky19724 жыл бұрын
I really like these shorter videos Ralf. Very well explained. I'm very much a novice with electronics, even though I've been playing with arduino for a few years now. Thanks. Looking forward to the next one.
@RalphBacon4 жыл бұрын
Glad you like them, Jason! More in the pipeline and planned. In addition to my regular ones, of course.
@isoguy.4 жыл бұрын
That was an amazing explanation and demonstration of how to use an npn transistor. Thank you so much for this vid.
@RalphBacon4 жыл бұрын
Glad it was helpful! (I'm assuming this was not a sarcastic remark!) Beginners have to start somewhere, after all.
@isoguy.4 жыл бұрын
@@RalphBacon Genuine thanks, not intended to be sarcastic in any way, sorry if it came across that way.
@philowen27554 жыл бұрын
Excellent. This is the type of video a parent and child could watch learning a lot together (if Arduino inclined). Clear, precise and profanity free (as all your videos are). Thanks Ralph.
@RalphBacon4 жыл бұрын
Glad you enjoyed it! Thanks, Phil!
@OsoPolarClone4 жыл бұрын
Great video as always. I can see already that I will enjoy this series of videos as I do not know that much about electronics. THANKS!
@RalphBacon4 жыл бұрын
More to come, Bruce! We don't need a huge amount of knowledge for Arduino stuff, but the basics does help.
@MrJozza654 жыл бұрын
Very nicely explained. I play a lot with pre-built modules with the Arduino, and had forgotten a lot about the basics of transistors etc so this is a welcome refresher for me, thanks!
@RalphBacon4 жыл бұрын
Glad it was helpful!
@abpccpba4 жыл бұрын
Great idea Ralph for all of us in a stay at home mode. KZbin has sure helped us, visual learners. Thanks, Mr. Bacon.
@RalphBacon4 жыл бұрын
Glad to help, Paul. When lockdown has ended we will all be experts at all things!
@wv8384 жыл бұрын
And perfect timing. I'm about to do this myself to switch a gazillion led devices for a flight sim cockpit build.
@RalphBacon4 жыл бұрын
I knew that, which is why I released it now! Ha ha! Just on the LED subject, don't forget you can control (colour, brightness) a gazillion (approx) LEDs if they are Neopixels, with just one pin on an Arduino. I covered it briefly in videos #62 and #68.
@andrewkieran89424 жыл бұрын
If you're controlling a lot of LEDs, wait for Ralph's MOSFET video or, as he suggests, use addressable LEDs i.e. NeoPixels like the WS2812B or similar.
@JerryEricsson4 жыл бұрын
Thanks a million, love your videos to take my mind off the way things are for our family right now....
@RalphBacon4 жыл бұрын
You are so welcome! Times are tough for you now Jerry, keep positive. But not in a Car Owner virus way.
@scottstevens75694 жыл бұрын
Good description and presentation of how all the parts work and fit together. Well enjoyed!
@RalphBacon4 жыл бұрын
Thank you very much! Nice to hear from you Scott, keep tuned.
@QCAndre4 жыл бұрын
Great stuff Ralph. I am waiting for the MOSFET and the PNP. Thank You
@RalphBacon4 жыл бұрын
You and me both! Keep tuned!
@tim_bbq10084 жыл бұрын
Bacon Bytes Beginner's Series. I'll be looking for more like this!
@RalphBacon4 жыл бұрын
More to come! There's a playlist for these beginner type videos too: kzbin.info/aero/PLZHhGaUUFqq31OZZLV8HxSc7hY08JCBzu
@whitefields55954 жыл бұрын
Ralph, At the end of this series please do publish your 'favourites'. Most Arduinites only need a few BJTs, MOSFETS to get started and it would help if you ended with a list of the most useful. Please include Logic level devices too. Once folk have got a basic set of 'Must haves' then they can go roaming through the data sheets for the different types. If you want my list, then please ask.
@RalphBacon4 жыл бұрын
Good idea, Mr Whitefields (so formal). As you say, I tend to have a set of favourites that work with Arduinos (and similar), and I also have a list which I won't use (again) as they didn't play nicely at all. Anyone else inadvertently buy a MOSFET with a minimum gate voltage of 8V so it just doesn't work with an Arduino? Oh, just me then. Sigh. If you could send me your list, that would be super, I can compare notes and claim all the credit too. Drat, didn't mean to write that last bit.
@whitefields55954 жыл бұрын
@@RalphBacon Start with TIP 120 and BC 547. Don't forget to do a Darlington pair example. Then focus solely on 5 V and 3V logic level transistors. MOSFETS go for IRLZ34(and 44) N. P channel Vishay A1SHB (but SMD only). Mains triac ST BTA41-600B for up to 3kW (but you don't do mains!) .... emphasise benefit of using passive components rather than the awful modern trend of "Doing it in software". As few passives keeps it simple and stable and saves the processor whizzing round and round. Remember output current and impedance of Arduino. Finally use an op amp as a high impedance voltage follower (zero gain buffer) to really clean up Arduino I/O.
@batticha4624 жыл бұрын
Brief, Clear and very helpful.We are waiting for another one
@RalphBacon4 жыл бұрын
Will upload soon, Batticha! Well, I say "soon"... in about a week, but I have my usual video complete as well! Glad you liked it.
@robertrobert55834 жыл бұрын
Thanks for a very helpful video. As a hobbyist I've picked up bits and bobs but it's really helpful to have this to fill in the gaps. I'm hoping you will do one on capacitors. I find pico, nano micro farads and codes like 22 extremely confusing and when I needed a ?105 for a project I found that was the one that I couldn't find in my large assorted box!
@RalphBacon4 жыл бұрын
You're very welcome! I do have a video on caps waiting, can't remember for the life of me what I included, Robert, but I hope you find it equally useful when I publish it.
@JerryEricsson4 жыл бұрын
Kind of a neat review for those of us who understand the transistor, or think we do at any rate. I quite enjoyed it even though it was a bit on the short side, as you said it would be. Thanks for building these great videos for we, the arduino lovers.
@RalphBacon4 жыл бұрын
Glad you enjoyed it, Jerry! Yes, deliberately kept short (boy, that was *hard* ) so I didn't lose viewers!
@tomgeorge37264 жыл бұрын
Good video for those needing to understand BJT operation. The 2N2222A can by the unknowing be mistaken for P2N2222A, they have different pinouts. BC548 is in my opinion and experience the better transistor to use.
@TheEmbeddedHobbyist4 жыл бұрын
Also the 2n2222A from Farnell is a TO18 metal can! I feel that what you need to read on the data sheet is more important than the type. if you know what to look for and what it means you then have a much bigger choice of transistors to pick from.
@RalphBacon4 жыл бұрын
These days, general purpose NPN/PNP transistors are pretty much interchangeable, especially where the Arduino is concerned. And I haven't used (or seen) a T018 can transistor for about 20 years! The last one was a BC108C!
@TheEmbeddedHobbyist4 жыл бұрын
@@RalphBacon Farnell are TO18, or LCC and RS components are LCC-1 and LCC-2!
@flemmingchristiansen24624 жыл бұрын
Well explained. All in nice and easy general terms It is important to check the datasheet when choosing transistors. Pin lay layout can differ a lot. General speaking - electronics is all about voltage control, governed by Ohms law.
@RalphBacon4 жыл бұрын
Ohm's law is explained more in the resistor video. Coming soon!
@richardkussin32063 жыл бұрын
Excellent! I am new to this hobby, and have some general background on transistors. This is very helpful to see it condensed down to what is needed in Arduino. Just what I needed.
@RalphBacon3 жыл бұрын
Glad it was helpful!
@gpTeacher4 жыл бұрын
It’s Zen-like clarity at its essence Ralph! I wish I’d seen this YEARS AGO!!! Really great Ralph! Boffo Bacon Bytes! “B-Cubed rules! Thank you.
@RalphBacon4 жыл бұрын
So you liked it then, Gord? I couldn't be sure!!! So nice to know it will be useful to viewers. Thanks for posting.
@gpTeacher4 жыл бұрын
Loved it Ralph! Really concise and understandable. Bravo! Sorry I wasn’t more clear. Enthusiasm won out over clarity😎😎. I’ll be looking forward to the future episodes!
@RalphBacon4 жыл бұрын
I was talking tongue-in-cheek, Gord, your enthusiasm was well evident in your original post!
@Keeping_IT_Simple4 жыл бұрын
A great explanation , very understandable which i found covered the topic well without going down any unnecessary rabbit holes Like the Bacon Bytes format & look forward to the rest of the series
@RalphBacon4 жыл бұрын
Glad you enjoyed it!
@phillipneal81944 жыл бұрын
Wow ! I now have a better idea of transistors and power management. Thank you.
@RalphBacon4 жыл бұрын
You are welcome, Phillip, thanks for posting.
@patrickdelvisohopkins2 жыл бұрын
That was a great video on NPN BJTs, thanks!
@RalphBacon2 жыл бұрын
Glad you liked it!
@mufeedco3 жыл бұрын
Thank you. It is one of the best video explaining how transistor works.
@RalphBacon3 жыл бұрын
Glad it was helpful!
@chrisingram72774 жыл бұрын
I too enjoyed the "BB" format , learned some more during my morning coffee. Keep them coming.
@RalphBacon4 жыл бұрын
Thanks, will do, Chris! I have a couple waiting in the wings, but more planned.
@jeffmerlin25804 жыл бұрын
9:30 I think you forgot the 0.7V between base and emitter, Ralph. 4.3V over the resistor, that means slightly less than 1mA with a 4k7 ohm resistor. Not that it matters though. :-)
@pjaj434 жыл бұрын
On the other hand it is usual to drive the transistor int full saturation when using it as a switch. So if the rated gain is, say, 100 then it would be quite common to drive the base at about 4 - 5mA for a 100mA load. So the resistor would be about 1K ohms.
@RalphBacon4 жыл бұрын
Agreed. In the Arduino world we will drive it into full saturation, mostly.
@peterlorne70774 жыл бұрын
Hi Ralph! Hands in the air for you 🙌 Thank you ! / Peter in Sweden.
@RalphBacon4 жыл бұрын
Hey, thanks, Peter from Sweden!
@Hasitier4 жыл бұрын
Nice explanation for the beginner Ralph.
@RalphBacon4 жыл бұрын
Thanks for watching, Michael, as this beginner level was obviously not aimed at the likes of you! But so many electronics hobbyists ask me some fairly basic questions I thought it worthwhile doing. Cool.
@Hasitier4 жыл бұрын
Ralph S Bacon it’s definitely worth doing such videos Ralph. We all started once.
@adabill2954 жыл бұрын
Another great, very understandable video. I've been using the esp32/8266 chips lately and would appreciate, if it doesn't make the discussion too complex, for you to mention if these items can be used with 3.3vdc devices also.
@RalphBacon4 жыл бұрын
As far as transistors go, they don't care what the output voltage is from your device as they only require about 0.77V to work. Just adjust the formula I used to calculate the correct resistance (bearing in mind that these ESP devices cannot output as much current per pin as an Arduino).
@daviddoidge12524 жыл бұрын
Brilliant as always, looking forward to the crystal episode
@RalphBacon4 жыл бұрын
Thanks, David! I thought I might cover realigning the antimatter chambers in the UNO before the dilithium crystal video?
@daviddoidge12524 жыл бұрын
@@RalphBacon 🖖
@gpTeacher4 жыл бұрын
Hi Ralph. Since you’ve already got that white speed controller that you showed at the beginning, how about just get a duplex outlet, put it in a small enclosure, mount it on your bench/wall where it’s convenient to reach and run a grounded cable and plug from it to your mains outlet and put a longer cord on your fan that can reach the controller now plugged into the box. It’s grounded and safe and uses the white controller that you’re confident with. No Chinese Roulette! As they say in Alabama,”Voy-la!” All the best!
@RalphBacon4 жыл бұрын
Tha is indeed a good suggestion, Gord. If I don't end up making my own electronics I might consider that. Simple and cheap!
@satchell784 жыл бұрын
Thanks, was sitting here for a couple minuets, not working...? Flip the last LED around, bam, 12v of brightness.
@RalphBacon4 жыл бұрын
Glad it's all making sense!
@GnuReligion4 жыл бұрын
Am surprised you chose the American 2n2222 instead of the more international bc548. As a novice hobbyist I like the ULN2003 for transistor switching. Has built-in base resistors as well as protective flybacks.
@RalphBacon4 жыл бұрын
Ah, mine are _Chinese_ 2N2222A transistors, obviously very different, Steven! 😅 Well the fact is, I have umpteen transistors, all pretty much interchangeable, and I just plumped for this one. Your ULN200X series is a great set of Darlington transistors (some with base resistors, as you say) but not something for a beginner video! And they are usually IIRC in a DIP or SOIC package? Too many leads!
@kennmossman87014 жыл бұрын
Isn't the BC family originally from the UK? I don't think it is more 'international'. It has some advantages while the 2N2222 has different advantages.
@GnuReligion4 жыл бұрын
@@kennmossman8701 (puts down hamburger) This was a post-brexit expression of reuniting with US standards. We have saved your imperial measurement system for you too, if you want it back!
@RalphBacon4 жыл бұрын
Apparently, the BC549C is the modern day equivalent of the BC108 (family): www.petervis.com/electronics/bc549c/bc549c.html
@dannyjensen49544 жыл бұрын
Can't wait for the mosfet video! Thanks.
@RalphBacon4 жыл бұрын
Next on is out already, all about capacitors.
@danljohnston4 жыл бұрын
What a treat! Looking good Ralph. Thanks
@RalphBacon4 жыл бұрын
Thanks for watching, Danny!
@raym96914 жыл бұрын
Really great explanation on how to use transistors! Really helped me out thanks! I'll be looking forward to your mosfet video the simplification you used made it easy to understand! Cheers
@RalphBacon4 жыл бұрын
Awesome, thank you!
@georgef77544 жыл бұрын
My favourite type of bacon. Thank you. So using your example if I wanted 500mA I would need a 1k resistor? Looking forward to the mosfet video.
@RalphBacon4 жыл бұрын
Is this a question about the base resistor, perhaps? Theoretically, with a gain of 100 the transistor's base needs 100 times less current: 5mA in your case. Using Ohm's law (which is covered better in the resistor video) 5v/.005 = 1,000Ω (aka 1kΩ). BUT! The gain is dependent on the _actual_ collector/emitter current flow; with a current flow of just 0.1mA the gain is about 50. At 1mA it's 75 and at 10mA to 150mA it's 100. But it drops to just 30 at 500mA! Datasheets are definitely your best friend! Great question, George, and you can see why I didn't muddy the water with sort of information in the video!
@flashcorp76 Жыл бұрын
I know all about this, but I still watch because it’s a pleasant electronic cultural discourse, that gets me by when …..at work…. waiting for what follows😊✌🏻👍🏻
@RalphBacon Жыл бұрын
Glad to help you pass the time!
@markgreco19624 жыл бұрын
Thanks Ralph
@RalphBacon4 жыл бұрын
You're welcome, Mark, thanks for posting.
@johnjeremias94374 жыл бұрын
Thanks Ralph, really enjoyed youe video. Will search for next
@RalphBacon4 жыл бұрын
Glad you enjoyed it! There is a playlist for these Bacon Bytes videos: kzbin.info/www/bejne/b5K8hq2IpbuGoKM
@mikestombraidervids87684 жыл бұрын
Hi Ralph. Nice one! Will the 'BB' videos be getting their own playlist ??
@RalphBacon4 жыл бұрын
They already have, called Bacon Bytes: kzbin.info/aero/PLZHhGaUUFqq31OZZLV8HxSc7hY08JCBzu
@grahamevans53044 жыл бұрын
Ralph S Bacon I’m luvvin it 🎶🎶🎶🎶🎶🎶🎶🎶
@grahamevans53044 жыл бұрын
Bacon Bytes...good name
@fjdelahoz4 жыл бұрын
Many thanks Ralph. Great video. Very informative.
@RalphBacon4 жыл бұрын
Glad it was helpful!
@andymouse4 жыл бұрын
Very nice Ralph, newcomers will love this and maybe this pandemic will have a bit of silver on its lining and get more people involved with our hobby...cheers.
@RalphBacon4 жыл бұрын
You would not believe the questions I get asked, Andy. The problem is that novice makers want to run before they can walk. So I thought this series might give them a bit of basic knowledge to build on. That way, they get the info they need and I get less questions! Win-win!
@andymouse4 жыл бұрын
@@RalphBacon Exactly Ralph, it was a great idea and a great start !
@johnmarshall26604 жыл бұрын
Another great idea ... since I got my Toggle switch working using PCF8574 .. got 16 channels I want to switch inputs to other Arduinos or PIC devices and Relays so got some 2N7000 Mosfets so be interested in your next Mosfet video..
@RalphBacon4 жыл бұрын
Have fun watching the MOSFETs video, John.
@Mr31Vince4 жыл бұрын
What caught me out with transistors and arduino was that you must always connect the load to the collector side of the transistor for npn (nn2222a) as there is no path to the common ground for the current from the gpio pin if the load is connected to the emmitter side. Basics I guess, but it caught me out.
@RalphBacon4 жыл бұрын
Yes, a common "gotcha" that one, good that you mention here to warn others.
@normcaissie55984 жыл бұрын
Love it. Thanks
@RalphBacon4 жыл бұрын
Thank you too! Thanks for posting, Norm.
@McTroyd4 жыл бұрын
You MIGHT be able to use that transistor in an "in-between"/linear state by using a bypass capacitor to ground on the base (say, 0.1uF or higher). At that point, analogWrite() PWM control would become a ramping voltage, which should also ramp the current through that 4.7k resistor, thanks to Mr. Ohm. Or, one could skip directly to a MOSFET and just wire it directly, but decouple the load instead of the base/gate of the FET. (Might need a pull-down resistor to discharge the FET's gate.) Looking forward to the FET video! 👍
@RalphBacon4 жыл бұрын
These days, Ted, I would certainly lean towards using a MOSFET instead of a BJT but that's for another video! I've found a pull down is certainly required on a N-channel MOSFET as just touching the gate is enough to make it start conducting! Ditto, a pull up on a P-channel. More in that future video.
@McTroyd4 жыл бұрын
@@RalphBacon As I think about it, in the specific context of Arduino, doesn't the output-mode pin pull to ground when it's low? (I remember having to set output pins to input pins to get the "high-Z" stage on a bus.) That being the case, the pull up/down might not be necessary...
@iot_enthusiast4 жыл бұрын
Nicely done, as always!
@RalphBacon4 жыл бұрын
Thank you, Mohan! Cheers!
@TheUnofficialMaker4 жыл бұрын
Good job breaking it done...NPN arrow Not Pointing In memory clue :)
@RalphBacon4 жыл бұрын
Cool, thanks! My life is built on mnemonics like this!
@simonwhite31374 жыл бұрын
Nice! I can add “Not Pointing iN” to “Vulcanised India Rubber” 😁
@simonwhite31374 жыл бұрын
Nice one Ralph! I’m sure you have thought it through, but I’m puzzled why you assume that even the tiniest bit of basic maths is going to frighten viewers. I was introduced to the VIR triangle of Ohm’s Law fifty years ago (mnemonic “Vulcanised India Rubber”) and still draw it every time I work out a resistor value! The middle of that video was the ideal place to put it, surely? All the best 🙂
@RalphBacon4 жыл бұрын
I am always nervous about introducing more complex concepts (yes, even simple maths, Simon) because I suspect viewers will switch off. However, we do cover some simple Ohm's law stuff in the Resistor (future) video, complete with the VIR pyramid (which, like you, I use most days). [Note to self: be braver]
@johnstephenson28914 жыл бұрын
I'm old school and we had two ground symbols, chassis ground and ground. But never a straight line. lol
@RalphBacon4 жыл бұрын
I use chassis ground ( ┴ usually) but a straight line that is the (common) ground is fine too. As long as it's clear.
@willofirony4 жыл бұрын
Now I know you were focusing on using the transistor in digital mode as a switch. However, I have a question: Have you ever used a transistor in PWM mode? I am not sure what I would use such a configuration for but I am curious if the collector would just output the "noisy" on off wave form, thus making it useless for an analog amplification. I am guessing that feeding such a signal to an inductive load, such a motor would average out the output but a speaker would generate an awful load. Stay healthy, Ralph.
@RalphBacon4 жыл бұрын
You wouldn't be able to _amplify_ analog using PWM (this is not a class D amp) but, as you say, you can use PWM to generate audio tones, of course, Michael. And using high frequency PWM to drive a motor (not directly, ideally via a MOSFET bridge but a BJT tranny or two would work too, sort of) would enable speed and direction control of that motor (but not by averaging). I'll be talking about this in my Bacon Bytes video on MOSFETs. Stay tuned!
@willofirony4 жыл бұрын
@@RalphBacon Thanks for that, Ralph. Bacon Bytes .....yum!
@sprink884 жыл бұрын
Hi Ralph. Love your series, have learnt a lot... Can you tell me what bulb you use in the demo? I'm very interested in interesting, retro or otherwise non-LED lamps... Can you let me know how I might search for a bulb like the one you show in your demo?
@RalphBacon4 жыл бұрын
That bulb is a car bulb, normally used as the interior light (when the door opens it goes on). These days they are all LED but that one is incandescent. eBay has lots of 12v 5W bulbs but few of them like this: www.ebay.co.uk/itm/2-X-239-FESTOON-12V-5W-CAR-AUTO-BULB-BULBS-38MM-INTERIOR-LIGHT-NUMBER-PLATE/143541337927
@sprink884 жыл бұрын
@@RalphBacon Thanks so much!
@lint20234 жыл бұрын
Good stuff. My problem: I learned electron flow so I get confused with hole flow. drat
@pjaj434 жыл бұрын
Yes, the arrow on the emitter points in the conventional direction of current flow, but the electrons,of course, are going the other way.
@RalphBacon4 жыл бұрын
Biggest mistake of the 19th/20th century in deciding that current flows from positive to negative, when in reality it's the other way round. Conventional vs electron flow. But we all understand it now, right? Oh.
@joebrown32864 жыл бұрын
Happy new year everyone. Hi Ralph, there is a chip out that replaces Relays, they use the 12c and spi chip is ADG714 and ADG715 . these are spst chips. With up to 8 outputs. Any chance you can run a video on one of these chips and how to program. Really think these can drastically shrink arduino circuits needing low voltage relay switching. Thanks Ralph and keep up the fantastic workshops. Joe
@RalphBacon4 жыл бұрын
Hmm. I thought initially, Joe, that these could be useful, as you say, to replace relays. Then I discovered this in the "Maximum Ratings" section: *Continuous Current, S or D . . . . . . . . . . . . . . . . . . . . 30 mA* This makes it no more useful than a standard Arduino ATMega328P output, which can handle 40mA on individual pins with an overall maximum of 200mA for all pins at any one time. (Best Practice keep each pin to 20mA). I'm, thinking now that standard MOSFETs (eg 2N7000 or Si4599 dual) are a much better options to switching loads in a microcontroller environment. Thoughts?
@joebrown32864 жыл бұрын
@@RalphBacon Hi Ralph, you are absolutely correct, these chips are way to low in amp outs. Great product ruined by max output. Hmm mosfet switching really interesting, dual mosfets even better. Have you got a video on these Ralph as poss relay killers as I couldn’t find one.
@DavidBTB4 жыл бұрын
In the example of limiting CE current to a "bulb" by restricting the BE current, would you still use a current limiting resistor when using bare LEDs?
@RalphBacon4 жыл бұрын
Oh yes! But in a different place! In this simple example, the bulb was rated at 12v so we did not need to "restrict" the current flowing through it at all. We had to ensure the transistor was being switched on enough so allow all necessary current to flow. If that bulb were a red diode, with a typical forward voltage drop of 2 volts (ie it "lost" 2v just by being there and conducting) and which required a maximum of 20mA, we would need a resistor to ensure that we only allowed 20mA to flow. We will cover this more fully in the _resistor_ video, but we want to "drop" (restrict) 10v @ 20mA which according to Ohm's law is 10v/0.02A = 500Ω. As I say, we'll go through this in more detail in a future video. That resistor goes *in series* with the LED. You can keep the base resistor at 4K7 which just ensures the transistor is fully switched on.
@DIYDaveOK3 жыл бұрын
Now this is what I was looking for! Thanks!
@RalphBacon3 жыл бұрын
Glad I could help!
@ucmetoo14 жыл бұрын
Great explanation!
@RalphBacon4 жыл бұрын
Glad you think so! I've a few more in the pipeline too.
@chrisarmstrong81984 жыл бұрын
Thanks for the interesting video. Here's my $AU0.02 worth:- In order to make sure a transistor remains in saturation independent of the collector load (which is what you want in a digital circuit), it is usual to overdrive the base. So, instead of 4.7k, maybe 1k or less would be better. However, since the resistance of a filament lamp increases by a factor of 10 or more from cold to hot, that 3W lamp that draws 250mA at 12V when hot, probably draws 2.5A or more when it's first turned on. So, your 4.7k base resistor may have (by clever design?) saved the transistor's life by limiting the collector current to a few hundred mA, i.e. 1mA x transistor gain.
@RalphBacon4 жыл бұрын
It is usual to overdrive a transistor when we use it as a switch, that is true, as the worst thing that could happen is that the transistor is not fully switched on (ie operating in the linear region). Toasted marshmallows, anyone? Using an incandescent bulb in this demo was precisely for visual demo purposes. In Real Life I would expect a string of LEDs , or a motor or a relay... Watch the MOSFET video when it is published for more Arduino Real Life examples!
@pekkagronfors73044 жыл бұрын
Useful and interesting, thank's.
@RalphBacon4 жыл бұрын
Glad you think so! Thanks for posting Pekka.
@FilmFactry4 жыл бұрын
Question: sometimes on a project I don't have the specific resistor or cap. But I read online, I can skip the resistor or use a different value. In practical terms, for such Arduino projects how much leway do we have in values?
@RalphBacon4 жыл бұрын
It depends on what the resistor is doing. If it is limiting current to an LED then substituting a lower resistance might overdrive the LED. Or overload the Arduino port (pin). Not good. Substituting a higher resistance value one will make the LED (a bit) dimmer. That's OK. Other circuits might be much more critical. Others more forgiving. I don't think skipping the resistor is a viable solution though. You can buy entire sets of resistors (or caps) from Banggood or other warehouses for very little money (it's what I do). That way you have more resistors (or caps) than you know what to do with! But you never run out either.
@michaeltempsch52824 жыл бұрын
In addition to kits of resistors, even if you don't have a value within the acceptable range you can often combine few of what you have in series and/or parallel to get a value close to the wanted.
@alblair34824 жыл бұрын
Thank you Ralph I assume that the arduino already has a program to blink the transistor on is that a good assumption?
@RalphBacon4 жыл бұрын
Yes, the aptly named BLINK sketch blinks the built in LED (so no further components are required) but if you want to blink your own LED you absolutely must use a current limiting resistor (rule of thumb: 180 ohms is fine).
@Ernzt84 жыл бұрын
Keep them coming!
@RalphBacon4 жыл бұрын
Will do, Ernst! Good to hear from you!
@kevinsanvictores26182 жыл бұрын
Did you program it to function as a switch or will it automatically function as a switch when plugged in?
@RalphBacon2 жыл бұрын
Any transistor acts as a switch if the Base connector is above about 0.8v (ie it becomes fully saturated). Watch the current flow, you don't need much.
@andrewtoogood14294 жыл бұрын
Hi Ralph, I thought it was impossible to amplify voltage with a Transistor, I thought they amplified current only, or is that just a limitation for PNP resistors as a switch?
@WildSccotsman4 жыл бұрын
The voltage is not amplified. In this example the voltage is switched. It is always 12V across the load the current is then controlled buy the current on the base.
@RalphBacon4 жыл бұрын
As I tried to emphasise, Andrew, any BJT transistor is a _current_ amplifier. The current flowing into the base allows a greater current to flow between collector and emitter, defined by the gain of the transistor (in this example a nominal 100 times). The voltage swing on the collector follows the current flow. But in reality we are not too bothered about this as we just ensure the transistor is switched fully on, to act as a switch.
@andrewtoogood14294 жыл бұрын
@@RalphBacon ok found the article looks like it's only an issue with PNP and different voltages "This circuit works just as well as the NPN-based switch, but there's one huge difference: to turn the load "on", the base must be low. This can cause complications, especially if the load's high voltage (VCC being 12V connecting to the emitter VE in this picture) is higher than our control input's high voltage. For example, this circuit wouldn't work if you were trying to use a 5V-operating Arduino to switch off a 12V motor. In that case, it'd be impossible to turn the switch off because VB (connecting to the control pin) would always be less than VE ." learn.sparkfun.com/tutorials/transistors/applications-i-switches
@RalphBacon4 жыл бұрын
Lucky we have (P-channel) MOSFETs then, Andrew!
@arminro36863 жыл бұрын
What is the maximum voltage you can feed to Arduino without burning it's regulator?
@RalphBacon3 жыл бұрын
I'd stick to 12v but in theory you can go higher to 15v or thereabouts. Not me though.
@arminro36863 жыл бұрын
@@RalphBacon thanks for your answer. So since both arduino and the transistor have to be connected to the same vcc and vdd, then the biggest motor we can move is a 12 volts one correct?
@RalphBacon3 жыл бұрын
If you want to use the Arduino to turn a DC motor on/off (with optional speed control) you can use any voltage because the motor voltage VCC (via the switching transistor) can be a different supply to the Arduino's. But do connect the GND connections together. I strongly recommend the use of an N-channel MOSFET transistor for this. Ensure it is a logic level (TTL) one, where it needs no more than 5v to fully switch on. I've done videos on this, scan the PDF in the video description for a suitable one.
@arminro36863 жыл бұрын
@@RalphBacon thank you very much. Liked and subbed
@newburypi4 жыл бұрын
Almost forgot to ask you a question that has been nagging me for quite a while. The bird tweetings I hear in the background of your video, are they from birds or someone's (miss used, IMO) ring tone? A pet bird, or the out-of-doors sleeping in? Just wondering :)
@RalphBacon4 жыл бұрын
You can hear those? Ears of a bat (not literally, obviously). Sometimes they really are chirping in the tree directly outside my workshop window. Other times, it's the Sleep Machine that I have permanently switched to bird song, not because I want to sleep but because I find it soothing. [Note to self: turn down sleep machine before videoing]
@pupplecoffee4 жыл бұрын
Does transistor hfe affect collector current value? Is collector current 1mA(ib) * 50(hfe) = 50mA(ic) ?
@kennmossman87014 жыл бұрын
yes, Ic = Ib x hFE where hFE is the gain at Ic
@RalphBacon4 жыл бұрын
I've replied here in another comment that shows that gain varies depending on collector current. At 500mA the gain is only 30 but at 150mA it's 100. Datasheet tells all!
@kennmossman87014 жыл бұрын
@@RalphBacon Quite so, though how to put in equation form? hFE:[Ic, Vce] = Ic / Ib? I realize you tried hard to keep it simple but aren't you opening a can of worms by mentioning higher current [[like 500mA]; now you have to consider Pd. Perhaps make it a two part video; the basic idea, and advanced [covering Vce, Ic, hFE, Vce[Sat], Pd, Vbe with the complete equation for Rb ------- OMG Math!/MathS]. BTW don't incandescent bulbs have an inrush current [which could exceed IC[peak]]? More worms!
@RalphBacon4 жыл бұрын
I see no worms, Kenn. Nope. Worm free. I mean, why complicate things? I didn't mention the changing gain in the worm-free video, I'm not that stupid! It probably never affects the average Arduinite anyway, especially as we generally whack the transistor to full saturation, the relay / bulb / LED switches on - job done!
@surenbono60634 жыл бұрын
..its like a micro relay..but isn't NPN ..you described a PPN..
@RalphBacon4 жыл бұрын
What's a PPN?
@surenbono60634 жыл бұрын
3:32 ..the collecter is a N side of the load..base P,Emitter N..when switched collector connwcts to Emitter..right?
@TuttleScott4 жыл бұрын
can the bjt be used for PWM or is that a mosfet thing?
@ristomatti4 жыл бұрын
Yes they can.
@RalphBacon4 жыл бұрын
As Ristomatti has already indicated, PWM can be used on a BJT, although MOSFETs do lend themselves to that sort of thing even better for reasons which I'll explain in the MOSFET video.
@normcaissie55984 жыл бұрын
LOL so what was the switches for?
@RalphBacon4 жыл бұрын
The switches on my workbench were to show that the transistor acts like a switch (in an Arduino environment). I think I cut out the bit where I actually join the dots on this, oh dear.
@fabiocardoso_dev_br4 жыл бұрын
Please mosfet video soon, this one was awesome, though. Thank you sir.
@RalphBacon4 жыл бұрын
Next video in this series is all about the exciting world of resistors... wake up, Fabio, they are not that boring! Ok, they are not that exciting either, but they are essential to us Arduinites! Keep tuned.
@fabiocardoso_dev_br4 жыл бұрын
@@RalphBacon I am looking forward already.
@fredflintstone14 жыл бұрын
"a rasher of Bacon if you will" Hmm Streaky or back?? :-) nice video keep them comming
@RalphBacon4 жыл бұрын
That's the plan! Keep tuned, Fred!
@newburypi4 жыл бұрын
Thumbs up!
@RalphBacon4 жыл бұрын
Thank you! Cheers! And thank you again for being my guinea pig, your comments were very useful and appreciated. I trust you got the £50 cheque I sent you. I'm almost sure I sent it. Lost in the post, you say? Oh well, that's life...
@largepimping4 жыл бұрын
Ralph, not being WELCOME BACK'd right at the start of the video is like a slap in the face. How rude. This is worse than if Great Scott was to fail to tell me to stay creative.
@RalphBacon4 жыл бұрын
Different video series! I deliberately made it different (you get the same intro on each video in this series) so as not to confuse these with my "regular" videos. Sorry you felt offended, not intentional. Good to see you hear, though.
@largepimping4 жыл бұрын
@@RalphBacon You knew I was only joking, right? Yeah, you HAD to have known... There's no way you didn't know... DAMNIT I WAS ONLY KIDDING!!!
@woodworking38154 жыл бұрын
Instead of searching datasheets for pinouts, I recommend a cheap component tester like this: kzbin.info/www/bejne/bXPVZH9nd51jpdk
@RalphBacon4 жыл бұрын
Yes, I have one of those. But in many ways, learning how to look stuff up in a datasheet is a skill that would behoove many who do this hobby. You can quickly learn to pick out the salient points (there's a ton of stuff I skip) and you can learn _so much_ whilst just idly glancing at the pdf. What?!? Maximum collector voltage 15v? Who knew?
@stevrgrs Жыл бұрын
The birds are lovely but VERY distracting :)
@RalphBacon Жыл бұрын
Sorry about that! I no longer live there so far fewer 🐧birds here to distract you (or me)!