Loading...
Pages: [1] 2   Go Down
Author Topic: PWM to MOSFET  (Read 648 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey everyone

Im new and this is my first post, I am just getting started in the World of Arduino. 

I want to control and dim a light 12v lamp through a MOSFET, I have followed instructions on this website and everything works fine if I try it with 5V and LED.

http://bildr.org/2012/03/rfp30n06le-arduino/

The programming works and is managing to dim the LED but when I try with the 12V power source and the lamp, the lamp just turns on and doesnt do turn off or DIM.
Im using a n-channel UTC UF630L
my circuit is as shown on the website Link


Any ideas
Marius
Logged

Offline Offline
Jr. Member
**
Karma: 4
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One problem that I can see right off the bat is that the mosfet that you're using is meant to be switched on/off with 10v.  What you want for controlling devices via the arduino directly is a logic level mosfet like this one:

https://www.sparkfun.com/products/10213

An easy way to tell which type you're looking at is to check the datasheet and find rDS(on).  They generally tell you what voltage they used to get those numbers, and it's a good indication of what voltage you should be using to switch it on/off.

That being said, what type of lamp are you trying to dim?  Not all types are meant to be dimmed using PWM.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, thanks for the quick reply

I thought about the logic level mosfet too (I couldnt find the specific datasheet for my mosfet, but a similiar one indicates what you said with the 10v).

But why is it working with the LED then? Nevertheless I will buy myself a new correct mosfet.

The lamp is a normal 12V halogen lamp 20W gu5.3
like in this link

http://www.conrad.de/ce/de/product/570807/Halogen-Kaltlichtspiegellampe-Halogen-GU53-20-W-Transparent-Reflektor-4000-h

Logged

texas
Offline Offline
God Member
*****
Karma: 26
Posts: 841
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't much care for the 10k resistor to ground on the gate.  That seems awfully small for a pull-down that shouldn't really need to be there at all.  I'd try it without that resistor and then, if you really need it, change it to 100K.
Logged

Experience, it's what you get when you were expecting something else.

0
Offline Offline
Tesla Member
***
Karma: 73
Posts: 6638
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, thanks for the quick reply

I thought about the logic level mosfet too (I couldnt find the specific datasheet for my mosfet, but a similiar one indicates what you said with the 10v).

But why is it working with the LED then? Nevertheless I will buy myself a new correct mosfet.


Its working with the LED because that's a low current load - the MOSFET only has to be less than a few 1000 ohms to
light up an LED convincingly.  To turn on a 12V bulb (which might take an amp) requires it to drop to a fraction of an
ohm (its rated as 0.4 ohms with 10V gate drive, which would work, but its not very good).

High voltage MOSFETs have much higher on-resistances than low-voltage ones, for instance this one is 200V and 0.4 ohm, whereas a
beefy 30V MOSFET might be anywhere from 0.02 to 0.002 ohms these days.  If you want to switch 12V, use a MOSFET with
a rating in the 30 to 50V range, logic level and expect the on-resistance to be somewhere around 0.02 ohms.

In fact work out the current you need to switch and use I-squared-R to calculate how much power a possible MOSFET
will dissipate - this will help you choose the right device and decide if a heat-sink is needed.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Allright,

 with the new MOSFET I do notice a change when I set the PWM pin to 0 and 255, but as it turns of the LED it doesn not do so with the 12v halogen lamp, it just dimms it a little, what do I have to change to have the full effect of the halogen lamp ranging from turned off sate at PWM 0 and fully on at 255. The new MOSFET fits the discription from MARKT its a 55V MOSFET with logic level. Rds on is 0.035ohms. What am I not understanding right?

http://www.conrad.de/ce/de/product/162873/MOSFET-International-Rectifier-IRLZ34NPBF-HEXFET-Gehaeuseart-TO-220-ID-27-A-UDS-55-V

Under "Datenblatt" you can download the specifications.
« Last Edit: February 14, 2013, 11:35:46 am by motomoto2 » Logged

Canada
Offline Offline
Sr. Member
****
Karma: 3
Posts: 391
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure your Arduino ground is connected to the ground (-) side of the light's power supply?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, just like in the link i posted with the schematic
Logged

Canada
Offline Offline
Sr. Member
****
Karma: 3
Posts: 391
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, it should work then.

Do you mind showing a picture of your circuit and your code?

Edit:  BTW, the written description at that first link is misleading.  It says "Ground is connected to the transistor’s drain."  Which might lead you to think the drain of the MOFET is connected to ground.  This is not true.  The source of the MOSFET needs to be connected to ground and the load between 12V and the drain of the MOSFET.
« Last Edit: February 14, 2013, 02:38:54 pm by BillO » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

heres the image in the attachment, as i said, the 12v halogen lamp shows a little difference in brightness but doesnt go near turning off
« Last Edit: February 14, 2013, 03:02:45 pm by motomoto2 » Logged

Canada
Offline Offline
Sr. Member
****
Karma: 3
Posts: 391
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Image didn't up load.
Logged

Offline Offline
Jr. Member
**
Karma: 4
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it just the funny angle, or do you have the breadboard's gnd connected to the arduino's aref?
« Last Edit: February 14, 2013, 04:29:07 pm by JoshD » Logged

Canada
Offline Offline
Sr. Member
****
Karma: 3
Posts: 391
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Counting up on that header it seems to be connected to ground.  The angle is a bit funny.

Well, I'm at a loss.  That should be working.

What about your code?  Maybe a typo there?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is the code, with the LED 5v it works, and like I said I achieve a little difference, but the lamp is supposed to turn off completly which it doesnt do

/

int halogen = 9;           
int brightness = 0;   


void setup()  {

  pinMode(halogen, OUTPUT);
}


void loop()  {
 
  int brightness = 0;
  analogWrite(halogen, brightness);   
  delay(1000);
  brightness = 255;
  analogWrite(halogen, brightness);   
  delay(1000);                           
}
Logged

Windy City
Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This might be a silly question, but are you sure the 12V is DC?

Do you have access to a scope or a DVM?  You could check the signal going into the gate to see if the it is actually 0v when you execute analogWrite(0).

Looks like it should work unless something weird is happening.
Logged

Dirt Biker

Pages: [1] 2   Go Up
Print
 
Jump to: