Your first board: a small UV lamp
Made with KiCad 10checked November 2026Newer version?
- Schematic first, then the board
- Footprints, nets and design rules
- Ground planes, return paths and clearances
- Gerbers and a drill file for the maker
- 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.
On this page
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.
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.
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.
- Draw1 Project and folders2 Schematic, then ERC3 Footprints
- Lay out4 Outline and holes5 Placement6 Routing7 DRC8 3D view9 Silkscreen
- Make10 Gerbers and drill files11 Ordering12 Parts list
- 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:
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.
With typical numbers, 56 Ω gives the LED 21 mA, close to its 20 mA rating. Which resistor would you put on the board?
| Resistor | Typical4.5 V, 3.3 V LED | Worst case4.8 V, 3.0 V LED | Near empty3.6 V, 3.4 V LED |
|---|---|---|---|
| 56 Ω | 21.4 mA | 32.1 mA, over 30 | 3.6 mA |
| 68 Ω | 17.6 mA | 26.5 mA | 2.9 mA |
| 82 Ω | 14.6 mA | 22.0 mA | 2.4 mA |
| 100 Ω | 12.0 mA | 18.0 mA | 2.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).
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.
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.
- Start KiCad. KiCad 10 File > New Project.
- 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.
- KiCad 10 Place > Add Symbol (key A). Type the name in the search box. Place these:
Device:Battery,Switch:SW_SPDT, fourDevice:Rand fourDevice:LED. KiCad numbers them as you place them: BT1, SW1, R1 to R4, D1 to D4. - Place > Add Power (key P): two
GNDand onePWR_FLAG. - Set each value: hover over the part and press V. BT1
3 x AA, R1 to R482, D1 to D4UV 395nm. - Keep two groups apart, as in the picture below: the battery and switch on the left, the four LEDs on the right.
- 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.
- Join the two groups by name, not by a long wire. Place > Add Label (key L):
VLEDon the wire from switch pin 3 andVLEDagain on the top line of the LEDs. Two labels with the same name are one connection. Name the battery's wireVBATthe same way. - Put one
GNDsymbol on the battery's minus wire, and the otherGNDand thePWR_FLAGon the LEDs' bottom line. All GND symbols are one connection. - Optional, and worth it on bigger sheets: Place > Add Text Box, drag a box round each group and type its title.
- 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.
- 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.
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.
- KiCad 10 Tools > Assign Footprints. For each part, find the footprint on the right and double-click it.
| Part | Footprint | What the name tells you |
|---|---|---|
| D1 to D4 | LED_THT:LED_D5.0mm | A 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 R4 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | The usual 1/4 W size (DIN0207): body 6.3 mm long and 2.5 mm across, lying flat, holes 10.16 mm apart. |
| SW1 | Button_Switch_THT:SW_Slide_SPDT_Angled_CK_OS102011MA1Q | A small slide switch whose lever points sideways, past the board edge. |
| BT1 | Battery:BatteryHolder_TruPower_BH-331P_3xAA | A holder for three AA cells with two pins for the board, 12.8 mm apart, and two locating holes. |
- 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.
- 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.
- Choose the layer Edge.Cuts in the layer list on the right. Place > Draw Rectangle, and draw any rectangle.
- 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).
- 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. - 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
- 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.
- 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.
| Part | X, Y (mm) | Angle | Why there |
|---|---|---|---|
| BT1 | 163.7, 117 | 180, back | On the back, out of the light, and the lamp's handle. After F, KiCad shows 180°. |
| SW1 | 158, 103 | 180 | On the top edge, lever past the edge, so you reach it with the lamp standing. |
| R1, R2, R3, R4 | 125, 131, 143, 149; all at Y 108.5 | −90 | In a row under the VLED line, each above its own LED. |
| D2, D3 | 131, 127.27 and 143, 127.27 | 90 | The top two LEDs; anode up, straight under R2 and R3. |
| D1 | 132.27, 138 | 180 | Bottom left; anode to the left, toward R1's track. |
| D4 | 141.73, 138 | 0 | Bottom 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.
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.
- 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.
- 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).
- 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.


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.
- 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
- 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.


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.
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.
- KiCad 10 Place > Add Text, layer F.Silkscreen, height 1.0 mm, thickness 0.15 mm (smaller text may not print clearly).
- Add:
UV LAMP 4 x 395 nm(1.5 mm high),Do not look into the LEDs,BAT+andBAT-beside the holder pads, a revision (rev A), and a line of your own. Ours sayssiliconwit.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.
- 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. - In the same dialog, Generate Drill Files: format Excellon, units millimeters, and leave PTH and NPTH in single file unticked. Generate.
- Zip everything in the
gerbersfolder 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.
| Hole | How many | For |
|---|---|---|
| 0.8 mm plated | 8 | resistor legs |
| 0.9 mm plated | 11 | LED legs (8) and switch pins (3) |
| 1.2 mm plated | 2 | battery holder pins |
| 1.5 mm plated | 2 | switch mounting tabs |
| 3.2 mm unplated | 4 | M3 standoffs |
| 4.0 mm unplated | 2 | holder 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
- In the Schematic Editor, KiCad 10 Tools > Generate Bill of Materials, and export as CSV.
| Ref | Qty | Part |
|---|---|---|
| D1 to D4 | 4 | 5 mm UV LED, 395 nm, forward voltage 3.0 to 3.8 V at 20 mA (for example Bivar UV5TZ-395-30) |
| R1 to R4 | 4 | 82 Ω, 1/4 W, 5 %, through-hole |
| SW1 | 1 | slide switch, SPDT, right angle (C&K OS102011MA1QN1 or one with the same pins) |
| BT1 | 1 | 3 × AA holder with two board pins (TruPower BH-331P), or one with wires |
| 4 + 8 | M3 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.
- R1 to R4. Bend the legs to 10 mm, push them through, solder, cut the legs. A resistor has no direction.
- SW1. Solder one tab, check it sits flat and square to the edge, then the rest.
- 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.
- 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.
- 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.
- 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).
- 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.
- 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.
- 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.
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
- Ohm's law on the resistor
I = V / R = 1.05 / 82 = 12.8 mA, against 14.6 mA for the others. ✅
- 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.
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.
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.