5v regulator for mcu, newbie question

Discussion in 'Embedded Systems and Microcontrollers' started by bug13, May 11, 2012.

  1. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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
     
  2. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    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.
     
    Last edited: May 11, 2012
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    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.
     
    bug13 likes this.
  4. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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
     
  5. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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?

     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    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.
     
    bug13 likes this.
  7. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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?

     
  8. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    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.
     
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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 :)
     
    bug13 likes this.
  11. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    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.
     
    bug13 likes this.
  12. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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?

    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

    Code ( (Unknown Language)):
    1. void init_io(void)
    2. {
    3.     LEDDDR |= _BV(LEDPIN_1);  // set define led pin as output
    4.     LEDDDR |= _BV(LEDPIN_2);
    5.     LEDPORT &= ~_BV(LEDPIN_1);  // set led pin low, turn led on
    6.     LEDPORT &= ~_BV(LEDPIN_2);
    7.  
    8.     _delay_ms(3000);
    9.  
    10.     //setup 16 bits timer hardware
    11.     TCCR1B |= (_BV(CS11)|_BV(CS10)); //setup timer at CUP/64
    12.     TCNT1 = PRELOAD_VALUE; // Preload timer with precalculated value
    13.    
    14.     TIMSK |= _BV(TOIE1); //enable overflow interrupt
    15.     sei(); // enable global interrupt
    16. }
     
  13. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    thanks, that's actually some very good ideas:)

     
Loading...