Electronic Design

Course Overview

This course is a Fab Academy lesson that took place over one week, from February 25th to February 27th, 2025.

On February 25th, we had a first online introduction lesson with Neil, who explained the main concepts of electronic design. This lesson was based on the Fab Academy website (https://fabacademy.org/2026/classes/electronics_design/index.html), which remains accessible at any time as a knowledge base and reference.

On February 26th and 27th, we had a longer in-person class with Dani, who introduced us to more practical aspects of electronic design. During these sessions, we received a tutorial on how to use KiCad. We also learned how to access the Fab Lab component inventory through the following website: https://inventory.fabcloud.io/, which allowed us to add the Fab Lab component library directly into KiCad, so we could only use components actually available for fabrication.


PCB Design — Survivor Game

Microcontroller Choice

During the practical sessions, a first PCB was designed together as a class using the ATtiny412 microcontroller (ATtiny412_SSFR). In order to practice independently and consolidate what I had learned, I decided to design my own PCB using the same microcontroller, staying close to the same concept to avoid overcomplicating things for a first PCB design experience.

To get started, I studied the ATtiny412 datasheet carefully (in the lines that I could undesrtand, of course) in order to understand its features, capabilities, and limitations. Hopefully with AI, it's easier to understand how to understand this datasheet. The ATtiny412 is an 8-bit AVR RISC microcontroller running at up to 20 MHz, with 4 KB of Flash memory, 256 bytes of SRAM, and 128 bytes of EEPROM, all in a compact 8-pin SOIC package. One important constraint is that pin PA0 is reserved for UPDI (the programming interface) and must remain free at all times to allow the microcontroller to be flashed. This leaves only 5 usable I/O pins: PA1, PA2, PA3, PA6, and PA7.

https://www.microchip.com/en-us/product/ATTINY412arrow-up-right

PCB Concept / Game Concept

Given this pin limitation, I designed a simple one-player survival game called. The concept is the following: 3 LEDs represent the player's remaining lives, and a 4th LED acts as a signal light that blinks at an increasingly fast rate. The player must press a single button at the right moment when the signal LED blinks. If the player misses or presses at the wrong time, one life LED turns off. When all 3 lives are lost, all LEDs blink simultaneously to signal game over. The goal is to survive as long as possible as the game progressively accelerates.

This is a really easy to do concept, but a feasible one, and good for training for making my first PCB.

This concept fits perfectly within the 5 available I/O pins:

Pin
Role

PA1

Life LED 1

PA2

Life LED 2

PA3

Life LED 3

PA6

Signal LED (blinking)

PA7

Push button

Components and Bill of Materials

All passive components were chosen in the 1206 SMD format for consistency and ease of hand soldering. The full component list is the following:

  • 1× ATtiny412 SOIC-8 microcontroller

  • 4× Red LEDs (LED_1206)

  • 4× 150Ω resistors (R_1206) — one per LED

  • 1× 10kΩ resistor (R_1206) — pull-down for the button

  • 1× 100nF capacitor (C_1206) — decoupling

  • 1× Tactile push button (Button_CnK_PTS636)

  • 1× 3-pin header connector — for UPDI programming (VCC / PA0 / GND)

Resistor Calculations

LED resistors: The red LEDs have a forward voltage of approximately Vf = 1.9V and a nominal forward current of If = 20mA. With a 5V supply voltage, the required series resistance is calculated as follows:

R = (Vcc − Vf) / If = (5 − 1.9) / 0.02 = 155Ω → standard value: 150Ω

This value was applied to all 4 LED resistors (R1 to R4).

Decoupling capacitor: A 100nF ceramic capacitor is placed between the VCC and GND pins of the microcontroller, as close as possible to the chip. Its role is to filter out high-frequency voltage spikes and ensure a stable power supply to the microcontroller.

Pull-down Resistor for the Button

The push button is connected between VCC and pin PA7. A 10kΩ resistor (R5) is connected between PA7 and GND. This is called a pull-down resistor. Its role is to ensure that PA7 is always at a defined logical level:

  • When the button is not pressed, PA7 is pulled to GND through R5 → the microcontroller reads LOW (0V)

  • When the button is pressed, current flows from VCC through the button to PA7 → the microcontroller reads HIGH (5V)

Without this resistor, PA7 would be in a floating state when the button is not pressed, meaning its value would be undefined and unpredictable, causing random behavior in the program.

Schematic Design in KiCad

In the schematic editor, the components were organized by functional groups to keep the schematic readable: the microcontroller in the center, the LEDs and their resistors grouped together on one side, the button and its pull-down resistor on another side, and the UPDI connector and decoupling capacitor near the power supply symbols.

Rather than drawing physical wires between every component, all connections were made using net labels. This means that components sharing the same label name (for example PA1, PA2, GND, VCC) are automatically considered connected by KiCad, without needing a drawn wire between them. This approach makes the schematic much cleaner and easier to modify when transitioning to the PCB layout phase.

PCB Layout and Design Rules

Before routing the PCB, the design rules were configured in the Board Setup to match the Fab Lab's fabrication constraints:

  • Node classes (Clases de nodos): default settings

  • Clearance (Margen): 0.4mm

  • Track width (Anchura de pista): 0.3mm

Once all components were placed and all traces routed manually, a Design Rule Check (DRC) was run to verify that no errors were present — such as overlapping traces, missing connections, or clearance violations. Once the DRC returned no errors, the electronic design phase was complete.


C'est prêt à être copié-collé. Tu pourras insérer tes photos aux endroits qui te semblent pertinents — par exemple après la section schéma, et après la section PCB layout.

Last updated