Power Supply and DC Regulators on a PCB for MCUs

Video Tutorials (Watch these videos before you start reading the contents on this webpage)

1. Make aluminum electrolyte capacitor devices in Eagle PCB
2. Soldermask for the GND pad of LM2596
3. Make inductor devices in Eagle PCB
4. Add the Schottky diode device (SS34 SMC DO-214AB)
5. The Schematic
6. The Layout (please use 1 mm instead of 0.7 mm for the diameter of the switch's via)

Design the power module on the PCB is the first step of the PCB design. You must find the technical parameters of the chips/parts used on the PCB and estimate the current/voltage needed by the system. If the power input is 110 VAC only, you'll need to build a AC-DC converter (a transformer) on the PCB. However, there are many commercial AC-DC adaptors on the market. We just need to pick up a competent one which has enough power to support the loads on the PCB to provide a DC voltage to the board and being regulated to low voltage to supply the MCUs.

An on-board transformer looks like this:

A AC-DC adapter. The adapter connected to yorr laptop is a very typical example.

In a laptop, the AC-DC adapter's output is usually 20 VDC. There will be a few voltage regulators on the mother board to step down the voltage level for the high-speed IC chips. The voltage ratings of most of the IC chips on the board are below 5 V.

Now, let's start the development of the most commonly used DC power supplies for MCUs.
The most common voltage supplies for MCUs are 5 V and 3.3 V. We will assume that AC 110 V is available and a AC-DC adaptor will be used to provide a relatively high DC voltage to the PCB.

1. 1 A, 5 V and 3.3 V outputs.
2. 3 A, 5 V and 3.3 V outputs.

1. 1 A, 5 V and 3.3 V outputs.

Let's start with the DC module you have in your box.

The schematic of this module.

The USB Jack and the headers are useless for your customized MCU PCB board. The DC Jack is the connector for your AC/DC adapter. Let's look into the individual components in this circuit.

1. D1 1N4007 is the diode to prevent current from going into the wrong way (backwards). Keep in mind that the diode has a 0.7 V forward voltage drop. This module is used to step down something higher than 5V (like 7V, 9V, and 20V) so you do not need to worry about the 0.7 V voltage loss here. However, if you have only 5 V DC comes to the DC Jack, you will see some loss at the output.
2. AMS 1117-5.0 is the 5V voltage regulator. It only has three pins - input, output, GND. AMS 1117-3.3 is the 3.3 V voltage regulator, which has the same pinout as the 5 V one.
3. The 0.1uF, 1uF, and 100uF capacitors are requried for the input and output pins of this power module. These capacitors help keep the DC voltage clean and steady. They perform like charge reserviors to decouple any high frequency AC oscillations.

To pick up the correct capacitors from Digi-Key, you need to look at the following key parameters:
1. Capacitance
2. Voltage ratings
3. Footprint (package)
4. Tolerance (to be used in the power supply modules the tolerance is not that important).

The voltage regulators are the 1117 SOT-223 chips.

and the 5V one as well:

The 0.1uF I picked up is a Surface mount ceramic capacitor:

Please note that the voltage rating is 25 V and the package is 0603. 25 V is fine because the adapters we are going to use are <= 20 VDC.
You need to know two very popular packages, one is 0603, one is 0805.

As a beginner, if you can buy a PCB reference ruler, you will be able to see the sizes of different packages  printed on the ruler.
Amazon link for the ruler: https://www.amazon.com/Adafruit-PCB-Ruler-v2-6-ADA1554/dp/B00KGEMW74/ref=sr_1_1?dchild=1&keywords=pcb+ruler&qid=1590602688&sr=8-1

My favorite resistor/capacitor packages is the 0603 one because it is very small to save space on a PCB and in the meantime it is not too small to pick up by your tweezer.

Datasheet of AMS117.

The 1uF capacitor has a lower voltage reading which is 10 V. It is used for the 3.3 V output in the schematic. The package is 0603 SMD

The 100 uF capacitor I have in my drawers is an SMD/Aluminum cap.

How to pick up a correct protection resistor for the LED available in your box? The LED we have is this one:

The forward voltage (Vr) is 2 V. This is the voltage drop across the diode while it is turned on. If it is powered up by a 5V DC supply, the voltage dropped on the protection resistor will be 5V-2V = 3V.
The current rating of the LED is 20 mA. Normally we will use a smaller current than the current rating. For example we want 10 mA flow through the LED and the resistor, the protection resistor shoule be 3V/10mA = 300 ohm.
This is not critical. You can choose anything in the range of 200 ohm - 1 kohm as long as the brightness is acceptable.

We have the 470 ohom resistor in stock, so let's just use the 470 ohm one.

The 470 ohm resistor. 0603 package.

The 1N4007 diode can be the dip version since it is not taking too much more space than the SMD ones and it is very inexpensive. You will notice that the current rating is 1A so this power supply design is really for something lower than 1A.

The Arduino UNO board has a DC Barrel Power Jack Connector which receives a voltage from 6 V (the output is 5 V and the protection diode will drop about 0.7 V) to 18 V (AMS1117 chip can handle anything lower than 18V). Buy an AC/DC adapter that converts 110V AC to this range, or use two of the chargable batteries available in my lab to provide a 7.5V DC voltage to the Jack connector.

Let's build a circuit as follows to have it ready for our future projects with the ATMega 328p chips.

First, open Eagle PCB and start a new project.

Right-click the created project and create a new schematic in it. Save the schematic in the same folder as your project file.

If you haven't imported the SparkFun library, follow this tutorial to import it.

Add a frame to the schematic.

Add a power jack header.

Grab the 1117 Voltage regulators:

Pick up a diode for the 1N4007 diode in the front. Open the datasheet of the 1N4007 available in the lab, check the demensions of the parts and the demension of the layout package in Eagle. Make sure the two metal pads have enough space to fit the diode in.

0.1 uF, two of them.

1 uF, one.

10 uF, one.

The LED as the power indicator.

The 470 ohm resistor.

Add a ground symbol.

Connect the parts with wires and label the 5V and 3.3V nets by Right Click - Names, change the names as 5V and 3.3V respectively.
Like this:

Run an ERC check to make sure there are no errors. Lots of the warnings can be ignored.

Convert it into a PCB layout view:

Move the parts and place them into the layout view.

Place them into the layout view. Give some reasonable space between the parts so you are not going to have a hard time soldering them later. Do not route the wires yet since you will have more circuit on this board later.

2. 3 A, 5 V and 3.3 V outputs.

Watch this video to understand the difference between a Buck Converter and a Boost Converter.

In this section, we are going to build two Buck Converters on the same PCB you built in the first section.

A commercial DC-DC converter using LM2596 chips are available at less than $2.

You do not need to redesign the circuit. On TI's website, the online App will create the schematic for you.
On this website: https://www.ti.com/product/LM2596
Scroll down to the middle of the webpage and use the following parameters for a 5V step down DC-DC converter.
(You need to create a TI account to retrieve the schematic).

Run the design App you will see this:

The diode is a Schottky Diode which has a smaller forward voltage loss and a fast switching speed compared to a regular diode. Diodes have a forward voltage drop of about 0.7 V (P=VI). Use a Schottky diode with less voltage drop to reduce losses. Using a Schottky also helps with switching losses, which are harder to quantify.

Go to the Bill of Materials (BOM) tag to check find the right parts to order. (The capacitors may not be available sometimes).

When you are looking for parts in DigiKey, make sure that you comply with the voltage/current ratings of the recommended capacitors. The voltage/current ratings should be at least 1.5X of the maximum possible voltage/current at the node.

Here is the summary of the BOM. You can start putting the parts in your DigiKey cart before you start drawing the PCB because the footprint/package version of the parts may vary in DigiKey's stock.
It doesn't have to be the recommended manufacturer on the list. The voltage/ccurent ratings are the most important information.

For the 22 uF cap:

The 4.7 uF cap: (the 100V voltage rating is fine).

The Schottky Diode:

The inductor:

This inductor we have doesn't exist in the existing library. Let's create it on our own.
If you do not know how to do it, please refer to this tutorial: http://yilectronics.com/Tutorials/Eagle_PCB/3_Lib/3_Lib.html

The created device in the library looks like this:

We must create a device in the library for LM2596 as well:
The datasheet is here:

The following figure can be found in the datasheet.

The 5 pins of the chip.

For the 4.7 uF capacitor.
link to the datasheet: https://www.nichicon.co.jp/english/products/pdfs/e-uux.pdf

The SS34 Schottky diode layout:

Pull the homemade parts to your schematic and make all the connections. (This schematic was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

Now, let's follow the similar track to create the schematic for the 3.3 V supply.

The 33 uF capacitor:
It has the same 8.3mmX8.3mm footprint as our 4.7uF cap. We can reuse the footprint for this device in the library.

The LM2596 3.3V chip has the same footprint as the 5V one. Create the 3.3V device in the library using the same footprint.

The Schottky diode is the same one used above. It is just used for passing the current.

The output capacitor really doesn't matter that much. Let's reuse the 4.7uF cap we created previously.

The 33 uH inductor uses the same footprint as our 47uH one - 12mm x 12mm.

The final schematic looks like this: (This schematic was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

Let's combine these three schematics and PCB layouts to a fully functioning power module for fabrication.

I just want to keep one barrel jack power connector on the board. I'll use a jumper wire to let the user select which power supply should be connected to the load.

The final schematic looks like this. Please note that I moved the power indicator to the Barrel Jack connector. (This schematic was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

In the layout, do not forget to label the headers using the tPlace layer. (This layout was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

The final layout before routing looks like this: (This layout was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

After pouring the copper (ratsnet, refer to the PCB tutorial http://yilectronics.com/Tutorials/Eagle_PCB/2_SCH_BRD/2_SCH_BRD.html if you do not know how to do it). (This layout was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

Is this good enough? For a normal digital circuit board maybe this is okay but for a power module runs a maximum current of 3A, the traces are too narrow.

Go to Edit - Net classes to change the default trace width to 40 mil then autoroute it.

Do not forget to checkt Tools - DRC - Check, then press Ctrl + E to look at the left bottom corner of the page to see if there are any errors. (This layout was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

If it doesn't pass the DRC check, you can always 'Ripup' all the wires and re-route it. Remember to delete the 'Ratsnest' frame when you are modifying the wire thickness. Add it back and pour the copper back again when you are happy with the traces.

Pour copper to both the top and the bottom side of the PCB: (select the bottom layer and drasw the blue polygon and Ratsnest it.

Process the design to get the gerber files.

Open the CAMOutputs folder and find the Drill File. Cut it and paste it inside the GerberFiles folder.

Inside the GerberFiles folder, zip all the files into a package.

Visit PCB viwer, create an account if you don't have one.

Drag and drop your zip package to this filed and click Load File.

Check all the layers especially the silkscreen_top layer to see if you have all the labels available on your PCB. The outline of the customized library parts should be at the 'tPlace' layer in order to show up on the PCB. 'tDocu' doesn't work.
If you need to change the layer from 'tDocu' to 'tPlace' for the outlines, go to the library to change it and save it. Also, do not forget to go back to the PCB layout view, right click the parts have been modified and select 'Replace' to replace the existing parts with the newly modified ones in the library. (This layout was improved afterwards. Use the one showed in the video tutorial on the top of this webpage).

Finally, follow the instruction for creating the gerber files and submitting to PCBWay for fabrication.

Switches: https://www.amazon.com/gp/product/B07BD1SPYG/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1