[solved] 12V halogen light dimmer

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have searched and tried for a while now, but have several questions about the circuit.

My test-program on the ATmega8 looks like that:

int main()
{
  DDRD = 0xFF;
  while(1)
  {
    PORTD = ~PIND;
    _delay_ms(1000);
  }
}

and should turn the halogen-light on and off every second. The idea is: After it works like this I am going to expand the software and start using Timers and PWN.
I am using a computers power supply to connect my circuit (5V) and the halogenlamp (12V). I was told to use a IRLZ34N MOSFET to control the 12V-Line using a 5V-Signal. Try and error did not help me finding a solution and many google-searches didn't either. The circuit looks like this:

12V+      ------->    LAMP(IN)
LAMP(OUT) ------->    MOSFET(DRAIN)
12V-      ------->    MOSFET(SOURCE)
PORT[D0]  ------->    MOSFET(GATE)

My questions are:

- Why does the MOSFET get so hot? What does this have to do with the gate?
- Is there an easier way to realize this? Costs does not matter, because I just need this circuit once.

Last Edited: Sat. Sep 4, 2010 - 03:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A couple of possible things to check.
First of all, you say you're using a power supply from an old computer. Take a voltmeter, and measure the voltage between the 12V+ and 12V- terminals. I suspect you'll read 24 volts instead of 12 volts. You probably need to move the Source terminal of the MOSFET to the power supply ground, not the 12V- terminal.
Second, check the voltage between the MOSFET drain and the MCU ground. They should be at the same voltage. If not, either move the MOSFET source terminal as above, or else you'll have to redesign your interface circuit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Assuming a 50W halogen lamp, it will have a running current of about 4A. It will probably have an inrush current of up to 40A.

You need to read the data sheet for your particular lamp.

I would expect your on voltage Vds to be about 0.2V @ 4A. And around 1.0V @ 40A. So the TO220 case will be warm to the touch if you have no heatsink.

Measure the Vds of your particular IRLZ34N with a DMM.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unless you are using a logic level mosfet, it won't go 'fully open' at 5V gate drive, so it's Rds will be a lot higher than the RdsON specified. So it'll dissipate more power -> gets hot.

So either get a logic level mosfet, or use a second small fet to drive the gate high (as in over 10V high)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The IRLZ34N is a logic level mosfet, so 5V seem to be enough. In my understanding logic level gates can only have two conditions: open and close, not something in between, like non-logic-level-mosfets/transistors have.

Thanks for the tip to check the lamps datasheet- I never thought lamps even had datasheets. But that brings me to the question: where do i get it? on the lamp I have a description "BAB/C 12V 20W"- is the only text on it. looking for a "BAB/C"-pdf using google wasn't successful.

I also checked the connection of the power supply with a voltmeter. Curiously it turned out, that it only delivers 10Volts... Why is that?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why ~pind

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You obviously know where the halogen lamp came from. e.g. electrical wholesaler, garage or wherever.

So go to the appropriate website and find a lamp that matches yours. I would start with the big-name lamp manufacturers.

At least we know that it is a 20W lamp.
If your power supply is only delivering 10V, then it is possibly not man enough for the job. The 20W lamp will draw 1.7A when warmed up. The inrush current will be possibly 17A. Your power supply will probably shut down at that current.

PC power supplies can do a lot of current @ 3.3V or @ 5V. The -12V o/p's are generally rated far lower current. The +12V o/p will possibly be rated for a reasonable current.

The obvious question is: How come this power supply is not inside a PC?

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the powersupply i use has been superseded by a new atx-model :-)
connecting the halogenlamp directly with it works as expected and the halogenlamp seems to be constantly normally bright. My IRLZ34N-Mosfet can handle up to 30A@10V current and 110A pulsed current, but if the temperature raises above 100°C only 21A@10V are possible... but I hope, that it isn't mandatory to operate at this temperature ;-)
I am going to recheck all connectors of the powersupply and try to find one, which brings me the 12V I need.

@Bingo600: you fool? it's a binary NOT operation- so all bits on PORTD get inverted and the lamp turns on and off, on and off, ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

_Maya_ wrote:
The IRLZ34N is a logic level mosfet, so 5V seem to be enough. In my understanding logic level gates can only have two conditions: open and close, not something in between, like non-logic-level-mosfets/transistors have.

That is a misconception. Logic-level MOSFETs have an analogue area like normal MOSFETs, the only difference is that a logic level MOSFET is supposed to be fully 'open' at a lower, logic-compatible voltage.

Did you study the data sheet of the IRLZ34N ?

If it gets hot I suspect a problem with how you drive it. Does it get hot too when you connect the gate to 12V instead to the port pin ?

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Markus has suggested, just try switching manually via the MOSFET. You can monitor current and voltage on the Drain. Both with the Gate at 0V and at 5V.

Feel the temperature. Do you have any heatsink?
It looks as if your TO220 is about 64 degrees/watt. So it will be hot to the touch without a heatsink.

And the obvious question: Are you using +12V and GND?

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the datasheet the IRLZ34N has a RDSon of 0.06 Ohm at a Vgs of 4V. For our 1.7 Amps we get 0.2W, it will get somewhat warm, but not hot.

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much. I got it working. The powersupply really was my problem. I now had the chance to exchange it, tried and it really works! :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go to the CD store and get The Inner Mounting Flame by The Mahavishnu Orchestra and dig The Dance Of The Maya. John Magaughlin jazzrock fusion. Early 70s. Listen while programming AVRs so that we stay on topic.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Love John McLaughlin, Paco DeLucia, and Al Di Meola. Best AVR programming music, ever! Who needs performance enhancing substances when you music like that around?

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net