MOSFETs and Transis...
 
Notifications
Clear all

MOSFETs and Transistors with Arduino

18 Posts
9 Users
3 Likes
3,379 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1081
Topic starter  

Today we will learn how to use Transistors and MOSFETs to enable our Arduino to switch high-current DC loads, including a 12-volt RGB LED Strip Light.

Article at https://dbot.ws/bjtmosfet

Transistors are the basic building block of modern electronics. Just about everything uses transistors, including the Arduino itself.

Using a power transistor or MOSFET we can drive high-current devices using the logic-level outputs from our Arduino. Today we’ll learn to use both devices.

We will start with a simple transistor switch, you’ll see how easy it is to switch a high-current DC lamp using a popular power transistor.

Inductive loads like motors and relays present an additional challenge, as these devices generate a “back-EMF” that we need to deal with. We’ll use a diode to take care of the back-EMF and build a simple motor speed controller.

We will then turn our focus to MOSFETs. MOSFETs have a number of advantages over standard transistors. We will learn how to use popular MOSFET modules to control an RGB LED Strip in a simple but colorful experiment.

Here is what is in today's video:

00:00 - Introduction
02:49 - Transistors and MOSFETs
16:23 - Transistor Switching Demo
22:54 - Transistor Motor Control
29:52 - MOSFET RGB LED Strip Light Control

Please note that transistors and MOSFETs are great for controlling DC loads, but not AC. I’ll be showing you how to control AC loads in a future video.

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Centari and Duce robot reacted
Quote
Duce robot
(@duce-robot)
Member
Joined: 5 years ago
Posts: 680
 

Awesome video ! Can't say enough about how much I learn from this channel!     😁👍


   
Centari reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

I tried to download the pdf on the blog but it failed. Maybe the URL has changed?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
 Biny
(@binaryrhyme)
Member
Joined: 2 years ago
Posts: 269
 

@ronalex4203 For me, the "dbot.ws" domain used to do a lot of the link redirects seems to be down. Sometimes you can just substitute in "dronebotworkshop.com" for the "dbot.ws" - as it seems to be an domain alias, but in this case, that didn't get me anywhere either.

Tagging @dronebot-workshop on this, just in case this is a new thing.

I edit my posts to fix typos, correct grammar, or improve clarity. On-screen keyboards are evil.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@binaryrhyme I knew about that and tried it, but it still comes up not found BUT that msg is on a the blog home page not a browser error so it's just the after the / error. The link might be a is a shortened link. This is the part that now fails. /2QnDxgG

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

Never mind, the pdf link at the bottom of the page works, it's only the button at the top that fails.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@ronalex4203 

Maybe this is the document you're looking for ?

https://s3.amazonaws.com/download.dronebotworkshop.com/DBWS+-+Arduino+High-Current+Interfacing+–+Transistors+%26+MOSFETs.pdf

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@will Yep, that looks like the link in the Resourcesw section at the bottom of the page, I tried the button at the top of the page before I found the resources section. I got it, hopefully Bill sees the convo so he can fix.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@boggiano)
Member
Joined: 3 years ago
Posts: 17
 

Hello,

I am quite a bit confused.

I tried a MOSFET IRFZ44N as switch.

From the DS, watching the front of it I see the pinout as:

1- GATE
2- DRAIN
3- SOURCE

So, I connect A 203 POT to the gate, DRAIN to GND, as SOURCE to 330 ohm res, a LED and 5V.

As soon as I connect the MOSFET the LED turns on (OK!) but if I unplug the GATE the LED stills ON!

I unplugged the the GATE and all my MOSFETS work in the same way: the LED stays ON.

It should be an N-channel enhancement MOSFET so it should stay "normally off" until a Voltage at the GATE., does it?

 

Thanks!

 

 


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1081
Topic starter  
Posted by: @binaryrhyme

For me, the "dbot.ws" domain used to do a lot of the link redirects seems to be down. Sometimes you can just substitute in "dronebotworkshop.com" for the "dbot.ws" - as it seems to be an domain alias, but in this case, that didn't get me anywhere either.

That was a domain name that I used to own, and I used it for a link shortener. However, the link shortener stopped working, so I cancelled the domain last year.

I THOUGHT I had edited all the links back to the correct value, but obviously I missed a few - there were literally hundreds of them on the website and on YouTube. I'll have to do a sweep of the website and correct the ones that are still using dbot.ws.

Substituting dronebotworkshop.com for dbot.ws really shouldn't work, except in a few cases where I happened to use the same slug for both the URL and the link shortener.

Thanks for bringing it to my attention!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@boggiano If I am understanding, an N channel MOSFET has the Source at Ground, the Drain connected to the NEGATIVE side of the load and the Gate a positive voltage to turn on the device. When the device turns on, the load negative side (Drain) is connected to the Source which is ground, thus completing the circuit.

BTW, you are posting on Bill's video topic, you should really start your own topics for new things to discuss.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
JS
 JS
(@js)
Member
Joined: 2 years ago
Posts: 24
 

@boggiano You may want to try a basic transistor to switch low current like a relay or LED..

Check out the link below.

    https://electronics.stackexchange.com/questions/403042/how-can-i-use-a-transistor-2n2222-to-act-as-a-switch-with-this-12v-momentary-s

J.S.

John Spear


   
ReplyQuote
(@boggiano)
Member
Joined: 3 years ago
Posts: 17
 

@js Thank you for the article.

I have already used BJT in order to have a switch for relay and motor.

This is the first time I tried yo use a MOSFET and I tried the first one I had in my drawer and I made a mess! 🤣  Wrong pinout ad, worst, wrong Vgs, so I had latch-up, too!
But I am learning from errors (I hope! 😀 )


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6968
 

@boggiano Remember if it's an N chan MOSFET then the Source goes to ground, Drain goes to load -ve and when you give the gate some +ve volts (5?) the MOSFET will conduct.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@boggiano)
Member
Joined: 3 years ago
Posts: 17
 

@zander thanks and sorry for the thread hijacking.

 


   
ReplyQuote
Page 1 / 2