Building and Certifying an Open-Source IoT Controller, Part 3: Manufacturing and Testing
This four-part series walks through the development of the Anthilla Controller, an open-source Internet of Things (IoT) hardware platform. In Part 3, we cover the manufacturing, assembly, and product testing of the board.
Part 1 of this series discussed the design requirements of the Anthilla Controller (or AnthC). In Part 2, we learned about the process of obtaining the AnthC’s open-source certification. This installment describes the process—and challenges—of actually building the Anthilla Controller, from sourcing components to testing the first prototypes.
Updating the Design
Due to shortages of raw materials and finished components, the last few years have been difficult for the electronics industry. Like many other projects around the world, the AnthC project suffered from the lack of materials, which provoked delays and cost increases. The need to replace components also generated new stages within the design process, giving us the opportunity to make a few beneficial modifications before assembly.
The first version of the Anthilla Controller used a PCB assembler located in China, and some of the specific components that went into it were only available in that country. Most of the time, this wouldn’t be a problem—it reduces the final price, since the assembler can obtain these components relatively cheaply and without paying import fees. This is particularly beneficial for small-scale production runs like the AnthC’s.
When the global supply situation changed, we had to adjust our priorities. Now availability and lead time, rather than price, drove our decision-making. Ultimately, we replaced the exclusive components with ones available from large distributors, such as Mouser, Digikey, and Farnell.
Replacing the components enabled us to use an assembler located in Europe for the new version of the AnthC. Since the design team was also based in Europe, this reduced the new prototypes’ shipping time.
Design for Manufacturing and Testing
In addition to replacing obsolete components, we used this time improve the board’s the Design for Manufacturability (DFM) and Design for Testing (DFT) through the following modifications:
- Adjusted all the vias to the same size (hole diameter of 0.3 mm, copper pad diameter of 0.6 mm). This provided us the best trade-off between the required density and the price of the board.
- Added test points to all the important voltage measurements on the bottom layer. This allowed the board to be tested in a production line using a test bed (Figure 1).
- Improved the silkscreen readability of components where the polarity was critical, such as diodes. In a previous version of the board, all the diodes had been assembled with the incorrect polarity.
- Reduced the number of different components in the Bill of Materials (BOM) through unified manufacturing part numbers.
Figure 1. PCB test beds are critical to quality control in mass manufacturing. Image used courtesy of SparkFun
Manufacturing and Assembly
Once all the improvements were implemented, the time for manufacturing arrived! Due to their popularity, we explored JLCPCB as a possible manufacturer and assembler. JLCPCB offers low prices, which was a definite point in their favor.
Less favorably, JLCPCB’s process requires extra work on the part of the designer, as well as potentially complicating the supply chain. Fortunately, there’s a learning curve, and the process becomes more intuitive with repetition.
Providing the Files
For ease of reading, and to allow them to automatically search for the correct references, JLCPCB requires users to upload the manufacturing and assembly files in specific formats. The manufacturing files need to be Gerber files. These are easy to generate using KiCad, and exporting them is equally straightforward.
The assembly file requirements, however, are more specific and potentially trickier to get right. Formatting the BOM correctly can be particularly time consuming. Thankfully, the open-source community is very active, so there’s a plugin called JLC-Plugin-for-KiCad that can help. The main features of this plugin are:
- Generates the necessary Gerber files in an acceptable format.
- Generates the BOM and Pick and Place files in formats usable by JLCPCB.
- Adds the JLCPCB part number to the BOM. JLCPCB uses their own part numbers to search for components.
- Adds a field correcting the component offset. The offset of a user-defined component might differ from the one defined by the JLCPCB libraries—this feature saves having to correct the offset when ordering the PCBA.
Once the Gerber and BOM files were uploaded, it became possible to visualize the PCBA in KiCad (Figure 2). I also found it interesting to see the PCB holders used to assemble the components on the board. Figure 2 doesn’t include terminal connectors because those were manually soldered afterward.
Figure 2. Anthilla Controller PCBA. Image used courtesy of Ignacio de Mendizábal
Ordering the Components
JLCPCB stocked many, but not all, of the components required for the Anthilla Controller board. For components they don’t stock, they offer the option of ordering and storing the components for use in future assemblies. You can also order the parts yourself and ship them to JLCPCB.
No matter which option you decide on—or which assembler you choose—it’s important to check the Minimum Order Quantity (MOQ) when placing an order. The MOQ is determined by:
- The minimum quantity that the component seller requires for a purchase.
- The number of components you need to install on your boards.
- The attrition quantity, which refers to the number of spare parts the assembler requires in case something goes wrong during the assembly process.
If you initially fail to meet the MOQ, you’ll have to put in an additional order to make up the difference before assembly can begin. In particular, make sure to check the attrition quantity. It’s better to spend a little bit more on spare components at the start than have assembly delayed by days or weeks while you wait for an extra shipment to arrive.
For preliminary tests, we needed to write some code in Arduino Programming Language. A sample of this can be found in Table 1.
Table 1. A snippet of the code used to test the Anthilla Controller.
Thankfully, there were many code libraries already available, which sped up development. We used the following libraries:
- MCP3XXX: to access the Analog to Digital Converter (ADC) MCP3464T-E_NC
- MCP7940: to access the Real Time Clock (RTC) MCP7940N-I/SN.
- arduino-i2c-sht4x: to access the Sensirion temperature and humidity sensor SHT40-AD1B-R2.
We followed a modular approach. Each module could be activated or deactivated if needed. This allowed unit testing of each area of the board, isolating problems so that each one could be tackled separately.
During the testing phase, some points required special attention or modifications. For one thing, the control circuit of the converter LM2735 wasn’t behaving properly: logic levels when the battery was connected didn’t go high or low enough to enable the converter. To deal with this problem, we replaced the resistors R30 and R11.
The new resistors allowed switching between the battery and a DC power supply, namely the boost converter U12. Before this adjustment, R30 and R11’s logic levels wouldn’t have been high or low enough to activate or deactivate the boost converter. Figure 3 shows the resistors before and after the changes.
Figure 3. Resistors R11 and R30 before (left) and after (right) modifications. Image used courtesy of Ignacio de Mendizábal
Also, the coin cell holder was mistakenly made for a CR2430 battery instead of a CR2032 battery. This wasn’t a big problem—we could, and ultimately did, use a CR2430 for the prototype. In the final version, however, we replaced the connector with one for a CR2032, taking the chance of using a surface-mount device instead of a through-hole one.
At this point in the process, the Anthilla Controller’s main functionalities all work. Production becomes smoother; solutions for the problems we’ve detected will be implemented in the next version. More work remains, however.
For the AnthC to be sold in Europe, our target market, it needs to undergo Electromagnetic Compatibility (EMC) testing and comply with European Union directives regarding health, safety, and environmental impact. The final article in this series explains these legal requirements and how to meet them, hopefully demystifying the process.
Editorial note: The Anthilla Controller’s initial development, testing, and manufacturing was made possible by funding from Anthilla, but the company is not currently involved with the project. Neither All About Circuits nor the author of this article receive any financial benefit from Anthilla for the article’s publication.