CircuitNote

Quick electronics calculators for lab work and circuit design. Free, no sign-up, works in your browser.

Values accept SI prefixes. Examples: 4.7k 4k7 100n 10u 20mA 1M

PCB

PCB Generator: MOSFET Switch, 555 Blinker and LM317 Supply Boards (Gerber Download)

Pick a circuit and enter what it has to do. The generator picks the part values, sizes the power traces, checks the temperatures and lays out a through-hole board, then gives you the schematic, a board preview, a parts list and Gerber files you can send to a PCB maker.

A microcontroller pin switches a motor, solenoid, relay coil, LED strip or heater.

Range: 3 to 24 V, 0.05 to 8 A. Board 58 × 36 mm, every trace on the bottom layer.

Every board is two-layer FR-4, 1.6 mm, with 4 M3 mounting holes.

Schematic and board

Schematic
Board, top view (58 × 36 mm)

How the board is worked out

The MOSFET is an IRLB8721PbF (30 V, TO-220), a logic-level part whose on-resistance is guaranteed at 4.5 V gate drive: at most 16 mΩ, or 8.7 mΩ at 10 V. Its conduction loss is P = I2 · RDS(on), taken 1.5 times higher than the datasheet maximum because on-resistance rises as the die heats up. The junction temperature without a heatsink is Tj = Ta + P · RθJA with an ambient of 40 °C (inside a box) and RθJA = 62 °C/W; above 100 °C the result asks for a heatsink and gives its thermal resistance.

Power traces (supply, drain and ground return) are sized with the IPC-2221 outer-layer formula for a 10 °C rise, as in the PCB trace width calculator, then rounded up and kept between 1.5 and 4 mm. Right at the MOSFET pins they narrow to 1.2 mm for 3.5 mm so they clear the neighbouring pins. The generator runs a design-rule check on every board it draws: at least 0.25 mm between copper of different nets, 0.5 mm to the board edge and the mounting holes, and every net in one piece.

The 555 blinker uses the NE555 astable formula f = (1.44)/((RA + 2RB)·C) from the TI datasheet. RA is fixed at 1 kΩ so the duty cycle stays close to 50 %; the generator picks the timing capacitor (0.1 to 100 µF) that puts RB near 100 kΩ, then rounds RB to the E24 series and shows the rate you will actually get, as in the 555 timer calculator. The output swings to about 1.7 V below the supply when high and about 0.1 V when low, so the two LED resistors differ: R = (VCC − 1.7 − VF)/(ILED) for D1 and R = (VCC − 0.1 − VF)/(ILED) for D2, both rounded up so the LEDs never get more than you asked for (see the LED resistor calculator). The NE555 runs from 4.5 to 16 V and sources or sinks up to 200 mA, far more than two LEDs need.

The LM317 supply sets its output with two resistors: Vout = 1.25·(1 + (R2)/(R1)) + IADJ·R2 with IADJ = 50 µA. R1 is tried from 240 Ω down to 100 Ω (the datasheet's 240 Ω keeps the 3.5 mA minimum load) and R2 from the E24 series; the pair closest to your target wins. The input must stay at least 3 V above the output. The loss P = (Vin − Vout)·I gives the junction temperature with RθJA = 23.5 °C/W (TO-220) at 40 °C air, and above 100 °C the result asks for a heatsink and gives its thermal resistance, as in the heatsink calculator. A 100 nF input capacitor, a 10 µF output capacitor (the datasheet asks for at least 1 µF) and a 1N4002 diode that protects the regulator if the input is shorted while the output capacitor is charged follow the datasheet's application circuit; a power LED is added for outputs of 3 V or more.

The Gerber files follow RS-274X with an Excellon drill file for plated and non-plated holes, the same set PCB makers ask for. Look the zip over in the maker's online Gerber viewer before you pay.

Using it in practice

Step by step

  1. Enter the supply voltage and the current the load draws when it is on. For a motor use its stall current or at least the running current with some margin; a relay coil's current is its voltage over the coil resistance.
  2. Choose the gate drive that matches your microcontroller pin and the load type. The result card shows the MOSFET loss, its temperature without a heatsink, the trace width and the design-rule check.
  3. Look over the schematic and switch the board view between the top (parts) and the bottom copper.
  4. Download the Gerber zip and upload it on a PCB maker's order page (2 layers, 1.6 mm, the copper weight you chose). Download the parts list to order the parts.
  5. Solder the low parts first (resistors, diode), then the header, the terminals and the MOSFET.

Common mistakes

  • Leaving out the shared ground. The microcontroller's GND must go to the J3 GND pin. Without it the gate signal has no reference and the MOSFET switches erratically or not at all.
  • Putting the diode in backwards. The band (cathode) goes to the supply side, as printed on the board. Reversed, it shorts the load supply the moment the MOSFET turns on.
  • Using the running current for a motor. A motor draws several times its running current when it starts or stalls. Size the board for that, or the MOSFET heats far more than the card predicts.
  • Driving it from 3.3 V and a heavy load. The on-resistance is only guaranteed from 4.5 V gate drive; see the MOSFET I–V guide for how much the channel depends on VGS.

Practical tips

Test the finished board with a small load first, such as a 12 V bulb or a resistor, and measure the drain-to-source voltage while it is on: the voltage divided by the current is the real on-resistance, and it should be tens of milliohms at most. A finger-warm MOSFET at full current is normal; too hot to touch means it needs the heatsink or a higher gate voltage. For PWM, stay below about 20 kHz with a microcontroller pin; above that the gate charging time through R1 starts to add switching loss. The transistor switch calculator covers the same job with a BJT for small loads, and the heatsink calculator picks a heatsink when the card asks for one.

The 555 blinker board

Solder the 8-pin socket rather than the NE555 itself, with its notch matching the half-circle on the silkscreen, and check the electrolytic C1's polarity: the stripe marks the negative lead, so the other lead goes in the hole next to the + sign. Power it from a 9 V battery or a 5 to 12 V adapter. If the LEDs flash slower or faster than the card says, the timing capacitor is the usual reason: electrolytics are often ±20 %, so measure it with a capacitance meter or swap R2 (RB) for the next E24 value. Below about 0.5 Hz the LEDs stay on long enough to see the 555's output step; above about 20 Hz the eye stops seeing the flashing at all. The 555 timer calculator works out other RA, RB and C combinations, and the CMOS TLC555 or LMC555 fits the same socket for battery projects that need less current.

The LM317 supply board

Fit the LM317 last, with its metal tab on the side of the double line in its silkscreen outline (towards R1 and R2); the tab is the output, so an uninsulated heatsink must not touch anything else. Before connecting a load, measure the output with nothing attached: it should be within about 2 % of the card's value, which is the 1 % resistor and reference tolerance. Then load it with the real current and measure again, and touch the tab after a few minutes. If it is too hot, either lower the input voltage (a 9 V adapter for a 5 V output wastes much less than 12 V) or fit the heatsink the card asks for, with thermal paste. For more than a watt or two of loss, a buck converter is the better choice; the zener regulator guide shows why simple linear regulators waste power.

Frequently asked questions

Can I order a board from these Gerber files?

Yes. The zip holds RS-274X Gerbers for both copper layers, both solder masks, the top silkscreen and the outline, plus Excellon drill files, which is the set PCB makers ask for. Upload the zip on the order page and check it in their Gerber viewer first. Choose 2 layers, 1.6 mm and the copper weight you picked here.

Why does the board ask for 5 V gate drive?

The IRLB8721PbF's on-resistance is guaranteed from 4.5 V gate-source voltage. At 3.3 V it usually turns on, but the datasheet gives no maximum on-resistance, so the loss and temperature cannot be promised. For more than about 1 A from a 3.3 V board, add a level shifter or a gate driver.

Do I need the flyback diode?

For motors, relays and solenoids, yes. When the MOSFET turns off, the coil keeps the current flowing and the drain voltage jumps far above the supply; the diode gives that current a path back to the supply. A heater or LED strip has no coil, so the diode position can stay empty.

Can I make this board at home?

The MOSFET board, yes: every trace is on the bottom layer, so it can be etched as a single-sided board (print it mirrored for toner transfer). The 555 and LM317 boards route a few traces on the top layer, so they need a double-sided board or a few wire jumpers.

How does the 555 blinker set its blink rate?

With the NE555 astable formula f = 1.44 ÷ ((RA + 2RB)·C). RA is fixed at 1 kΩ, the timing capacitor is chosen so RB lands near 100 kΩ, and RB is rounded to the E24 series. The result shows the rate you will really get, usually within a few percent of the target; capacitor tolerance (often ±20 % for electrolytics) moves it more than that.

Why are the two LED resistors different on the 555 board?

The NE555 output does not reach the supply rail. When high it sits about 1.7 V below the supply, and when low about 0.1 V above ground. D1 (lit while the output is high) therefore sees less voltage than D2, so it gets a smaller resistor for the same current.

How much current can the LM317 board deliver?

Up to 1.5 A as long as the input is no more than about 15 V above the output; with more headroom the regulator's own current limit drops (0.15 A minimum at 40 V). The heat usually limits it first: the result shows the loss (Vin − Vout)·I, the junction temperature without a heatsink and the heatsink rating needed above 100 °C.