Skip to the content
PCBKitNew board
2 layers52 × 26 mmDml10, the printed circuit board in 3D

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

Size
52 × 26 mm
Copper layers
2
Thickness
1.6 mm
Parts
51
Nets
46
Pads
164
Tracks, vias
380, 45
Pours
1
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
17 Jul 2019
Updated
24 Sep 2026

Overview

Dml10 is an open-source printed circuit board by jonnor, from the jonnor/embeddedml repository on GitHub. It is a 2-layer board of 52 × 26 mm with 51 parts on 46 nets, routed with 380 tracks and 45 vias.

It is built around the PY32F003F16P6TU, GS8632-MR and LIS3DH, with the LP4054HB5F, LMA2718B381-OA5-2 and LMA2718T421-OA5 among its other parts. Its parts include 17 resistors, 12 capacitors, 5 ICs, 4 diodes and 4 connectors. It belongs with the sensors and measurement boards of this library.

Main components

6

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

51
QtyValueFootprintReferences
710uF 10VCapacitor_SMD:C_0603_1608MetricC1, C2, C4, C8, C10, C11, C12
6TP_PCBTestPoint:TestPoint_Pad_D1.0mmTP2, TP3, TP4, TP5, TP6, TP7
410kResistor_SMD:R_0603_1608MetricR4, R7, R8, R12
43.3kResistor_SMD:R_0603_1608MetricR2, R9, R10, R17
31uF 10VCapacitor_SMD:C_0603_1608MetricC5, C6, C9
20RResistor_SMD:R_0603_1608MetricR5, R6
2120RResistor_SMD:R_0603_1608MetricR11, R13
268kResistor_SMD:R_0603_1608MetricR1, R16
282RResistor_SMD:R_0603_1608MetricR14, R15
1100nF 10VCapacitor_SMD:C_0603_1608MetricC3
1100pF 10VCapacitor_SMD:C_0603_1608MetricC7
13k3Resistor_SMD:R_0603_1608MetricR3
1BM7161dml10:BM7161U3
1CLEAR BLUELED_SMD:LED_0603_1608MetricD3
1CLEAR GREENLED_SMD:LED_0603_1608MetricD2
1CLEAR REDLED_SMD:LED_0603_1608MetricD1
1CLEAR WHITELED_SMD:LED_0603_1608MetricD4
1Conn_01x03Connector_PinHeader_1.27mm:PinHeader_1x03_P1.27mm_VerticalJ6
1GS8632-MRPackage_SO:MSOP-8_3x3mm_P0.65mmU6
1Header 2.54mmConnector_PinHeader_2.54mm:PinHeader_1x14_P2.54mm_VerticalJ4
1Header 2.54mmConnector_PinHeader_1.27mm:PinHeader_1x02_P1.27mm_HorizontalJ1
1LIS3DHPackage_LGA:LGA-16_3x3mm_P0.5mm_LayoutBorder3x5yU5
1LMA2718B381-OA5-2dml10:XDCR_CMM-2718AB-383161-TRMK2
1LMA2718T421-OA5dml10:XDCR_CMM-2718AT-42308-TRMK1
1LP4054HB5FPackage_TO_SOT_SMD:TSOT-23-5U2
1MountingHoledml10:Mousebite_0.6mmX8H1
1PY32F003F16P6TUPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU1
1USB_Adml10:EdgeUSBTypeAJ2

Questions

How big is the Dml10 PCB?

It measures 52 × 26 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Dml10 use?

51 parts, built around the PY32F003F16P6TU, GS8632-MR, LIS3DH and LP4054HB5F. 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 Dml10 KiCad files?

From the jonnor/embeddedml repository on GitHub, at the commit this page was made from: the board is projects/dollar_tinyml/hardware/dml10/dml10.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 Dml10 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 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
  • 2 layers14 × 12.5 mmTinypulse, the printed circuit board in 3D

    Tinypulse

    jonnor/embeddedml

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

    12 parts317

Similar boards

  • 4 layers54 × 32.5 mmUltraTalker, the printed circuit board in 3D

    UltraTalker

    amundgr/batled

    63 parts
  • 2 layers45.7 × 22.9 mmOd1, the printed circuit board in 3D

    Od1

    kanengomibako/EffectsPedals

    30 parts14Unlicense
  • 2 layers27 × 25 mmLightSound, the printed circuit board in 3D

    LightSound

    sean618/MakerTiles

    Modular STM32 electronic-tile system: hardware, firmware, the MicroBus + Field Protocol stack, and a Python daemon.

    34 partsMIT
  • 2 layers89.8 × 10.2 mmODGIRON v1.0-F4x1-0412, the printed circuit board in 3D

    ODGIRON v1.0-F4x1-0412

    oldgerman/ODGIRON

    基于 ironOS 的 PD T12 电烙铁

    125 parts34GPL-3.0
  • 4 layers83 × 83 mmBlinkekatze, the printed circuit board in 3D

    Blinkekatze

    TobleMiner/blinkekatze

    Blinkekatze, a replacement PCB to turn cat themed night-lights into interactive light displays

    134 parts34
  • 2 layers59.2 × 93.2 mmAws iot expresslink demo badge, the printed circuit board in 3D

    Aws iot expresslink demo badge

    aws/iot-expresslink

    This device was designed and created for the AWS IoT ExpressLink Demo Badge Workshop, which was run at re:Invent 2022.

    74 parts29MIT-0
  • 8 layers50 × 50 mmUSB C PSU, the printed circuit board in 3D

    USB C PSU

    LeoDJ/USB-C_PD_PSU

    A 5-60V bidirectional buck-boost-converter, also capable of 240W USB PD EPR (48V 5A)

    149 parts29