Decoupling capacitors are a must on nearly every electric part you use. Specifically it is a big must for three things: microcontrollers, LDO linear regulators and drivers. I have seen many designs where students spend many hours debugging because they did not have enough decoupling in their circuits. I will further talk about why it's necessary and how to do it.
First of all, the problem with drivers. Wires have inductance and this inductance prevents fast change of current. That means that whenever an electronic part requires a change in current consumption there will be a voltage drop close to the part.
As an example, let's use MOSFET drivers. MOSFETs are controlled by charge, and they really like to be fully on or fully off, which means MOSFET drivers are able to push/pull a lot of current very quickly. Let's use an example of 60ns to drive 60 nc. This would require an current of 1A, and about 2A of peak current, in 60 nanoseconds. This time is incredibly short and you would not be able to pull that much charge at the speed needed unless you put a decoupling capacitors close by. This would result in slower charging time, longer time through active region and more heating.
Second of all, the problem with microcontrollers. Microprocessors work at really fast speeds [4MHz+]. At these speeds if you change the load significantly it changes the current draw significantly. As such the voltage dips momentarily. This dip in voltage will cause bit flips in sensitive registers and latches. These bit flips will reduce stability of the chip and might prevent debugging of the part or it might not work at higher frequencies at all.
Lastly, voltage regulators. In a vast majority of linear regulators there exists a feedback loop based upon the output voltage of the regulator. These feedback loops almost universally require an output capacitor to become stable. Without the capacitors you will have problems with voltage regulators. The most likely effect would be voltage drooping as the current increases. In addition, the output voltage will be unstable with a bigger then expected voltage ripple.
So what do you do about it? Firs and most importantly, read the datasheet. Almost universally they list their requirements for voltage decoupling. As a rule of thumb it's 0.1 uF ceramic capacitors as close to VCC/GND pin as possible. However, some parts require 1 uF ceramic capacitors. Now, note that the fact that you need ceramic capacitors is crucial. The reason for that is because we are trying to protect against high frequency noise, and ceramic capacitors have an order of magnitude less ESR[equivalent series resistance] then electrolytic capacitors. Lastly, make sure to place them as close to pins as possible. In addition, make sure they are on the same layer as the chip [unless the data sheet says otherwise, which is sometimes the case with BGA chips].
George Karavaev and Alex Suchko (12-12-11)
Advanced Switching Power Supplies
So you want to build a switching power supply. First of all you want to ask yourself if you really want to do that. We would highly recommend that it is your sole board. There is a lot you can do with testing [current ripple, voltage ripple, efficiency calculation, heating calculations, points of failure], but you have to be careful since they are sometimes finicky. Thus we recommend that you put it together early in the semester in case you need to debug it.
Still want to build an awesome switching power supply? First of all you need to decide if you are going up voltage[Boost], down voltage[Buck] or both[Buck-Boost]. The easiest to build and debug is a step-down buck regulator, while the both directions [Buck-Boost] is the hardest.
First decision would be to consider what are requirements for voltage ripple, load output, heating solution, and voltage droop. You should carefully look over what you are powering and consider what to do for your design. For example, at low currents you might just want to use a linear regulator. Then as you increase the current you will need to consider using a higher efficiency parts which utilize synchronous rectification and low Rds(on) with external nMOSFETs.
Speaking of external vs internal switches. Internal switches are only recommended for lower load output currents since it is harder to cool down chips as opposed to MOSFETs. The huge benefit of course of internal switches is that you have much less parts to worry about, much less area used and cheaper cost. As for external switches, they are usually more efficient, significantly easier to cool [TO-220 heatsinks are plenty] but require more space.
Second decision would be to search for controllers/regulators which suit your needs. ON Semiconductors has my recommendations, as does TI, linear technologies and analog devices. I highly recommend you search for newer parts as they are usually more efficient and more reliable.
Third action would be to review the datasheet carefully. You want to make sure that you can implement the circuit. Pay careful attention to feedback compensation, output AND input capacitors, current limit [you want to watch out for ripple and account for 40% higher limit], soft start and inductor field collapsing. Calculate heating across all parts, you'd be surprised how much parts will heat up. Also, add a debugging LED across your input voltage and output voltage -- that really helps for debugging!
Fourth, build a schematic and verify your design. Put an I2C temperature sensor onboard if you can, they are cheap, easy to mount and extremely useful [Look at TMP100 from TI]. If the manufacturer supplies a program to test your circuit then do so. Otherwise you and your partner should go over the circuit and understand how each part works. Double check your calculations for feedback compensation, as your voltage will not be good without proper compensation. Make sure you have suitable filtering on output AND input! Input capacitors are just as important as output capacitors for switching regulators. Make sure that all parts which are high frequency are not pointing at each other or microprocessors. Also, your inductor will radiate strongly. Attempt to get a shielded inductor and leave some space around the inductor.
As a personal advice, you should put a current sensor in your circuit. Please look at current measurement section in power, it describes how to do so reliably. In addition I recommend to put an enable line in your circuit. This could be accomplished by a high level switch [an nfet driving a pfet], or a high side mosfet driver driving an nfet.
Fifth, order the boards and all the parts. Solder together your circuit [watch out for ESD!]. Verify that it works.
Lastly, use an oscilloscope to verify correct operation. You MUST look at your voltage ripple with an oscilloscope[as opposed to a multimeter], and verify the voltage droop at all current levels. Load your power supply at 10% over rated current and verify until you have constant temperature. If you get too hot then put a heatsink or fan across chip/mosfets. Record all your findings, take screenshots of all oscilloscope screens.
George Karavaev and Alex Suchko (12-12-11)
Measuring current is extremely important for many aspects. In this section I will describe how to measure current effectively and accurately. There are two major ways to measure current: a shunt resistor and a hall effect current sensor.
Shunt resistor Generally you will have a small [1-100 milliohms] accurate [+-1%] resistor in series. Then you will have an ADC measuring the voltage differential across the resistor. Generally it will have a large gain set in order to measure across full range of ADC. You might also have to put a buffer op-amp if you are trying to measure low currents in order not to distort the readings.
To choose a shunt resistor you should first consider the top current you expect to encounter. Then divide your ADC's range across the current to get a value. For example, if you use ina226 as your ADC and amplifier then you have a +-82mv full range so you should fill the voltage to go to 82 millivolts.With that being said, you have to watch the heating on your shunt resistor. Be skeptical about maximum heating values, and calculate your own temperature ranges.
We highly recommend the INA226. It is a highly reliably, most accurate I2C current shunt monitor we have seen. It is simple to use, simple to program, easy to read values, easy to parallel multiple INA226 on one bus, and has overcurrent watching. In addition it contains an additional ADC to read bus voltage which could be important to you. Lastly, it consumes very little current so it can easily share tiny linear regulators.
Hall Effect Current Sensor When you are trying to measure current up to 20 amps you can use a shunt resistor without too high of losses. However, after 20 amps it is hard to use an accurate low resistor, so you can use a Hall Effect Current Sensor. Those sensors utilize a low conduction path for the current and apply a magnetic field across the path to then measure the voltage and read out the current. One good company to buy these sensors from is Allegro Microsystems. They have a number of these sensors you can choose from. http://allegromicro.com/en/Products/Current-Sensor-ICs.aspx Just be careful where you put those sensors. Try to keep them away from microcontrollers, inductors and high frequency parts as they will propagate magnetic field and disturb your readings.
Beyond 50A Once you go beyond 50 amps you will need to look at modules that will measure those currents.
George Karavaev and Alex Suchko (12-12-11)