← Back to list

Creating A Custom Component in KiCad

Building Your Own KiCad Library Part for a Cheap TFT Module

John OSullivan · 2026-05-03 12:49 · 0 claps · 16.4 min read
#kicad #zephyr #zephyrrtos #linux #printed-circuit-board
Open on Medium ↗
Wiki topics: 🔓 · Open Source 📚 · Books & Reading

Creating A Custom Component in KiCad

Building Your Own KiCad Library Part for a Cheap TFT Module

In the world of the hobbyist, KiCad is a vital resource. It’s free, it’s capable enough to design real boards, and it has a generous library of standard parts ready to drop into your schematic. But sooner or later you’ll reach for a cheap module on AliExpress or eBay, and discover that no standard library covers it. Sometimes the part has a datasheet but no symbol exists. Sometimes there isn’t even a datasheet, just a photo and a vague description on the seller’s page. That’s where knowing how to roll your own becomes useful.

In this article we’ll walk through the full process of creating both a custom schematic symbol and a custom footprint for one of the most common hobbyist displays out there: the 1.8-inch 128×160 SPI TFT module based on the ST7735R driver, the kind that comes with a microSD card slot soldered to the back and a 16-pin breakout header along one edge. By the end you’ll have a re-usable library part you can drop into any future project, and (more importantly) a workflow you can apply to any other oddball part that crosses your desk.

A quick note before we start: this article assumes you’ve used KiCad before, at least to the level of placing a few parts on a schematic. If you’ve never opened the Symbol Editor or Footprint Editor, that’s fine, but you may want a basic introduction to those tools first. Everything I show is from KiCad version 10.

What you’ll need

  • KiCad 10 installed and running.
  • The physical module in your hand. This matters more than you’d think, because we’re going to measure it.
  • A pair of vernier calipers, or, failing that, a breadboard or veroboard. A breadboard is surprisingly accurate for measuring header positions, because the holes are guaranteed to be on a 2.54 mm pitch.
  • A photo of the module taken from directly above. We’ll use this as a tracing template inside KiCad.
  • A personal symbol library and a personal footprint library. If you don’t have these yet, create them now via Preferences > Manage Symbol Libraries and Preferences > Manage Footprint Libraries. I’ll be using ones called zephyr_course for both.

Knowing what you’re looking at

Before we open KiCad, the most useful thing you can do is spend ten minutes understanding the part. A symbol is just a structured way of describing the electrical pinout. A footprint is just a structured way of describing the physical pad pattern. If you can’t write those two things down on paper, you can’t make them in KiCad.

For our TFT module, here’s what we know:

  • It’s a 1.8-inch 128×160 colour TFT display.
  • The driver IC is an ST7735R (or sometimes ST7735S, very similar).
  • It uses 4-wire SPI for control.
  • The PCB is roughly 45 × 53 mm.
  • There’s an onboard AMS1117 3.3 V regulator, so the module can run from either 3.3 V or 5 V depending on a solder jumper called J1.
  • There’s a microSD card socket on the back, with its own SPI signals brought out separately.

The pinout, taken from the silkscreen on the module itself, gives us 16 pins on the bottom-edge header:

Our proposed pin layout

Our proposed pin layout

A second, shorter 8-pin header on the right edge brings out a subset of the same TFT signals (no SD card pins on this side). Because both headers are wired to the same nets, we’ll model this in the footprint by sharing pin numbers between the two headers, rather than treating them as separate pins.

That single decision will matter later, so it’s worth flagging now: when we place pads for the right-edge header, they’ll be numbered with the same numbers as the corresponding pads on the bottom-edge header. KiCad doesn’t care that two pads share a number; it treats them as electrically connected.

Creating the symbol

Open the Symbol Editor from the KiCad project manager. In the left panel, find your personal library (zephyr_course for me) and click on it to make it the active library. Then go to File > New Symbol.

Creating the new symbol

Creating the new symbol

KiCad will ask for a few details:

  • Symbol name: TFT_ST7735R_128x160_SD
  • Default reference designator: U
  • Number of units per package: 1

New symbol dialog

New symbol dialog

Click OK, and you’ll see an empty editing canvas with two text labels stacked at the origin: the reference designator (U) and the symbol’s value (the symbol name). They’ll overlap each other, which is normal. We’ll move them later.

Empty symbol canvas showing the U reference at the origin

Empty symbol canvas showing the U reference at the origin

Planning the pin layout

Before placing any pins, it’s worth sketching the layout. A good symbol groups related signals together, so the schematic reader can see at a glance what’s going on. For this module I went with:

Our Proposed Layout

Our Proposed Layout

  • Power on the right side: VCC at the top, GND at the bottom.
  • TFT control and SPI signals on the left, upper half: BL, RST, RS, SDA, SCK, CS.
  • SD card signals on the left, lower half: SD_CLK, SD_MISO, SD_MOSI, SD_CS.
  • The four NC pins on the right side, between VCC and GND.

That grouping puts a small visual gap between the TFT and SD signals on the left side, which makes the functional split obvious without anyone having to think about it.

Placing the pins

From the right-hand toolbar, select the “Add a pin” tool (or press P). Click on the canvas to start placing the first pin. KiCad will open a dialog asking for the pin’s properties.

For pin 1, GND, we want:

  • Pin name: GND
  • Pin number: 1
  • Electrical type: Power input
  • Orientation: Left

Placing pin 1

Placing pin 1

That orientation is the bit that catches everyone out the first time. KiCad’s “orientation” describes the direction the pin line extends from its anchor, not which side of the body it lives on. So a pin sitting on the right edge of the symbol body, with its anchor on the right, has orientation Left. The pin line extends leftward into the body, and wires in the schematic connect to the anchor on the outside.

Pin 1 in place

Pin 1 in place

Click OK, place the pin, and press Escape. You should see something similar to the images above. Then repeat for each of the 16 pins, using this table:

Our pin layout

Our pin layout

A few notes on the choices:

  • BL is Input because, from the module’s perspective, it’s a signal driven by your microcontroller.
  • SD_MISO is Output because the SD card drives data out of the module to your microcontroller. All other SPI lines are inputs.
  • The four NC pins are Unconnected so KiCad’s electrical rules check (ERC) won’t complain when they’re left floating in the schematic.

All pins placed

All pins placed

Drawing the body rectangle

With all the pins placed, the symbol still needs a body to enclose the inner pin ends. Select the rectangle tool from the right-hand toolbar (or Place > Add Rectangle), and remember it’s a click-once-to-start, click-once-again-to-end tool. Don’t drag.

Rectangle tool

Rectangle tool

The rectangle should enclose all the pin name labels but leave the small anchor circles outside. Drop the first corner just inside the upper-left pin’s anchor, then click the second corner just inside the lower-right pin’s anchor.

Completed symbol with body rectangle

Completed symbol with body rectangle

Saving the symbol

Open File > Symbol Properties and fill in:

  • Description: 1.8 inch 128x160 SPI TFT LCD module, ST7735R/S driver, with onboard AMS1117 3.3 V regulator and microSD card socket. 16-pin dual-row breakout.
  • Keywords: TFT LCD ST7735 ST7735R ST7735S SPI display 128x160 microSD MSP1804

Symbol properties

Symbol properties

These two fields are what KiCad searches when you type into the symbol picker dialog later, so they’re worth filling in properly. Click OK and press Ctrl+S to save.

Creating the footprint

Symbols and footprints live in separate libraries in KiCad, so before we start, make sure you have a personal footprint library (a .pretty folder registered with KiCad). I use zephyr_course for both my symbols and footprints, but they are technically two different libraries with the same name.

Open the Footprint Editor from the project manager, click your library in the left panel to make it active, and use File > New Footprint.

Our new foorprint

Our new foorprint

KiCad creates a new empty footprint called “Untitled”. Open File > Footprint Properties, and rename it to : TFT_ST7735R_128x160_SD_Module.

Footprint properties

Footprint properties

While you’re in that dialog, fill in the description and keywords too:

  • Description: 1.8 inch 128x160 SPI TFT LCD module with microSD card socket. Dual through-hole pin headers, 16-pin (bottom) and 8-pin (right edge), 2.54 mm pitch.
  • Keywords: TFT LCD ST7735 ST7735R ST7735S display 1.8 inch module microSD MSP1804 Note the naming convention: the symbol’s name describes the electrical part (TFT_ST7735R_128x160_SD), while the footprint’s name describes the physical package (TFT_ST7735R_128x160_SD_Module). They don’t have to match.

Press Ctrl+S to save the empty footprint to the library.

Tracing from a photograph

There are two ways to position pads in a footprint: by typing exact coordinates, or by tracing on top of a reference image. For a part with a datasheet you’d just type. For a cheap hobby module with no documentation, tracing from a good photo is often more reliable than reading off a tape measure.

KiCad 10 makes the tracing workflow straightforward. Use Place > Add Reference Image and pick a top-down photo of the module. The image will follow your cursor; click to drop it on the canvas.

Placing an image

Placing an image

Reference image just imported, before scaling

Reference image just imported, before scaling

The image is now in your footprint, but at whatever arbitrary size KiCad assigned. Before we trace anything, we need to calibrate it. Click the image to select it, then press E to open properties. You’ll see fields for Width and Height in millimetres, and a Scale value. The aspect ratio is locked to the image’s native proportions, so we can only set one dimension; the other follows. This is where it pays to have measured the module physically. With my vernier, the PCB measured 53.63 mm by 45.65 mm. I typed 45.65 into the height field (the short edge of the board, vertical in the photo as I oriented it), and KiCad calculated the width to match. Click OK.

To verify the calibration, use the measure tool (Inspect > Measure Tool) and check the distance between two adjacent pin holes on the 16-pin header.

Measuring distance

Measuring distance

They should be 2.54 mm apart, since that’s the standard header pitch. If you’re measuring on a fine grid, you should land somewhere between 2.5 and 2.6 mm. The remaining error is due to perspective distortion in the photo, which we’ll handle by snapping pads to a grid rather than to image features. A little quirk to be aware of: KiCad’s measure tool snaps to the active grid by default. If you have the grid set to 0.1 mm, you can’t read distances finer than 0.1 mm. Either set a finer grid temporarily, or hold Ctrl while clicking to bypass the snap. With the grid set fine enough, repeated measurements between pins should hover around 2.54 mm. If your image’s calibration is off by more than a couple of percent, it’s worth re-cropping the photo more tightly to the PCB edges and reimporting. Whitespace around the board throws off the calibration.

Anchoring pin 1 to the origin

Once calibrated, we want to position the image so that pin 1 of the 16-pin header sits exactly at coordinates (0, 0). This gives the footprint clean, predictable pad coordinates and matches the convention most KiCad libraries use. Set the grid fine (0.1 mm or so) so you can place precisely. Click the image, press **M** to move it, and drop it so pin 1 of the 16-pin header sits over the origin crosshair. Don’t worry about being pixel-perfect; the next step will fix any small misalignment.

Aligning the first pad

Aligning the first pad

Placing the 16-pin header pads

Now switch the grid to 2.54 mm. This is the magic step that makes pad placement effortlessly correct. With a 2.54 mm grid, every click will land exactly one pin pitch away from the previous one, regardless of how accurate the underlying image is.

Setting the grid size

Setting the grid size

Use the “Add a pad” tool from the right-hand toolbar. Click to place pad 1 at the origin. KiCad will open the pad properties dialog.

Set:

  • Pad type: Through-hole
  • Pad shape: Rectangle (this is our pin-1 marker)
  • Pad size: 1.7 × 1.7 mm
  • Hole shape: Round
  • Hole diameter: 1.0 mm
  • Layers: All copper layers, plus F.Mask and B.Mask (this is the default for through-hole pads)

Pad 1

Pad 1

The 1.7 mm pad on a 1.0 mm drill gives a 0.35 mm annular ring, which is comfortably above the manufacturing minimum and easy to hand-solder. Click OK.

For the remaining 15 pins, use the same settings except change the pad shape to **Circle** (only pin 1 is rectangular, as a visual marker).

Second pad

Second pad

The pad numbers will auto-increment as you place each one. Place pads 2 through 16, clicking down the column. Each click should snap to the next 2.54 mm grid point. After placing all 16, hover over pad 16 and press E to verify: its position should be (0, 38.10) since 15 pitches × 2.54 mm = 38.10 mm.

All 16 pads of the bottom-edge header placed

All 16 pads of the bottom-edge header placed

Placing the 8-pin header pads The 8-pin header on the right edge of the module needs a known horizontal offset from the 16-pin header. Measuring this from the photo gave me about 49.76 mm, but I wanted better accuracy than that. The trick: plug the module into a breadboard. Breadboards have a guaranteed 2.54 mm pitch, so by counting holes you can read the offset exactly.

Lay the board on some veroboard

Lay the board on some veroboard

With pin 1 of the 16-pin header in breadboard hole 1, pin 1 of the 8-pin header sat in hole 21. That’s 20 pitches, or exactly 50.80 mm.

Similarly, the vertical offset from pin 1 of the 16-pin header to pin 1 of the 8-pin header was 4 breadboard rows, or 4 × 2.54 = 10.16 mm.

Now for the pad numbering. Because both headers are wired in parallel on the module itself, they share electrical nets. The footprint should reflect this by reusing pin numbers rather than treating the 8-pin header as separate pins. So the 8-pin header pads, top to bottom, are numbered: 6, 10, 7, 8, 9, 2, 4, 1. That sequence reads strangely at first, but it’s correct. Pin 6 of the 8-pin header (RST) is the same net as pin 6 of the 16-pin header (also RST), so they share the number. The full position list:

Eight pin header list

Eight pin header list

All circular, 1.7 mm diameter, 1.0 mm drill. Place them either by clicking on the canvas and editing each one’s properties, or by directly typing coordinates in each pad’s properties dialog.

Both headers complete, with reference image still visible behind

Both headers complete, with reference image still visible behind

Silkscreen and labels

With pads placed, the next job is the silkscreen layer. This is what gets printed in white (or whatever your fab uses) on the actual PCB. It doesn’t carry electricity, but it carries information.

For this footprint we want three things on the silkscreen:

  • A rectangle around the module, showing where the body sits on the PCB.
  • A small marker indicating pin 1.
  • Labels next to each pad showing the signal name, so you can see which signal they’re connecting to even after the module is plugged in.

That last point is worth thinking about. Many footprints put silkscreen labels close to the pads, often inside the footprint outline. That’s fine if the module is removed for inspection, but here we want labels visible while the module is plugged in. So the labels need to sit OUTSIDE the silkscreen rectangle, on the host PCB area beyond the module’s body.

The silkscreen rectangle

Switch the active layer to F.Silkscreen. Use the rectangle tool (Place > Add Rectangle), and after placing it roughly, press E to set exact coordinates:

  • Start point: X = -1.41 mm, Y = -3.45 mm
  • End point: X = +52.21 mm, Y = +41.55 mm
  • Line width: 0.15 mm
  • Layer: F.Silkscreen

Placing the rectangle

Placing the rectangle

These coordinates were derived from the module’s measured size (53.63 × 45.00 mm) plus a small offset on each side so the body of the module sits comfortably inside the rectangle.

Silkscreen rectangle drawn around the pad area

Silkscreen rectangle drawn around the pad area

The pin-1 marker

The rectangular shape of pad 1 is itself a pin-1 marker, but convention adds a second one on the silkscreen for visibility. A small filled circle just outside the rectangle near pin 1 does the job:

  • Use the circle tool on the F.Silkscreen layer.
  • Place a small circle at roughly X = -1.0, Y = -1.0.
  • Diameter about 0.6 mm, filled.

Pin-1 marker visible at top-left

Pin-1 marker visible at top-left

Pad labels

Now the labels. With 24 pads to label, this is the most tedious part of the whole exercise, but it makes the footprint genuinely useful as a teaching aid.

Each label is a text item on F.Silkscreen, with these common properties:

  • Text height: 1.0 mm
  • Text width: 1.0 mm
  • Thickness: 0.15 mm
  • Layer: F.Silkscreen

For the 16-pin header on the left, all labels sit at X = -3.0 mm, right-justified, so the text reads up to (but not over) the silkscreen rectangle. The Y coordinate matches each pad’s Y position. So label “GND” goes at (-3.0, 0.0), “VCC” at (-3.0, 2.54), and so on.

For the 8-pin header on the right, labels sit at X = +53.8 mm, left-justified, so they start just outside the silkscreen rectangle and read away from the module.

The complete label list:

16-pin header (left): GND, VCC, NC, BL, NC, RST, RS, SDA, SCK, CS, SD_CLK, SD_MISO, SD_MOSI, SD_CS, NC, NC.

8-pin header (right), in order from top to bottom: RST, CS, D/C, DIN, CLK, VCC, BL, GND.

Place all 24 labels. After the first one, KiCad’s text tool remembers the formatting, so for subsequent labels you only need to change the text and the Y coordinate.

Footprint with all labels in place

Footprint with all labels in place

Cleanup and save

A few finishing touches before saving:

  1. Click the reference image and press Delete. We don’t need it any more, and it shouldn’t be saved with the footprint.

  2. Move the **REF**** text field above the silkscreen rectangle, centred horizontally. Hover over it and press M, then place it.

  3. Move the footprint name (the value field, showing TFT_ST7735R_128x160_SD_Module) below the silkscreen rectangle, also centred.

  4. The **${REFERENCE}** text on the F.Fab layer can be left where it is. It only appears in fabrication views, not on the physical board.

Press Ctrl+S to save the footprint to your library.

Linking the symbol to the footprint

KiCad stores symbols and footprints separately, and they need to be told about each other. Without this link, you’d have to manually pick a footprint every time you place this symbol in a schematic.

Open the Symbol Editor (not the Footprint Editor), find your TFT_ST7735R_128x160_SD symbol in the left panel, and open its File > Symbol Properties dialog.

Assigning the footprint

Assigning the footprint

In the Fields list, find the Footprint row. There’s a small icon at the right end of that row (a folder or an ellipsis). Click it. The Footprint Library Browser opens.

Navigate to your footprint library, click on TFT_ST7735R_128x160_SD_Module, and confirm the preview on the right looks like your footprint. Double-click to select it.

Back in Symbol Properties, the Footprint row now shows:

zephyr_course:TFT_ST7735R_128x160_SD_Module

Click OK and press Ctrl+S to save the symbol with its new link.

Testing the part in a project

It’s worth doing a quick test to confirm the whole thing works before relying on it in a real design.

Create a new (throwaway) KiCad project. Open the schematic editor and use Place > Add Symbol. Search for the symbol name or just browse to your zephyr_course library and pick your symbol. Place one instance.

Run the Electrical Rules Check (Inspect > Electrical Rules Checker). For a single un-wired symbol it’ll warn about unconnected pins but shouldn’t show critical errors. Wire up the power pins to see ERC pass on those.

Switch to the PCB editor and update from schematic (Tools > Update PCB from Schematic). The footprint should appear with all 24 pads correctly numbered, and KiCad should report no missing footprints. Check that the labels are visible on the silkscreen layer.

If all that works, your part is fully integrated. You can use it in any future project just like a built-in part.

Wrapping up

Creating a KiCad library part isn’t difficult, but the first time through you’ll inevitably hit a few of the quirks I’ve called out along the way: pin orientation logic, image calibration drift, the “save” gotchas. After one or two parts, those become second nature.

The bigger lesson is that the workflow is repeatable. Any oddball module you find on a hobbyist marketplace can be turned into a proper KiCad part in an afternoon, and once it’s in your library it’s there forever. That’s a powerful thing for anyone who wants to design real boards around real-world cheap parts.

Happy designing!

Ready to Upskill?

Zephyr Training Course

Are you ready to graduate from simple loop-based programs to professional-grade multitasking with the industry’s most versatile RTOS? Zephyr is a modern, industry-backed platform designed specifically for real-world IoT products, scaling from tiny microcontrollers to capable edge devices. In my course, we use the powerful ESP32-S3 to master Zephyr, including the west meta-tool and the DeviceTree hardware description language. You will learn to build scalable, reliable data pipelines using the producer-consumer pattern to move data safely between independent threads. Whether you are creating interactive web controllers or integrating high-speed SPI sensors, this course provides the structured foundation and portable skills required for today’s embedded engineering demands. The course is available on Udemy.

If you want to stay relevant throughout the AI revolution then dive deeper into programming and become one of those engineers who can integrate, review, and reason across AI-assisted systems.

Check out **Part One and [Part Two](https://www.udemy.com/course/linux-debug-training-part-2/?referralCode=1FAF95060F47194A895F) of the [Linux Debugging Training Course](https://www.udemy.com/course/linux-debug-training-part-1/?referralCode=6534D858AEF9555AB23F). This course is a collaboration between my colleague [Manas Marawaha](https://medium.com/@manas.marwah)** and myself. We have combined our many years of experience in developing and debugging Linux systems to create a comprehensive technical guide that consolidates our knowledge.

This course offers a structured approach to Linux debugging, covering the entire stack — from user-space to kernel-space.

Join the course today! Access it via these links: Part 1, Part 2


메타데이터
post_id
015d7ff27c87
slug
creating-a-custom-component-in-kicad-015d7ff27c87
url
https://medium.com/@johnos3747/creating-a-custom-component-in-kicad-015d7ff27c87
canonical_url
https://medium.com/@johnos3747/creating-a-custom-component-in-kicad-015d7ff27c87
author_url
https://medium.com/@johnos3747
status
ok
fetched_at
2026-06-24 18:57:25