Attiny 44 PWM power transistor overheated

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

Hi

I have some issues with my PWM project.
The uC is Attiny44 internal timer 1Mhz (timer1) in fast PWM mode 14. Timer 1 is running at 20Khz.
The problem is that the waves aren't perfect! my transistors are overheated. The transistor drives 120W bulb at 12V.

Here is the code:

#include  
#include  

// First switch
#define P_sw_on   PINA & (1<<3) 
#define P_sw_off   ~PINA & (1<<3)

// second switch
#define M_sw_on   PINA & (1<<1) 
#define M_sw_off   ~PINA & (1<<1)
 
volatile unsigned char dt=0; 
volatile unsigned char dt1=0;

volatile unsigned char deb_on=0;
volatile unsigned char deb_on1=0;

ISR(TIM0_OVF_vect) 
{ 
static unsigned char CountTime = 0; 
static unsigned char DebounceTime = 0; 

   TCNT0 += 6; // Adjust count so we get 250 uS rollover period 
    
	if (++CountTime == 5) // 13.3ms
	{
	CountTime=0;
	deb_on=1;

	if (++DebounceTime == 200) // 533ms
	{
	DebounceTime=0;
	dt=1;
	}
	
	}

} // end intrerupt

// ^***********************************************

// main 
   int main (void) 
{ 
// set port direction 
DDRA |= (0 << 3); // input 
 DDRA |= (0 << 1); // input 

// Setup Timer 0 
 TCCR0B |= (1 << CS01); // 8 divider 
 TIMSK0 |= (1 << TOIE0);      // Timer 0 Interrupt 
 TCNT0 = 0;            // Initial value 

// setup timer 1
TCCR1A  = ((1<<WGM11)| (1 << COM1A1)) ;
TCCR1B  = ((1<<WGM13) | (1<<WGM12) | (1<<CS10) );

// Enable interrupts as needed
 ICR1  = 49; // 20Khz
OCR1A = 0;
 	
sei(); //  Enable global interrupts 

	 for (;;) 
   {

cli();
dt1=dt;
deb_on1=deb_on;
sei();

  if (M_sw_on)
   {
 OCR1A=25; //50%
DDRA |= (1 << 6); // output on
   }
else
{
 OCR1A=0; //0%
   DDRA &= ~(1<<6); // output  off
}

   }// end for
}// end main



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

What are

Quote:
120W bulb at 12V.

Huge LEDs? incandescence, tungstene lamps -their resistance might be low when they are cold-?

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

actually are 2 bulbs 60W bulbs, not LEDS. i've try to attached 2 power transistors with heatsink but still got hot.
if i lower the frequency(200hz) than the transistors are cold! only at 20Khz are getting hot.
I've forgot to attach the schematic...
In the schematic i've put other transistor because for IRF5210 i haven't found the library.

http://www.irf.com/product-info/datasheets/data/irf5210.pdf

Attachment(s): 

Last Edited: Tue. Aug 14, 2012 - 01:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Assuming your PWM is working as intended I'd be more interested in knowing which transistor you used and how you connected it? (Schematic)

And does it have a heat-sink?
At what voltage are you running the tiny?

EDIT: I see you answered my questions! ;)

- Brian

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

5V i have on tiny.
the heatsink is L:35mm; W:40mm; H:15mm.

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

Your drive circuit is inadequate for turning the mosfet on and off fast. Use a high side mosfet driver chip.

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

so you recommend to replace the IRLZ24N with something like this IR2184

http://www.tme.eu/en/Document/42c14db04877b797c9b79796a146c92c/ir2184.pdf

do you have other side drivers which could drive a P channel mosfet and have logic level input?

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

Quote:
if i lower the frequency(200hz) than the transistors are cold! only at 20Khz are getting hot.
That explains what happens here.
At 20 kHz the input capacitance of IRF5210 is not charget/uncharged quickly enough through R7 and R9.

I do not see why not to use 200 Hz here.
If you insist on 20 kHz you will have to use some mosfet driver (IC), or at least two transistors in push-pull.
http://reibot.org/2011/09/06/a-b...
http://www.diodes.com/_files/des...

PS
Replacing the mosfet will not help.

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

I would also consider the IR21844. The IR2104 is also still available.

Cheers,

Ross

Ross McKenzie, Melbourne Australia

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

for IR2104 i really need 2 transistor? (second schematic)

@Visovian something like this will work?

Attachment(s): 

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

I would put an ohmmeter across your bulb(s) and measure the resistance. You will find that it is nearly a short. When driving the bulb with 12V, the bulb element will not heat up very much and the resistance will still be very low. You are essentially trying to drive a short circuit with your switches.

If you are going to attempt to drive a bulb in this manner, you will need to add some impedance in between your switches and the load (inductive or resistive). If you use an inductor as your impedance, make sure you provide a flyback path.

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

Use lower frequency and you need not change the schematic.

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

IRF5210
Gate capacitance = 2700pf

You are probably operating in the linear range due to the slew rate at the gate.

Mike Adams
ADI Development, Inc.
http://www.adidev.com

... When it has to actually work.

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

adamopel wrote:
for IR2104 i really need 2 transistor? (second schematic)
Adam,
Each of the IR2104, IR2184 and IR21844 are half bridge high side drivers. If you are controlling a lamp, you do not need to reverse the polarity like you might if controlling a motor. Your second circuit is for reversing the polarity.

Cheers,

Ross

Ross McKenzie, Melbourne Australia

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

Unless acoustic noise is a problem, I'd stick with 200Hz too.

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

Thanks, i will stick with IR2104.
can i use the same voltage(12V supply) for VCC(pin1), VB (pin8) and still drive at logic level(5V direct from uC output)? or i should connect 5V to VCC, 12V to VB?

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

Adam,

Here is an example where the IR2104 is used with a 12 volt supply (a solar panel) and controlled from a 5 volt Arduino signal. Note the charge pump configuration for pin 8.

Cheers,

Ross

Attachment(s): 

Ross McKenzie, Melbourne Australia

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

thanks!

Attachment(s): 

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

Hi,

I've made the schematic and it worked with 10W test bulb, after that i've attached a 120W bulb and the IR2104 had burned ..... the only difference from the schematic is R7 = 10 ohm. Should this take out the IR2104?

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

Once again, put an ohmmeter across your 120W bulb, and let us know what you read. Then, calculate your peak current (Ipk = 12V/bulb resistance). Is this within the rating of your driver ?

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

Hm. I have a light bulb here. I measure 92.7 Ohm resistance. It's marked 40W, 230V. Very strange ;-).

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

230**2/92 == 500 w
As cold filaments have a lower resistance than hot filaments (positive temperature coefficient), and as filaments need to be very hot to emit some light, it is not that stange (but they need 2 Amperes to start... as they are cold, then)

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

my bulbs are around 0.4 ohm(0.7ohm each).
Only the thing is why the IR2104 had died and not the 2 Final drivers? For a few second it worked and after that was out of service :( i think i've made a mistake or something because i don't understand why ....

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

Could VS (Pin6) cause the problem? i mean the ground coming via bulbs?

should put a current limiting resistor?