Fully open-source and open-hardware data logger tailored for logistics applications i.e. for cold chain monitoring systems.
Schematics, PCB, enclosure, BOM, assembly documentation
- Temperature/Humidity Sensirion SHT3x
- Ambient Light Sensor TI OPT3001
- Shock Sensor - Accelerometer NXP MMA8452Q
- USB-C:
- MSD: Device works ad a flash drive to direct log read on PC
- CDC: Console for debug and firmware bootloader
- NFC for control through mobile app ST ST25DV04K
- Hardware crypto Microchip ATECC608A for:
- Firmware encryption for bootloader
- Log data encryption
- Authentication (X509 certificates for IoT platforms)
- Powered by 2xAAA batteries or USB-C (reverse polarity protection, OR source selection)
- Low Power Consumption: Ultra-low power architecture, ~ one year of data acquisition
- 4MB SPI NOR Flash AT25DF321
- RTC Clock: accurate 32.768Hz quartz oscillator
- LED: Simple indication for device states
- Microchip ATSAMD21E18 - 32-bit ARM Cortex-M0+ MCU, 48MHz, 256KB of flash and 32KB of SRAM. Satisfies AEC-Q100, recommended for Automotive.
The firmware is written in C with a bare-metal approach and exclusively uses static memory allocation. It is developed on top of the Harmony v3 Embedded Software framework. Developed with MPLAB X, XC32 compiler.
The source code adheres to an asynchronous, non-blocking programming style designed to achieve ultra-low power consumption.
The core mechanism revolves around handling asynchronous events from a queue and entering a low-power sleep state when the queue is empty. New events are enqueued either through interrupts (e.g., cron-scheduled sensor reads) or through the main system loop.
The architecture incorporates the following key concepts:
- Event Loop
- Actor Model - aka Active Object
- Finite-state machine - Mealy + Moore implementation
To streamline development, an Active Object + FSM library has been implemented and is maintained in a separate active-object-fsm repository.
$ git clone https://github.com/polesskiy-dev/iot-risk-data-logger-nfc-samd21 --recurse-submodules
Update submodules to the latest version (optional):
$ git submodule init && git submodule update --remote # install submodules