Tag Archives: adafruit

A New Modular CMake Based Toolchain for Feather M0 HAL

In the past months, I developed firmware for a few Adafruit Feather M0 based projects. The reason why I use the Adafruit Feather platform, instead of using an MCU directly, is for modularity.

By using a board on sockets, it can be replaced at any later time with a more powerful one – or by one with additional peripherals.

The only downside of these boards is the programming toolchain. Either you use the Arduino IDE, or solder wires to the board to program the MCU directly using, e.g. Atmel Studio.

Using the Arduino IDE, I am bound to some really horrible written libraries. It is probably a good thing if you are really new to the concept of programming and just likes to get things working. In the long run, I think using these libraries will lead to bad coding habits. Yet, I like the simplicity of using this IDE – compiling and uploading the firmware using the bootloader.

The Atmel IDE is a pure Windows solution with a professional Visual Studio based IDE, introducing unnecessary complexity. The MCU is usually programmed directly, overwriting the bootloader.

So I worked on a compromise: A simple toolchain, which is reusing the tools from the Arduino IDE, also gives the comfort of the simple build and upload process, but it is based on CMake, a modular and widespread build system.

It is not meant to use for beginners. The idea is to provide a system which can be used in a prototype stage from professionals. Writing code to a fully abstract HAL which can later easily migrated to a professional firmware.

In this article, I will briefly describe this toolchain for the Feather M0 HAL. As for the HAL, it is a work in progress. It is meant as inspiration and example.

Update 2019-06-22: I concluded my tests on Linux successfully. For my tests, I used Ubuntu Linux with a compiled version of CMake. At this point, the available CMake package for this distribution was one version behind.


I successfully tested the toolchain on macOS and it should work on Linux (Update: Successfully tested on Linux). There are a few requirements for both systems:

  • Works with any Adafruit Feather M0 based board.
  • Arduino IDE 1.8.9+
  • Python 3.7+
  • CMake 3.14+
Continue reading A New Modular CMake Based Toolchain for Feather M0 HAL

No Success with First Long Term Measurement

The first long term measurement I made, to test the behaviour of the sensor over a longer time range was a failure. After the five days with the device introduced in this post, the readings made absolute no sense.


The sensor was not moved in the flower pot and the plant was once watered at the begin of the measurement. While it looked promising at the begin, the frequency suddenly went down again, which was very irritating. I am still investigating how this could happen.

To get closer to the real measurement of the final plant watering sensor, I started a new approach.


I soldered a header to one of the LED pads on a fully assembled plant sensor. Next I changed the device for the measurements.


Continue reading No Success with First Long Term Measurement

Plant Watering Sensor – Long Term Logging

To gather more long-term measurements for the capacitive method I use for my plant watering sensor, I created this small logging device. As you can see, it uses one of the plant watering sensor prototypes for the measurements. Instead of using the ATtiny13A on the board, it passes the oscillator signal directly to the microprocessor of the logging device.

In front there is a very small 128×32 OLED display, where I can see the current measured frequency in kHz. On top, the current time and date is visible, and on the right there is a graph where I can see the values from the last 48 hours graphically. There is not much visible in the graph, because I took the photo just after installing the sensor.

Every minute, the current average of measurements is stored in a CSV file on a SD card. After a few weeks I should be able to analyse this file and see the results. Here I am especially interested in the cycles from watering the plant until the soil got dry again. Continue reading Plant Watering Sensor – Long Term Logging

How Build a Beautiful Table Light

I just published a new project, how you can easily build a nice table light from a cheap candle holder you get in any IKEA shop. The project is using a NeoPixel ring and a Adafruit Trinket as microcontroller.

The microcontroller is very limited, but you will find ready made software which will get most out of this small chip. The lamp comes with 50 different colour modes. There are of course a number of static colours, but also animated rotating patterns. Also there are a few fire like random flickering modes. But of course you can reprogram everything easily to add more of the effects you like.

This time the components are relatively cheap. If you have some spare parts left, the total cost for a whole lamp should be less than $40.

Have fun!

Are My Documents Safe in the Root Cellar at ~80% Humidity?

Update 2015-08-21: Added the wiring diagram.
Update 2015-08-24: The documentation for the minimal version is online here.

There is a large cellar where I could store unused items and documents, but the catch is the humidity there. It is a root cellar near a small brook and the humidity varies between 75% up to 90%.

Archived material should never be exposed to humidity greater than 65%, therefore I have to isolate all documents in boxes from the air of the cellar. But are this boxes safe? Do they keep the humidity away from the documents – even for years?

To have a look into the box environment, I need a data logger. It would be simple to buy one, but much more fun to build one. So a new project is born: I call it the “Data Logger” project.

There are a few phases to realise this project:

  • Prototype (done)
  • Simple Version (in work)
  • Deluxe Version with Display and Case

The Prototype

For the prototype I used a large solderless breadboard from 3M. There I actually just tested the components for the simple version, especially if the protocols are working and if I can use them in the way intended. I will keep this section short and explain everything in detail in the next section. Just to remind you, I tested everything on a breadboard before I soldered the components to a stripboard.

Parts of The Simple Version

The simple version should be a data logger which automatically starts logging temperature and humidity values it it is powered on. Using a small switch, I can select between logging, reading and erase. In the reading mode, the logger will send all logged values to the serial interface.

Because I need quick results, I will build the whole device using components from Adafruit. Here a list of components I will use for the simple version of the data logger:

Continue reading Are My Documents Safe in the Root Cellar at ~80% Humidity?