5v regulator for mcu, newbie question

Thread Starter

bug13

Joined Feb 13, 2012
2,002
it's a newbie question as I only study electronics and massing around with MCU for about 3 months

So I want to build a 5v regulated supply for my MCU, so I don't need to keep power it from battery when I learning

the chip I use is MC7805BTG
10uF 50V as input capacitor
330uF 25V as output capacitor
Green LED in series with a 1kΩ resistor as power on indicator
no heatsink

input: 18v 1.1A from an old printer adptor

after toasted 3 mc7806btg and 1 MCU (maybe some other component as well), I found out the regulator is too hot to touch only driving 5 leds (about 10mA per LED), while driving 4 LED is very warm

so what's have I done wrong? as I expect the regulator can handle 100mA to 200mA easily without heatsink

and it can provide 500mA and above with heatsink
 

tracecom

Joined Apr 16, 2010
3,944
It's probably wired wrong. It's easy to get confused about the input and output leads of the regulator. The regulator also needs a .33μF cap on the input and a .1μF on the output. What is your output voltage? Can you post your schematic? Are you sure the input is DC?

The way I build 78xx circuits is show on the attached schematic.
 

Attachments

Last edited:

Markd77

Joined Sep 7, 2009
2,806
It's got thermal protection as well, so it shouldn't be damaging components on the output side if wired correctly.
It's worth bearing in mind that for a given output current, the regulator will waste more power and be hotter with 18V input than it would with a lower voltage.
At 18V input and 100mA output the regulator is using (18-5)*0.1=1.3W which is enough to make it pretty hot.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
My schematic same as yours except no diode, using 10uF as input cap, and 330uF as output cap, and what's is the reason for you to put two different type of cap at the input and output?

I tested the no load output is 5.04v, it can rule out the wiring as I tested the no load voltage, and at no load the ic is chill.

Will up load the schematic later today when I get home
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
So how do I choose a heatsink if I want it handle 600mA? Or should I be better off finding a lower input and forget about the heatsink?

It's got thermal protection as well, so it shouldn't be damaging components on the output side if wired correctly.
It's worth bearing in mind that for a given output current, the regulator will waste more power and be hotter with 18V input than it would with a lower voltage.
At 18V input and 100mA output the regulator is using (18-5)*0.1=1.3W which is enough to make it pretty hot.
 

Markd77

Joined Sep 7, 2009
2,806
At 600mA it would be 7.8W
Heatsinks have a Celcius/Watt rating so for a 10 C/W heatsink it would get 78 Celcius above ambient temperature.
With a 12V input and the same heatsink it would be around 40 Celcius above ambient.
With 9V input, only about 25 C above.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Thanks, now I know why it heating up and how to solve it.

So there is another problem with my power supply, it seen to reset my MCU every a few seconds, is it because of the regulator ic over heated?

At 600mA it would be 7.8W
Heatsinks have a Celcius/Watt rating so for a 10 C/W heatsink it would get 78 Celcius above ambient temperature.
With a 12V input and the same heatsink it would be around 40 Celcius above ambient.
With 9V input, only about 25 C above.
 

Markd77

Joined Sep 7, 2009
2,806
Probably just the overheating. The regulator has a bit of circuitry that shuts it down when it gets too hot, when it's cooled a bit it will turn back on.
 

SgtWookie

Joined Jul 17, 2007
22,230
You really should have the 0.33uF cap on the input and 0.1uF cap on the output of the regulator, as close to the regulator itself as possible. These 78xx and 79xx regulators are prone to oscillations; having those caps in place will ensure that they won't. Omit them at your own risk.

You may have forgotten to disable the watchdog timer, and also have not included code for resetting the watchdog timer countdown. This will cause your MCU to continually reset.

You should post at least your initialization code. Use the "#" icon to wrap CODE tags around your source code to preserve the formatting.
 

t06afre

Joined May 11, 2009
5,934
If you only want 5 volt. Many cell phone chargers output 5 volt and quite a lot current despite the size around 1 ampere. Just a tip :)
 

MrChips

Joined Oct 2, 2009
30,802
I frequent the second hand stores and buy out the wall warts that have suitable outputs, 5v, 7.5-9V, 12v.

When using 7805 regulators I try to keep the DC supply around 7.5-8.5V to keep the power dissipation down.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
You really should have the 0.33uF cap on the input and 0.1uF cap on the output of the regulator, as close to the regulator itself as possible. These 78xx and 79xx regulators are prone to oscillations; having those caps in place will ensure that they won't. Omit them at your own risk.
I thought have bigger value caps are better in this kind of circuit, so I MUST have 0.33uF on the input and 0.1uF on the output?

You may have forgotten to disable the watchdog timer, and also have not included code for resetting the watchdog timer countdown. This will cause your MCU to continually reset.

You should post at least your initialization code. Use the "#" icon to wrap CODE tags around your source code to preserve the formatting.
at this stage, I just learning timer and interrupt, don't know how to use a timer yet, but my code run as expected when connect to batter, so I assume it's something wrong with my 5v regulated power supply

The MCU I am using is AVR AT90S8515

Rich (BB code):
void init_io(void)
{
	LEDDDR |= _BV(LEDPIN_1);  // set define led pin as output
	LEDDDR |= _BV(LEDPIN_2);
	LEDPORT &= ~_BV(LEDPIN_1);  // set led pin low, turn led on
	LEDPORT &= ~_BV(LEDPIN_2);

	_delay_ms(3000);

	//setup 16 bits timer hardware
	TCCR1B |= (_BV(CS11)|_BV(CS10)); //setup timer at CUP/64
	TCNT1 = PRELOAD_VALUE; // Preload timer with precalculated value 
	
	TIMSK |= _BV(TOIE1); //enable overflow interrupt
	sei(); // enable global interrupt
}
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
thanks, that's actually some very good ideas:)

I frequent the second hand stores and buy out the wall warts that have suitable outputs, 5v, 7.5-9V, 12v.

When using 7805 regulators I try to keep the DC supply around 7.5-8.5V to keep the power dissipation down.
If you only want 5 volt. Many cell phone chargers output 5 volt and quite a lot current despite the size around 1 ampere. Just a tip :)
 
Top