Skip to content

6. Design Development Boards

This week we delved deeper into the world of Electronics and Circuit Design.
I learned how custom made development boards can be useful during the prototyping phase, what components commonly make up an electric circuit, and how an EDA tool can assist us in designing a PCB board.
I also made progress with my Final project by considering how the PCB board would function behind my spice rack; how it would recognize spice bottle placement, light up LEDs, communicate with the separate microphone device, etc.
I am looking forward to producing this board in 2 weeks in the Electronics Production week!

alt text

Assignments for this week (Feb 26 - Mar 4):

Group assignment:
- Observe the operation of a microcontroller circuit board using test equipment in my lab.
(As a minimum, demonstrate the use of a multimeter and oscilloscope)

Individual assignment:
- Design a development board that uses parts from the inventory to interact and communicate with an embedded microcontroller, using an EDA tool

Group assignment:

In this week’s group assignment, we learnt the different ways Test Equipments can help us in debugging our boards, through probing (to measure, observe or monitor signals) which help us understand how the circuit/component/device is operating (or failing to).

For example, a multimeter can test; - Components’ resistance, capacitance, and semiconductor properties, verifying if individual components are functioning within their specified parameters. - Continuity of circuits, and Current measurements - by checking if current is flowing between 2 points. Abnormal current draw can indicate issues like short circuits, broken connections, or faulty components. - Voltage measurements at various points on the board, to ensure components are receiving the correct power and signals.

Link to documentation is here.

Designing my own board:

My goal for this week was to design a Development board that can help me with prototyping my Final project.

Before actually designing the PCB, I tried to understand the basic mechanisms of Electronic Circuits, and also clarified the requirements and overall architecture of my Final project (with great help from my instructors!).

Basics of Electronic Circuits
An electrical circuit is simply electricity going around a closed loop. Electricity is generated by the movement of electrons in the loop, from a negative terminal to a positive terminal, which create charges that can power various devices.
When various electronic components are placed in the circuit, they work to control the flow of this electric charge, and through this we can enable different devices to perform different functions.

Electronic components can be classified into "Active" and "Passive" Components;
Passive Components
Passive components are electronic devices that don’t need an external power source to operate actively. They mainly resist, store, or control the flow of electric current or voltage in a circuit without actively amplifying or generating signals. Without these components, assembly of electronic circuit is not possible.
*Resistors, Capacitors, Inductors, transformers, diodes, thermistors* are key examples of passive components.
Active Components
Active components are electronic devices that need an external power source to work. They actively control and manipulate the flow of electric current in a circuit, such as amplification, rectification and switching. *Diodes, Transistors, Integrated Circuits* are key examples of passive components.

These components are connected via conductive material through which electric charge can flow, such as wires or copper traces.
Reference: geeksforgeeks (https://www.geeksforgeeks.org/electronic-components/)

If you’re interested in understanding about components better, I found this documentation page to be a very comprehensive source of information.

Concept and Design Plan

For this week, I decided to prototype a board that would help me prototype the spice rack. My requirements for this board were;
- Bottle Placement Recognition: Awareness of when, where, which spice bottle(s) were placed. Ideally at least about 10 bottles per board (but the more the better!).
- Wireless communication: Ability to receive user request data from smart-microphone device, about which item has been requested (possibly Bluetooth?). Also to communicate with the online database (via Wi-fi?).
- LED output: Send signals to appropriate LED light(s) at the front of punching board, to signal the location of spice(s)
- Debugging feature: A test LED and button, (and some additional useful feature for debugging, if I can think of any useful ones in time)
- Scalability: Ability to scale up with minimal effort in terms of communication, power supply, etc.
- I am not expecting to need a DAC (which is not on ESP32C3). - Size is not so much of an issue for now, as long as it can fit behind the punching board/rack

For full documentation please look at Final Projects page (to be updated later)

As I will outline shortly, the microncontroller available in FabLab Kamakura’s inventory was Xiao ESP32C3 which has limited number of pins, so I needed to think carefully how I could achieve above concept.

My strategy

  • Use 2 Multiplexers (1 for analog input and 1 for digital output) to enable more pins
  • Make special Pin Header for I2C to enable scalability (This board will be a slave board), but they will be used as GPIOs until we need to prototype the scaling part.
  • Debugging features: Only Debugging LED due to limited pins and there is already a Boot button and Test button
  • I will try to create a Power bus to relay power to other boards (again for scalability)

The Microcontroller

For the brain of my board, the Microcontroller, I liked the newly released Xiao ESP32S3 Plus for the many pins, battery charging, low energy consumption, and relatively high performance, but the instructors told me the footprint may be too complex (it’s 1.5 layers) and besides, the footprint data was not released yet (which meant I would have to make it from scratch).
So for the purpose of this week’s task, I eventually settled on Xiao ESP32C3.

Since the board needs to be compatible with this microcontroller, it’s important to examine the Features and Pin out Diagram carefully:
alt text

These are the specs for the Xiao ESP32C3;

Microcontroller Xiao ESP32C3 (Datasheet)
MPU Single-core 32 bit RISC-V, @160MHz
Memory (ROM/SRAM/Flash) 384kB/400kB/4MB onboard Flash
GPIO 11 digital I/O, 3 Analog I/O that can be used as ADC pins
Other Interfaces 1xI2C, 1xSPI, 2xUART, 11xGPIO(PWM), 4xADC, 1xJTAG bonding pad interface
Power Pins 5V out from the USB port (Can also use this as a voltage input but you must have some sort of diode b/2 external power source and this pin with anode to battery, cathode to 5V pin.) / 3V3 (the regulated output from the onboard regulator. Can draw 700mA) / GND
Battery charging pad Supports lithium battery charge and discharge management
Built-in Button & LED Reset Button, Bootloader Button, Charge LED
Energy consumption in deep sleep mode 43μA
Wi-Fi Complies with IEEE 802.11b/g/n protocol and supports Station mode, SoftAP mode, SoftAP + Station mode, and promiscuous mode. Includes external antenna to increase the signal strength.
Bluetooth BLE 5.0 & Bluetooth Mesh
Not included DAC, Touch Sensors
Dimensions 21x17.8mm Single board
Language Arduino / MicroPython
Price $4.99

Rough sketch:
Ideally, we should make a sketch before starting design work on KiCad, but not knowing the workflow, I admit I made this while working on the board layour part, (when I started struggling with remembering the whole layout). During this step, it’s helpful to draw the power lines (VCC) in thick red, and Ground lines in thick black.

alt text

Designing on EDA

EDA (Electronic Design Automation) is a software that assists in designing circuit boards.
I used KiCad, which is a free and open-source suite of EDA. It supports schematic design, PCB layout, and circuit simulation.

First I downloaded KiCad Ver. 8 and FabLab’s Library of Footprints and symbols and added them to my library.
Steps: On KiCad, go to Preferences > Manage Symbol Libraries > Add existing library > select the file, fab.kicad_sym. Do the same for fab.pretty.

Schematic Diagram

A schematic diagram is a symbolic representation of the circuit, outlining all the components used and how they are connected. It does not represent the physical layout of the board, which will be updated in later stages.

I started to make a Schematic diagram by referring to this tutorial.

The below hotkeys were useful in creating the schematic.

hotkeys:
A   Add a new symbol to the sheet
R   Rotate
M   Move (wires will be disconnected)
G   Grab and move a symbol while keeping wires connected
L   add a Label
W   Start drawing a Wire
V   edit Value
E   PropErties

At first, I attempted to make a schematic that includes some Multiplexers, but my instructors told me it is not a good idea to fabricate complex boards before testing the circuit (to check component connections and electrical functionality). Considering the limited time, I decided to make a simpler board that would be compatible with Multiplexers down the line.

Power
The first component to add in the schematic is PWR_FLAG, to inform KiCad where the power (and GND) comes from.
alt text

These are the Power pins available on Xiao ESP32C3;
- 5V - The 5v out from the USB port. This can also be used as a voltage input but you must have some sort of diode (schottky, signal, power) between my external power source and this pin with anode to battery, cathode to 5V pin.
- 3V3 - The regulated output from the onboard regulator. I can draw 700mA.
- 1 GND - Power/data/signal ground

Generally, it’s good practice to draw the Power flag at the top of the screen, and Ground at the bottom.

Multiplexers
Since the 3 Analog pins available on the Xiao board won’t be not enough, I am going to add Multiplexers to enable more I/Os. 1 Multiplexer will be for analog input, to receive information from input sensors, and 1 will be for LED (digital) output.
alt text
Apparently, 3 Analog pins can enable an 8-channel Analog multiplexer.
Since these will need to connect to Ground, I also added a couple of Ground Pin headers.
I also created Power out for each of the Multiplexers.

I2C
For communication with the Master board, I initially added SPI connectors but Rico told me I2C is more appropriate.
So I made a special Pin Header for I2C connection. I also added some more Power input, which can hopefully be used to scale with Power bus.
alt text

During the prototyping phase when I2C is not being used, these pin can also be used as GPIOs.

Debugging LED
There was one remaining IO Pin, so I decided to assign a debugging LED. I added LED and resistor components, and for the resistor; set a value of 470mA.
alt text

Wire Connections
Once happy with the overall schematic, I connected wires to each pins and added corresponding labels.
alt text

Electrical Rules Check (ERC)
It is important to ensure the schematics are complete and accurate before moving onto designing the physical layout.
I pressed “Electrical Rules Check” and debugged the schematic. I had one error that was to do with missing the Power Flag on my Ground, which I added. There was also one warning about D7 and D8 being connected. I checked and indeed there was a unnecessary wire connecting the 2, so deleted it.
alt text

After this step, normally I would need to associate the components with footprints, but I had checked during component placement in the footprint preview that correct footprints are assigned already. This is the benefit of using fab components; the appropriate footprints are already associated.
If for some reason we are using components without footprints, we would open Footprint Assignment Tool and assign them manually.

A footprint is the graphic representation of where the components will touch the copper pad on the PCB. These are the areas upon which components will be soldered onto.

Board Layout

Once there are no remaining errors, I can start making the board layout, laying out each parts, and draw in the traces between them.

Traces are the conductive pathways, typically thin lines of copper, that allow electrical current to flow along them, enabling communication and power delivery between different components such as resistors, capacitors, Integrated Circuits. - PCBgogo

Press the F8 key, which will open the Layout editor with the schematic design reflected.

The first thing to do before updating the layout is to set the “Design Rules” based on the milling process, such as minimum trace width, clearance, etc. For example, since we are using a 1/64 inch (=0.396875mm) endmill to mill our trace lines, we need set the minimum trace width to >0.4mm. Also, minimum clearance should be set to > 0.4mm to prevent shorts, ensure signal integrity, minimize electromagnetic interference (EMI), and allow for proper manufacturing and assembly.
Also ,the Power lines need to be set thicker, so they can carry the large current. Thicker lines also have less resistance, which helps prevent overheating issues and board damage, and reduce the voltage drop. To set these design rules I pressed the “Board Setup” icon and updated the “Constraints” and “Net Classes” as below.
alt text

To make the Trace connections, these hotkeys are useful to know;
- X > draw trace lines
- D > move component with trace connections, or reshape trace lines

An important consideration when making the layout and connections is making sure the Power and Ground lines wouldn’t cross (as this would create a short circuit).

my design would need complex maneuvering to make sure Ground lines and Power lines wouldn’t cross (which would create short circuits). So I reordered the VCC and Ground pins on the schematic to make the layout more practical to wire.
Once done, my instructors gave me some feedback, so I changed some parts.
- Pin Headers: Changed from through-hole (THT) to surface-mount-type (SMD), as these are more recommended for FabAcademy
- Power lines and Ground lines: Try to make them more far apart to prevent short-circuits
- Pin Headers: Separate Power headers and IO headers into separate Headers to avoid connection mistakes
- Make the connection lines cleaner - avoid small squiggly lines as much as possible

alt text

Board Layout Considerations:
For the Board layout, I did some extra reading up to understand best practices for ensuring the board functions correctly and at optimum performance, while meeting production requirements (milling, assembly, etc), and also minimising unnecessary costs. I will keep these in mind especially when designing more complex boards;
- Component placement and routing: Take into account how the board will be used and packaged. In my case, I wanted to connect to multiplexers on both sides of the board, and have I2C and Power bus at the bottom.
- Power Distribution: To deliver clean and stable power to all parts of the board, try best to;
- Minimise voltage drops across the board, through effective placement of components and routing
- Reduce excessive noise and EMI, and other power related issues
- Thermal Management: Prevent overheating, thermal stress on components and ensure consistent performance across different environmental conditions. This will ensure consistent performance, reliability and lifespan of the electronic components.

Once happy with the layout, I performed a Design Rules Check to ensure there are no errors.
alt text

Finally, I moved to the Edge Cuts layer and cut out the board edge. I decided to make one corner rounded to indicate the analog side.
alt text

Design Files:

Reflections:

This week I managed to understand the basics workings of Circuit boards. There were lots of concepts and vocabulary to cover, but yet I’ve only covered the bare basics. These two Introductory books were especially helpful for me.
Book

I also learnt how to use KiCad to design my own custom Circuit Board.

I also made good progress with my Final Project and came up with some more questions such as;
- How to use magnets for the rack while preventing EMI??
- How I will enable the circuit to automatically switch to Deep sleep mode?
- For Power source, I was initially hoping to use a rechargeable battery to avoid too many Power chords on the Kitchen counter, but I will need to do a Power Budgeting. Also, how to achieve power bus?
- What is PWM Pins?
- Benefits of Neo-Pixel type LED over normal LED?

Assignment Checklist:

  • [ x ] Linked to the group assignment page
  • [ x ] Documented what I have learned in electronics design
  • [ ] Checked my board can be fabricated
  • [ x ] Explained problems and how I fixed them
  • [ x ] Included original design files (Eagle, KiCad, etc.)
  • [ x ] Included a ‘hero shot’