Today, I’d like to show dotnet how to run your own .NET application on a Micro Controller Unit (MCU) on a simple battery for multiple years. I’ll build an application that will read the temperature and pressure on a BMP280 sensor connected to an ESP32. The core idea is to be run on a small solar panel charging a LiPo battery. I will as well present two real case scenarios, both running .NET nanoFramework, one on STM32F7 processor and the other one on a TI CC1352R.
I’m Laurent Ellerbach. I’m a Principal Software Engineer Manager at Microsoft working for the Commercial Software Engineering team. My team and I are doing co-engineering with our largest customers helping them in their digital transformation and focussing on Azure. I’m more focussing on Manufacturing industry and I’ve been involved in IoT for a very long time. I’ve been a contributor to .NET IoT and quickly became one of the main contributors which drove me to work very closely with the .NET team. As a fan of C# since day 1, I’m always looking at fun and innovative way to use it as much as I can. I was excited to discover .NET nanoFramework and I’m working on bridging both .NET IoT and .NET nanoFramework to make it easier for a C# developer to use one or the other and reuse as much code as possible.
A Micro Controller Unit (MCU) is a small processor, usually a synonym for low power consumption, and small size. Modern ones like STM32F7, ESP32, TI CC1352R are ARM Cortex M based, embedding few hundreds of kilobytes of RAM, small flash and a decent few hundred million of hertz clock cadence. On small processors like those ones, you run a very simple OS called Real Time OS (RTOS) like Azure RTOS. Those RTOS provide threading, inter-threading messaging and synchronization, minimum network capability and you have to build your applications on top, traditionally using C/C++. A special implementation of .NET exists for those MCU, it’s called .NET nanoFramework.