Skip to content
You Start with one site
Amounts in Start with one site
Embedded Systems & Electronics · Course

Your first board: a small UV lamp

Lesson 0: start here 45 min read
Made with KiCad 10checked November 2026Newer version?
Stays the same
  • Schematic first, then the board
  • Footprints, nets and design rules
  • Ground planes, return paths and clearances
  • Gerbers and a drill file for the maker
May look different
  • Menu places and hotkeys
  • The look of the plugin and library managers
  • Default design rules
  • Dialog fields (KiCad 10 gave rectangles a corner radius)
  • The Python module: SWIG pcbnew is deprecated in favour of kicad-cli and the IPC API

A step looks different? Most commands have a hotkey listed in Help, then the list of hotkeys.

The ideas in this lesson do not depend on the version. Where a click moved, the lesson still names the command.

Found this useful?

Most first boards fail for small reasons: a part footprint that does not match the part, a hole missing from the drill file, an LED soldered the wrong way round. Each one costs a week and a new order. This lesson takes you through the whole way once, on a board so simple that the process is the only thing to learn. At the end you hold a lamp you designed, and you know how to check every step before you pay for it.

#KiCad #FirstPCB #Gerbers

The finished lamp board in 3D: a green board with rounded corners, four clear 5 mm LEDs in a square in the middle, four resistors in a row above them, a slide switch on the top edge, two pads marked BAT+ and BAT-, a mounting hole in each corner and the words UV LAMP 4 x 395 nm, Do not look into the LEDs, siliconwit.com.
The board you will make, made in KiCad 10. 74 × 64 mm, two copper layers, ten parts.

What you will make

A small lamp with four 395 nm ultraviolet LEDs. It stands on four legs, LED side down, over a small board on your bench while UV glue or a solder mask touch-up cures. The three AA cells sit in a holder on the back of the board, out of the light. It is a tool for close work, not a torch.

Size74 × 64 mm, 2 layers, 1.6 mm
Power3 × AA, 4.5 V
Light4 LEDs, 5 mm, 395 nm
Currentabout 15 mA per LED
Parts10, all through-hole
Tracks11 short ones, by hand
3 × AA holder, on the back board M3 standoff UV light your work, on the bench height
The lamp in use. The standoffs fix the distance from the LEDs to the work, so the light on the work is the same each time you use it. Their length is your choice; 20 mm is a good start.
UV safety. 395 nm is UV-A, at the edge of what you can see. The LEDs look dim violet, but they are brighter than they look. Do not look into them, wear glasses that block UV while the lamp is on, and keep it away from children's eyes. Switch it on only when it stands over the work.

What you need

No KiCad experience and no electronics course. If a word below is new, its five-minute page is linked: Ohm's law, diode (an LED is one), Kirchhoff's laws.

  • KiCad 10, free from kicad.org, on Windows, macOS or Linux. Every click in this lesson was checked in KiCad 10.0.8.
  • The parts: the list is in step 12. About ten parts; the battery holder is the only one to choose with care.
  • For the build: a soldering iron with a fine tip, solder, side cutters, a multimeter, four M3 standoffs (about 20 mm) with eight M3 screws, three AA cells.

The whole way, once

Fourteen steps, in four stages. Each step ends with a check: a thing you can see or measure that tells you the step is right. Do not go on until the check passes. A mistake found at its own step costs a minute; found on the soldered board, it costs a new order.

  1. Draw1 Project and folders2 Schematic, then ERC3 Footprints
  2. Lay out4 Outline and holes5 Placement6 Routing7 DRC8 3D view9 Silkscreen
  3. Make10 Gerbers and drill files11 Ordering12 Parts list
  4. Build13 Soldering order14 Multimeter tests

First, the one calculation: design for the worst case

An LED has no current limit of its own. Above its forward voltage, a little more voltage gives much more current, and too much current kills it. So each LED needs a resistor to set its current. The resistor takes whatever voltage the LED does not:

I = (Vbattery − VLED) / R

Both voltages move. Three fresh AA cells give about 4.8 V, settle at 4.5 V, and are near empty at 3.6 V. The data sheets of 5 mm 395 nm LEDs give a forward voltage at 20 mA of 3.2 to 3.4 V typical, up to 3.8 V, and an absolute maximum current of 30 mA (Marktech MT5400-UV, Bivar UV5TZ-395-30). A low one may sit near 3.0 V.

Predict first

With typical numbers, 56 Ω gives the LED 21 mA, close to its 20 mA rating. Which resistor would you put on the board?

ResistorTypical4.5 V, 3.3 V LEDWorst case4.8 V, 3.0 V LEDNear empty3.6 V, 3.4 V LED
56 Ω21.4 mA32.1 mA, over 303.6 mA
68 Ω17.6 mA26.5 mA2.9 mA
82 Ω14.6 mA22.0 mA2.4 mA
100 Ω12.0 mA18.0 mA2.0 mA

68 Ω also stays under 30 mA, by only 3.5 mA. 82 Ω keeps the worst case at 22 mA, near the 20 mA the LEDs are rated at, and still gives about 15 mA on a normal day. The resistor's power at the worst case is 0.022² × 82 = 0.04 W, so a common 1/4 W resistor is plenty.

Look at the last column: near empty, the current falls to about 2 mA and the lamp is dim. That is the reason to measure the battery when the light looks weak (step 14).

See it: the current in one LED

Voltage across R
LED current
Power in R

I = (battery − LED) / R, for one LED. The LED's own voltage changes a little with current; the data sheet value at 20 mA is close enough for choosing a resistor.

One resistor for each LED, never one for all four. LEDs in parallel do not share current equally: their forward voltages differ by a few tenths of a volt, and the one with the lowest takes most of the current. With its own resistor, each LED is held near its own current whatever its neighbours do.

Step 1: make the project

A KiCad project is a folder with three files that belong together. Keep one project per folder; KiCad finds its files by their place in it.

  1. Start KiCad. KiCad 10 File > New Project.
  2. Name it uv-lamp, keep Create a new folder for the project ticked, and save it where you keep your work.

Check: the project window lists uv-lamp.kicad_pro, uv-lamp.kicad_sch (the schematic) and uv-lamp.kicad_pcb (the board), in a folder named uv-lamp.

Step 2: draw the schematic, then run ERC

The schematic says what connects to what. It says nothing yet about where parts go. Double-click uv-lamp.kicad_sch to open the Schematic Editor.

  1. KiCad 10 Place > Add Symbol (key A). Type the name in the search box. Place these: Device:Battery, Switch:SW_SPDT, four Device:R and four Device:LED. KiCad numbers them as you place them: BT1, SW1, R1 to R4, D1 to D4.
  2. Place > Add Power (key P): two GND and one PWR_FLAG.
  3. Set each value: hover over the part and press V. BT1 3 x AA, R1 to R4 82, D1 to D4 UV 395nm.
  4. Keep two groups apart, as in the picture below: the battery and switch on the left, the four LEDs on the right.
  5. Draw the wires with Place > Add Wire (key W). Left group: battery + to the switch's middle pin (2), a short wire out of switch pin 3, and a short wire down from the battery's minus. Right group: a line across the top, from it down through each resistor to its LED's anode, each LED's cathode down to a line along the bottom.
  6. Join the two groups by name, not by a long wire. Place > Add Label (key L): VLED on the wire from switch pin 3 and VLED again on the top line of the LEDs. Two labels with the same name are one connection. Name the battery's wire VBAT the same way.
  7. Put one GND symbol on the battery's minus wire, and the other GND and the PWR_FLAG on the LEDs' bottom line. All GND symbols are one connection.
  8. Optional, and worth it on bigger sheets: Place > Add Text Box, drag a box round each group and type its title.
  9. SW1 pin 1 is not used: put a no-connect flag on it with Place > Add No Connect Flag (key Q).

Why the PWR_FLAG: the GND symbol is marked as a power input, and nothing in this circuit is marked as a power output (the battery symbol's pins are plain connections). Without the flag, ERC reports that GND is not driven. The flag says: the power comes from here, the battery.

  1. Inspect > Electrical Rules Checker, then Run ERC.

Check: ERC reports 0 errors, 0 warnings, and your sheet has the same connections as this one. If ERC finds a pin "not connected", a wire ends near the pin but not on it: drag the part a little and see whether the wire follows.

The finished schematic on one A4 sheet, in two titled boxes, with the title block at the bottom right. Battery and switch: the battery BT1, its plus to the middle pin of slide switch SW1, switch pin 3 to a short wire labelled VLED, the battery's minus to a GND symbol. Four UV LEDs, one resistor each: a line labelled VLED across the top; from it four resistors R1 to R4, 82 ohm, each down to an LED D1 to D4, UV 395nm; the LED cathodes to a line along the bottom with a GND symbol and a PWR_FLAG. A third box, Why 82 ohm, gives the battery voltages and the current sums.
The finished schematic on one A4 sheet (click for the PDF). Made in KiCad 10.

Step 3: give each part a footprint

A footprint is the copper and holes a part needs on the board. The schematic symbol of an LED is the same for every LED; the footprint must match the one you will buy. Measure your parts, or read their drawings, before you choose.

  1. KiCad 10 Tools > Assign Footprints. For each part, find the footprint on the right and double-click it.
PartFootprintWhat the name tells you
D1 to D4LED_THT:LED_D5.0mmA 5 mm round LED; two holes 2.54 mm apart, the spacing of its legs. Pad 1, the square one, is the cathode.
R1 to R4Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalThe usual 1/4 W size (DIN0207): body 6.3 mm long and 2.5 mm across, lying flat, holes 10.16 mm apart.
SW1Button_Switch_THT:SW_Slide_SPDT_Angled_CK_OS102011MA1QA small slide switch whose lever points sideways, past the board edge.
BT1Battery:BatteryHolder_TruPower_BH-331P_3xAAA holder for three AA cells with two pins for the board, 12.8 mm apart, and two locating holes.
  1. Apply, Save Schematic & Continue, then OK.

Check: open the dialog once more: no part has an empty footprint. For the LED, click the footprint and look at the preview: two pads, one square. Buy a holder with two pins for the board, and check its drawing against the footprint: pin spacing and hole positions. A holder with wires also works: solder its red wire into the + pad and its black wire into the − pad.

Step 4: the board outline and the holes

Open the PCB Editor from the project window. Set the rules first, so that KiCad checks everything you draw against them.

  1. KiCad 10 File > Board Setup > Design Rules > Net Classes. In the Default class set Track width 0.5 mm and Clearance 0.25 mm. Why 0.25 and not 0.3: the slide switch's own pads are 0.25 mm apart, so a larger rule would report the part itself as an error.
  2. Choose the layer Edge.Cuts in the layer list on the right. Place > Draw Rectangle, and draw any rectangle.
  3. Double-click its edge to open its properties. Start X 100, Y 100; end X 174, Y 164 (mm). Corner radius 3 mm (new in KiCad 10; in KiCad 9 use Fillet Lines).
  4. Place > Add Footprint (key A), MountingHole:MountingHole_3.2mm_M3, four times, at (104, 104), (170, 104), (104, 160), (170, 160): 4 mm in from each edge.
  5. Open each hole's properties (key E). Reference H1 to H4. Under Fabrication Attributes tick Not in schematic and Exclude from bill of materials.

Step 5 tells why the holes are needed: the lamp stands on them. Without the attributes in the last step, DRC's parity check (step 7) reports the holes as parts missing from the schematic.

Check: Inspect > Measure from corner to corner along an edge reads 74 mm and 64 mm. Each hole is a circle of 3.2 mm with no copper ring.

Step 5: place the parts

  1. KiCad 10 Tools > Update PCB from Schematic (key F8), then Update PCB. The ten parts arrive in a heap, joined by thin lines: the ratsnest, the connections still to draw.
  2. Place each part by its properties (key E): Position X, Y and Orientation from the table. For BT1, first press F to put it on the back of the board, then type its position.
PartX, Y (mm)AngleWhy there
BT1163.7, 117180, backOn the back, out of the light, and the lamp's handle. After F, KiCad shows 180°.
SW1158, 103180On the top edge, lever past the edge, so you reach it with the lamp standing.
R1, R2, R3, R4125, 131, 143, 149; all at Y 108.5−90In a row under the VLED line, each above its own LED.
D2, D3131, 127.27 and 143, 127.2790The top two LEDs; anode up, straight under R2 and R3.
D1132.27, 138180Bottom left; anode to the left, toward R1's track.
D4141.73, 1380Bottom right; anode to the right, toward R4's track.

The four LEDs make a 12 mm square in the middle of the board, so their light overlaps on the work. The two large holes above and below the square belong to the battery holder on the back: they take its locating pegs.

Check: no ratsnest line crosses another more than it must, and no two part outlines overlap. Your board looks like this one.

The board from above as its printed outlines show it: the slide switch on the top edge, four resistors in a row, four LEDs in a square in the middle, two large holder holes, BAT+ and BAT- pads on the right, and a mounting hole in each corner.
The placement, as the top silkscreen and outlines show it.

Step 6: route the tracks

First the width. A track gets warm when current flows; the IPC-2221 estimate gives the copper it needs for a given warming. The most any track here carries is the whole lamp's current at the worst case: 4 × 22 = 88 mA. For 0.1 A and a 10 °C rise, in the usual copper 35 µm thick, IPC-2221 asks for a track only 0.013 mm wide.

So heat does not set the width. Use 0.5 mm: 40 times what heat needs, easy for any board maker, and strong enough to survive a slip of the iron. Its resistance is tiny too: 50 mm of it is 0.049 Ω, which loses 4 mV at 88 mA.

  1. Choose F.Cu, the top copper (key PgUp). KiCad 10 Route > Route Single Track (key X). Click on a pad, click at each corner, double-click on the pad at the other end. The width comes from the Default class: 0.5 mm.
  2. On the top copper: VBAT from BT1's + pad up and across to SW1's middle pin; VLED from SW1 pin 3 along the row of resistor pads; each resistor's lower pad to its LED's anode (the round pad).
  3. Choose B.Cu, the bottom copper (key PgDn). Route GND: from each LED's cathode (the square pad) to one line at Y 132, and along it to BT1's − pad.

Why GND on the back: the R4 and R1 tracks run down the front past the LEDs, and the GND line must cross them. A through-hole pad has copper on both faces, so a track can leave a pad on either face with no via.

Check: no ratsnest lines are left; the status bar at the bottom reads Unrouted: 0. Your two copper layers look like these.

The top copper: the VBAT track from the BAT+ pad to the switch, the VLED track along the four resistor pads, two short tracks down to the top LEDs, and two longer tracks round to the bottom LEDs.
F.Cu, the top copper
The bottom copper seen from above: one GND line joins the four LED cathodes and runs to the BAT- pad.
B.Cu, the bottom copper, seen from above

Step 7: run DRC

The Design Rules Checker compares the copper with your rules (widths, gaps, distance from the edge) and the board with the schematic.

  1. KiCad 10 Inspect > Design Rules Checker. Tick Test for parity between PCB and schematic. Run DRC.

Check: 0 violations, 0 unconnected items, 0 schematic parity issues. That is what the finished project gives in KiCad 10.0.8.

  • Clearance violation between SW1's own pads: the clearance is still 0.3 mm; set 0.25 (step 4).
  • Extra footprint H1 to H4: tick Not in schematic on each hole (step 4).
  • Unconnected items: a track ends near a pad but not on it. Click the marker; KiCad shows where.
  • Missing footprint: a part changed in the schematic. Press F8 again.

DRC cannot know which way round a real LED goes, or whether your holder fits its footprint. Those checks are yours, in steps 3 and 13.

Step 8: look at it in 3D

  1. KiCad 10 View > 3D Viewer (key Alt+3). Turn the board with the mouse.

KiCad's library has the holder's footprint but no 3D model, so in your project it is not drawn. The finished project carries a simple one in its 3d folder; to add it, open BT1's properties, 3D Models, and give the file ${KIPRJMOD}/3d/BH-331P_3xAA.wrl.

Check: the LEDs stand on the top; the flat side of each LED body is over its square pad; the switch lever sticks out past the top edge; seen from below, the holder covers the back and no part is under it.

The board from above in 3D: four clear LEDs in a square, four resistors in a row, the slide switch on the top edge with its lever past the edge.
From above
The board from below in 3D: the battery holder with three blue AA cells covers most of the back; the switch pins show at the top edge.
From below: the holder, with its cells

Or turn the finished board here. In Parts, hide BT1 to see the pads under the holder, or hide everything but Copper to follow the tracks.

The UV lamp board: every part by its reference, and the copper, pads and silkscreen. Drag to turn, pinch or scroll to zoom. Open in the full viewer.

Step 9: the silkscreen

The silkscreen is the white print. It tells the person with the soldering iron which part goes where and which way round, and it carries the warning.

  1. KiCad 10 Place > Add Text, layer F.Silkscreen, height 1.0 mm, thickness 0.15 mm (smaller text may not print clearly).
  2. Add: UV LAMP 4 x 395 nm (1.5 mm high), Do not look into the LEDs, BAT+ and BAT- beside the holder pads, a revision (rev A), and a line of your own. Ours says siliconwit.com.

Check: no text touches a pad (DRC reports Silkscreen clipped by solder mask if it does); run DRC again: still 0, 0, 0.

Step 10: Gerbers and drill files, checked in a viewer

A board maker does not open KiCad files. It takes one Gerber file per layer and the drill files, in a zip.

  1. KiCad 10 File > Fabrication Outputs > Gerbers (.gbr). Output directory gerbers/. Layers: F.Cu, B.Cu, F.Silkscreen, B.Silkscreen, F.Mask, B.Mask, Edge.Cuts. Plot.
  2. In the same dialog, Generate Drill Files: format Excellon, units millimeters, and leave PTH and NPTH in single file unticked. Generate.
  3. Zip everything in the gerbers folder into one file.

Why two drill files: the plated holes (with copper inside, for the parts) and the unplated ones (bare, for screws and pegs) are made in different steps. KiCad itself marks the single file as not recommended.

Open the zip in the board maker's online viewer, or in KiCad's own Gerber Viewer from the project window.

Check: the outline is 74 × 64 mm and closed; two copper layers; the holes are these. Compare with our Gerber zip.

HoleHow manyFor
0.8 mm plated8resistor legs
0.9 mm plated11LED legs (8) and switch pins (3)
1.2 mm plated2battery holder pins
1.5 mm plated2switch mounting tabs
3.2 mm unplated4M3 standoffs
4.0 mm unplated2holder locating pegs

Step 11: order the board

Upload the zip to an online board maker. Most read the size and the layers from the files. Choose:

  • Layers 2, thickness 1.6 mm, FR-4, copper 1 oz: the usual board, the cheapest and quickest.
  • Surface finish HASL (lead-free if it is offered): easy to solder by hand.
  • Any mask colour; green is often the quickest. The smallest quantity on offer, often 5.

Check: the maker's preview shows 74 × 64 mm, both copper layers, all the holes, and the silkscreen the right way round on top. If the preview is empty or the size is wrong, a file is missing from the zip.

Step 12: the parts list

  1. In the Schematic Editor, KiCad 10 Tools > Generate Bill of Materials, and export as CSV.
RefQtyPart
D1 to D445 mm UV LED, 395 nm, forward voltage 3.0 to 3.8 V at 20 mA (for example Bivar UV5TZ-395-30)
R1 to R4482 Ω, 1/4 W, 5 %, through-hole
SW11slide switch, SPDT, right angle (C&K OS102011MA1QN1 or one with the same pins)
BT113 × AA holder with two board pins (TruPower BH-331P), or one with wires
4 + 8M3 standoffs about 20 mm, and M3 screws

Check: the BOM file has four lines (BT1, D1 to D4, R1 to R4, SW1) and ten parts. The holes are not in it. Ours: uv-lamp-bom.csv.

Step 13: solder, low parts first

Solder the lowest parts first, so the board lies flat on the bench while you work. Each part goes in from the top (the side with the white print) and is soldered underneath, except the holder.

  1. R1 to R4. Bend the legs to 10 mm, push them through, solder, cut the legs. A resistor has no direction.
  2. SW1. Solder one tab, check it sits flat and square to the edge, then the rest.
  3. D1 to D4. The long leg is the anode (+), into the round pad. The flat side of the body is the cathode, over the square pad and the flat mark in the silkscreen. Solder one leg of each, check all four stand straight and at the same height, then the second legs.
  4. BT1 last, on the back: its pins come through to the top, and you solder them there. Then the four standoffs, on the LED side.

Check after each part: each joint is a small shiny cone round the leg, with no solder bridging to the next pad. Before the cells go in, hold each LED up to the silkscreen once more: flat side on the flat mark.

Step 14: test it with a multimeter

Measure before you trust it. Each test has a number to expect; a different number tells you where to look.

  1. No short. No cells in. Meter on resistance; probes on the BAT+ and BAT- pads, with the switch each way. Expect: not near 0 Ω. Near 0 Ω means a solder bridge.
  2. The battery. Cells in, switch off. Meter on DC volts, across BAT+ and BAT-. Expect: 4.5 to 4.8 V with new cells. Below 4 V the lamp is dim (the table in the first calculation).
  3. Which way is on. Stand the lamp on its legs over a sheet of white paper and slide the switch. Many papers glow blue under UV; that is the lamp working. Do not look into the LEDs to see it.
  4. The current in each LED, from Ohm's law. Lamp on, meter on DC volts, probes on the two legs of R1. Divide by 82. Do the same for R2 to R4. Expect: about 1.2 V, so about 15 mA each.
  5. The whole lamp's current. Switch off. Meter on DC mA, red lead in the mA socket, probes on SW1 pins 2 and 3 (the meter now does the switch's job and the current flows through it). Expect: about 60 mA.
VLEDGND 82 Ω 1.20 V
Test 4: 1.20 V across 82 Ω is 1.20 / 82 = 14.6 mA.
VBATVLED 58 mA SW1 off: the meter carries the current
Test 5: with the switch off, the meter across it carries all the current.
Your turn

R3 reads 1.05 V; the other three read 1.20 V. What current does D3 take, and why is it different?

Show the worked answer
  1. Ohm's law on the resistor

    I = V / R = 1.05 / 82 = 12.8 mA, against 14.6 mA for the others. ✅

  2. Where the rest of the voltage went

    The supply is the same for all four, so D3 takes 0.15 V more than the others: its forward voltage is higher. That is the normal spread between LEDs, and exactly why each one has its own resistor. ✅

Using the lamp, and what it can cure

Stand the lamp over the work, switch it on, and keep the time. What it cures depends on the material, not on the lamp alone.

  • Check the material's data sheet for the wavelength it needs and the dose. Dose is light power on the work times time: dose (mJ/cm²) = irradiance (mW/cm²) × time (s).
  • Solder masks made for industry are usually tuned near 365 nm (to harden the surface) and 405 nm (to harden through the layer). A 395 nm lamp may suit a hobby mask or may not; we have not checked it with any product. So this lesson gives no cure time.
  • Make a test piece first: a spot of the material on scrap board, cured for a time you note, then scratched. Change one thing at a time: the time, or the standoff length.
Each time you use it. UV glasses on before the switch. The lamp stands on its legs before it is switched on, and is switched off before it is picked up.

Check yourself

Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.

1. To save three parts, a student uses one 22 Ω resistor in place of four 82 Ω ones, with all four LEDs joined side by side after it. The total current is about the same. What happens?

2. With 4.5 V and a 3.3 V LED, a 56 Ω resistor gives 21 mA, close to the LED's 20 mA rating. Why does this lesson use 82 Ω?

3. ERC and DRC both report 0. The board is made and soldered. Three LEDs light; D2 does not. The meter reads 0 V across R2's legs and 4.6 V across D2. What is wrong?

The files

Where the numbers come from: LED forward voltage and current from the data sheets of the Marktech MT5400-UV, the Bivar UV5TZ-395-30 and the Lumimax LED5-UV400; the battery voltages are those of alkaline AA cells, fresh, in use and near empty; mask wavelengths from I-Connect007's articles on LED UV curing and the EIPC 2017 report on 365, 385 and 405 nm mask cure; track width from IPC-2221. The next lesson, the ATmega328P breakout board, uses every step here on a board with a chip, a crystal and a regulator.

Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.