Skip to the content
PCBKitNew board
2 layers14 × 12.5 mmTinypulse, the printed circuit board in 3D

Notes on Machine Learning on edge for embedded/sensor/IoT uses

Size
14 × 12.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
12
Nets
65
Pads
77
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 7 (file 20221018)
Created
17 Jul 2019
Updated
24 Sep 2026

Overview

Tinypulse is an open-source printed circuit board by jonnor, from the jonnor/embeddedml repository on GitHub. It is a 2-layer board of 14 × 12.5 mm with 12 parts on 65 nets.

It is built around the ATTINY1616-MN, LIS2DH and APA102-2020. Its parts include 3 resistors, 3 connectors, 2 capacitors, 2 ICs and 2 diodes. It belongs with the sensors and measurement boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

3

README

README.md

Machine learning on embedded devices

Focused primarily on running inference/prediction/feed-forward part on a microcontroller (or small embedded device). Training phase can run on a standard computer/server, using existing tools as much as possible.

Background

What and when to use machine learning

The defaults right now are to do conventional signal processing (no learning) in sensor, and stream raw data to the cloud for storage and processing. Machine learning happens in the cloud. If gateways are used, they mostly forward communication (no data processing).

On-edge processing valueable when

  • Local response needed. Autonomy
  • Adaptable response needed. Over time, in context.
  • Low/predictable latency needed
  • Sending raw sensor data has privacy implications. Audio, video.
  • Unreliable connection
  • High bandwidth sensor input. Audio, video, accelerometer/IMU, current sensor, radiowaves.
  • Low bandwidth algorithm output
  • Events of interest are rare
  • Low energy usage needed
  • Full/raw sensor data is not valuable to store
  • Sensor system should be low cost

Example usecases

  • Predictive maintenance, using audio/vibration data
  • Activitity detection for people, using audio/accelerometer data. Assistive tech, medical
  • Appliance disaggregation, using aggregated power consumption data. "Non-Intrusive Load Monitoring" (NILM)
  • Anomaly/change detection for predictive maintenance, using audio/vibration data, or electrical data
  • Gesture recognition as human input device, using accelerometer/gyro data.
  • Speech/command recognition as human input device, using microphone. Keyword/Wake-word detection
  • Battery saving in wireless sensors. Normally sending day/week aggregates, on event/anomaly detection send data immediately
  • Health status of animals via activity detected using accelerometer
  • Monitoring eating activity using accelerometer 1
  • Environmental monitoring, using microphone to detect unwanted activity like cutting down trees
  • Adaptive signalling and routing for wireless transmission in Wireless Sensor networks
  • Electronic nose using arrays of MEMS detectors
  • Material identification using reflecive spectrometer 1

More notes on Applications

Motivation

  • Why the Future of Machine Learning is Tiny (devices) Tiny Computers are Already Cheap and Everywhere. Energy is the Limiting Factor.We Capture Much More Sensor Data Than We Use.
  • embedded.com: Bringing machine learning to the edge Predictions are much lower bandwidth than the raw sensor data (e.g. video) It allows for local adaptation in the AI logic (L-DNN) It achieves lower latency between observed event and action resulting from AI logic "the most important question is what is the least amount accuracy and computation complexity we can do while still delivering the business value?" Top mistake: "Continuing with the top down approach ‘let’s make it perform the task first and then squeeze it on device` instead of switching to bottom up ‘let’s make it run on device and fulfill all hardware constraints first, and then tune it for the task at hand’."
  • How to run deep learning model on microcontroller with CMSIS-NN. Why run deep learning model on a microcontroller? Sensitive data gets to the cloud, photos, and audio recordings. The company who sells this may charge a service fee to use its service and even worse sell your private data. It won't work without the network connection to the server. Data traveling back and forth between the device and server introduces lag. Require network and wireless hardware components on the circuit design which increase the cost. It might waste bandwidth sending useless data.

Own contributions

Presentations

Lecture notes

Open source software

  • emlearn. Machine Learning inference engine in C99 for Microcontrollers and Embedded devices. Since 2018.
  • emlearn-micropython. Efficient and convenient Machine Learning and DSP for MicroPython. Since 2024.

Fun projects

Commercial projects

Learning material

Books

Articles

Tools

Open-source

  • emlearn. Inference engine for microcontrollers. Supports converting scikit-learn models to plain C code. No dynamic allocations. No runtime needed.
  • TensorFlow Lite for Microcontrollers. Supports neural network models made with TensorFlow (including Keras). Can run on wide range of platforms. Since November 2018. Supports ARM Cortex M, RISC-V, ESP32/Xtensa and Linux/MacOS host. Requires a runtime, aroud 20 kB.
  • onnx2c. Allows generating C code from ONNX models.
  • iree. Compiler. Has bare metal target. Around 30 kB runtime.
  • executorch. C++ framework for deploying PyTorch models. Focused on custom backends, NPUs etc. Microcontroller CPU less in focus. Around 50 kB runtime. Supports bare-metal via "Portable" operations, or specialized for Cortex M.
  • nnom - Fixed-point neural network compiler for microcontrollers. Supports wide range of networks. Outputs plain C code. Can use CMSIS-NN on ARM Cortex M.
  • Embedded Learning Library by Microsoft. Discontinued in 2024 Set of C++ libraries for machine learning on embedded platforms. Includes code for kNN, RandomForest etc. Also has some node-based dataflow system in place it seems. JavaScript and Python bindings.
  • uTensor. Export Tensorflow model to mbed/ARM microcontrollers. Not supported on ESP32 or RISC-V or similar. Lower activity since 2021.
  • sklearn-porter. Can compile DecisionTreeClassifier and SVC models to C. Uses dynamic memory. Not optimized for use on embedded devices.
  • microTVM. Depends only on the C standard library, and runs bare metal such as STM32 and NRF52 microcontrollers. Is under development. Which models are supported on microcontrollers not specified.

Low-level libraries

  • gemmlowp. Low-precision matrix multiplication. Only general matrix multiplication ("GEMM"). C++11
  • CMSIS-NN. Neural network operations for ARM Cortex M.
  • esp-nn. Neural Network functions Espressif ESP32 (Xtensa and RISC-V).
  • . Can be used bare-metal, but more focused on mobile/server grade (Cortex A+ etc).

Proprietary

  • X-CUBE-AI for STM32

Historical

  • nn4mc_cpp. Neural Networks for Microcontrollers. Supports Keras natively. Provides instructions for PyTorch et.c via ONNX. Documentation for using from Python is lacking, as well as the type of networks supported. Does not seem maintained since 2020.
  • micromlgen. Generate C code for microcontrollers from Python's sklearn classifiers. Archived in 2024.

Models

A range of Machine Learning models are useful in an embedded devices setting. Classical methods are used when the amount of data is quite small, and neural networks for large datasets and complex inputs.

Below are notes on the various models in the context of embedded Machine Learning, including model size and compute-time optimization.

More topics

State of the Art in 2019

Of ML inference on general-purpose microcontrollers.

text
TODO: update for 2023
  • Deep models have efficient implementations for ARM Cortex-M. Ex: CNN and RNN in CMSIS-NN, FC in uTensor
  • Some implementations available for non-neural models that can be used. Ex: SVM,RF,AdaBoost in sklearn-porter
  • A few special-designed ML algorithms made. Ex: ProtoNN, Bonsai
  • Basic tools available for converting Tensorflow models
  • Keyword-spotting/wake-word on audio well established. Used in commercial products (Alexa etc)
  • Human activity detecton on accelerometers.
  • Computer vision is actively developed
  • Lots of research and many announcements of low-power co-processors, but little on market yet

Limitations

  • Neural models lacking for non-ARM micros. ESP8266/ESP32
  • Non-neural models missing inference engines designed for microcontrollers
  • "Small DNN" work mostly on computer vision for mobile phones (model size 1000x of uC)
  • Few/no pretrained models available. Transfer learning little explored?
  • Very little documentation of entire development process. From planning, data aquisition, model design
  • Best practices underdocumented (or underdeveloped?)

Ways of advancing, make contributions

  • Faster inference. Power saving, or bigger problems.
  • Smaller models. Cheaper MCU, or bigger problems.
  • Better accuracy on a problem. Better user experience, new usecases
  • Solve a concrete usecase. Easier to deploy similar usecases
  • Comparison between approaches. Microcontroller, ML model
  • Libraries or tools. Lower time to market, enable more developers

Parts

12
QtyValueFootprintReferences
3RResistor_SMD:R_0603_1608MetricR1, R2, R3
2CCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C2
1APA102-2020LED_SMD:LED-APA102-2020D2
1ATtiny1616-MPackage_DFN_QFN:VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mmU1
1Conn_01x02Connector_PinHeader_1.27mm:PinHeader_1x02_P1.27mm_HorizontalJ4
1Conn_01x04Connector_PinHeader_1.27mm:PinHeader_1x04_P1.27mm_HorizontalJ3
1Conn_01x08TinyPulse:DIP-8_W10.16mmJ1
1LED_RGBLED_SMD:LED_Avago_PLCC6_3x2.8mmD1
1LIS2DHPackage_LGA:LGA-14_2x2mm_P0.35mm_LayoutBorder3x4yU2

Questions

How big is the Tinypulse PCB?

It measures 14 × 12.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Tinypulse use?

12 parts, built around the ATTINY1616-MN, LIS2DH and APA102-2020. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Tinypulse KiCad files?

From the jonnor/embeddedml repository on GitHub, at the commit this page was made from: the board is emlearn/pulsemeter/hardware/tinypulse/tinypulse.kicad_pcb and its schematic emlearn/pulsemeter/hardware/ledarray/ledarray.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Tinypulse design in my own project?

Its repository states no licence, so its author keeps all rights: ask jonnor before reusing the design.

More from jonnor/embeddedml

5
  • 2 layers52 × 26 mmDml10, the printed circuit board in 3D

    Dml10

    jonnor/embeddedml

    Notes on Machine Learning on edge for embedded/sensor/IoT uses

    51 parts317
  • 2 layers40 × 20 mmDml20m, the printed circuit board in 3D

    Dml20m

    jonnor/embeddedml

    Notes on Machine Learning on edge for embedded/sensor/IoT uses

    37 parts317
  • 2 layers42 × 14.2 mmDml21m, the printed circuit board in 3D

    Dml21m

    jonnor/embeddedml

    Notes on Machine Learning on edge for embedded/sensor/IoT uses

    34 parts317
  • 2 layers15.2 × 10 mmLedarray, the printed circuit board in 3D

    Ledarray

    jonnor/embeddedml

    Notes on Machine Learning on edge for embedded/sensor/IoT uses

    16 parts317
  • 2 layers12 × 15.5 mmBm7161, the printed circuit board in 3D

    Bm7161

    jonnor/embeddedml

    Notes on Machine Learning on edge for embedded/sensor/IoT uses

    16 parts317

Similar boards

  • 2 layers65 × 56.5 mmSuperPower RPi KiCAD, the printed circuit board in 3D

    SuperPower RPi KiCAD

    SensorsIot/SuperPower

    Here you should find the best power supplies for your low-power projects

    122 parts600
  • 2 layers40.2 × 19.6 mmCompact, the printed circuit board in 3D

    Compact

    jgillick/ThunderPack

    A self-contained microcontroller, battery, and power management system that fits in your pocket.

    59 parts44MIT
  • 2 layers35 × 99.5 mmPovslinger, the printed circuit board in 3D

    Povslinger

    Jeija/esp8266-povslinger

    Persistence of vision display using ESP8266 and APA102-2020

    49 parts10
  • 2 layers66.2 × 57.3 mmFidget, the printed circuit board in 3D

    Fidget

    m-byte/fidget-pov

    https://hackaday.io/project/25372-iot-pov-fidget-spinner

    88 parts8GPL-3.0
  • 4 layers155 × 54.5 mmDisplay b r1, the printed circuit board in 3D

    Display b r1

    4lml4/LED_Glasses

    New public repo for work on LED Glasses

    292 parts2
  • 4 layers73 × 57 mmGRID, the printed circuit board in 3D

    GRID

    Lucasmnascimento94/CS-341

    400 parts2
  • 2 layers22.4 × 47.3 mmCuttle2fish, the printed circuit board in 3D

    Cuttle2fish

    tahnok/cuttle2fish

    Something you know (password) and something you have (cuttlefish shaped U2F token)

    26 parts2Unlicense
  • 2 layers12 × 30 mmElectric greetings, the printed circuit board in 3D

    Electric greetings

    electricui/electricui-helloboard

    Cute arduino compatible development board for introducing people to Electric UI

    19 parts1