KiCad BOM generation

BOM (Bill Of Materials) generation is an important and usually cumbersome part of doing electronics.  KiCad has two ways to generate a BOM: from the schematic and from the layout.

Layout based

In pcbnew select from the menu: File -> Fabrication outputs -> BOM file.

This generates a simple CSV (Comma Separated Value)  file with the components grouped by type and value.

"Id";"Designator";"Package";"Quantity";"Designation";"Supplier and ref";


While useful for simple boards and experiments, in practice you usually want more detail e.g. capacitor voltage in the BOM, as explained nicely in this article from Spark.

Schematics based

KiCad also allows generating a BOM from the schematic. This works by it generating an XML exporting all the data fields for all used components and post-processing this XML with a script. This is nice as it allows to document everything in one place: the schematic.


example component with Fields providing good detail


The biggest disadvantage is that currently it seems to be impossible to save these extra fields as part of a component meaning it involves manual entering for each schematic. Automating this in some way would be nice.

The actual generation of the BOM is done with the menu: Tools -> Generate Bill Of Materials

This gives the following screen:



This may seem a bit daunting but it is actually quite simple. What KiCad does is just generate an XML file with all the components with all the fields. Each plugin is just a script that is passed that XML file as an argument and the output is the resulting BOM.

An example XML fragment:

<comp ref="C12">
    <field name="Voltage">10V</field>
    <field name="Package">0402</field>
    <field name="Identifier">capacitor</field>
    <field name="Tolerance">X5R +-10%</field>
  <libsource lib="passive" part="C"/>
  <sheetpath names="/" tstamps="/"/>


This example python code generates a BOM from the XML, assuming a bunch of standard fields and allowing for extra fields, groups by Identifier and Value.

It uses the beautifulsoup python library for easy parsing of the XML.

P.S.: for the language purists out there: yes, this code is very inefficient (quadratic complexity) but it still runs in milliseconds on a modern computer so it doesn’t matter 😉


It is possible to generate a nice and detailed BOM from KiCad but there is still work making it more automated.

Energy harvesting Workshop

Power is a big constraint for connected products. People want to have a product without a wire or even without cumbersome batteries.
We met Geoffroy from e-peas at the university of Louvain-la Neuve to evaluate their new Energy harvesting chip in our IoT environment.
The goal was to validate the possibility to use energy harvesting for very low power consumption products, even in a dark environment like for home automation sensors.
We successfully did some tests and we want to share the testing details in this article.


Energy harvesting

An energy harvesting chip is a device used to capture and store an external energy source like solar, thermo-electrical or piezzo-electric power and distribute it in the sensor node electronics. This kind of chip provides a really small amount of power but this is enough to run very low-power electronics safety and timelessly.



e-peas is a belgian company located in Liège and founded in 2014. The company is developing two new chips that are key to the design of wireless sensors. First the AEM1x940 is an energy harvester that is claiming a “cold start” at 5 times lower poser conditions than anything on the market and then a 32-bit microcontroller that will consume an order of maginitude less than the competition.
With these chips, we will be able to solve the hassle of replacing batteries and be able to make really autonomous IoT products.
We tested the first prototype of the AEM1x940 and a new version is in progress. The samples for customers should be available in Q4 2015.



First test : Power a Bluetooth Smart module sending only advertising frames
Hardware setting :
We used a Nordic Semi nRF51 PCA10001 dev kit as Bluetooth product.
The power was provided by an outdoor solar panel (ultra low cost) which is connected to the AEM1x940.
To temporarily store the energy from the solar panel, we had to use the capacitors available in the laboratory, so we used a big electrolytic capacitor of 100mF (ultra low cost).
The AEM1x910 has a built-in programmable LDO regulator, so we decided to power the nRF51 board directly by the AEM1x940 at 2.5V.
Software setting :
We configured the nRF51 to send a Bluetooth advertising frame every 5 seconds.
To avoid useless consumption provided by the programming part of the dev kit, we disabled it by switching it off by the provided button.
Testing Environment:
The installation was placed in a dark environment. The curtain was closed to reduce a maximum the sunlight and only one light was lit.
Test validation :
We used a µcurrent tool from EEVblog to analyse the current provided by the solar panel and the current consumption of the nRF51 board.
The current consumption of the nRF51 board was 30uA with peak of 10mA every 5 seconds when the frame was sent.
We also connected an oscilloscope to monitor the voltages of the solar panel and LDO output.
The output voltage was stable.
We analyzed the frames sent with an Android App from Nordic Semi called nRF Master Control. This App allowed to validate that all frames had been received (every 5 seconds).

Second test : Power a microcontroller with Sharp memory LCD and display a dynamic clock
Hardware setting :
We used the Silicon labs Zero Gecko Starter Kit.
The power was provided by the same outdoor solar panel.
To store the energy from the solar panel, we used four big electrolytic capacitors of 100mF because during the startup of the Zero Gecko, it asked for more current then the Bluetooth module used in the first test.
We powered the Zero Gecko board directly by the AEM1x940 at 3V.
Software setting :
We programmed the Zero Gecko board with the clock example available from Silicon Labs. This software displays an analog clock. The seconds hand causes a display refresh every second waking up the board.
Testing Environment:
The installation was placed in a dark environment, the curtain was not totally closed to have a minimum of the sunlight and only one light was lit.
Test validation :
We monitored the current and the voltage with the same tools.
We validated the functioning of the software by looking at the display.

We are really satisfied by the results. We ran a Bluetooth beacon-like device and low power microcontroller with display on only small solar panel. We deliberately chose a low cost solar panel, a low cost energy storage (capacitor) and a very bad light environment to simulate a worst case scenario. The technology proved to be very promising to build autonomous wireless sensors that can work outside or indoor. This can open the door to exciting new applications and products.
We are now waiting for a final sample to continue our analysis.