SlideShare a Scribd company logo
MicroPython for the IoT
16th Fribourg Linux Seminar - 2 may 2019
Jacques Supcik • @supcik
jacques.supcik@hefr.ch
Computers vs
Embedded Systems
Typical 19” Rack Server
User
Application Software
Operating System
Hardware
“Big” embedded systems
User
Application Software
Operating System
Hardware
Traditional “small” embedded systems
User
Application Software
Hardware
Small embedded system with “mini” OS
User
Application Software
Operating System
Hardware
( )
C / C++
Small embedded system with MicroPython
User
Application Software
MicroPython
Hardware
Python
Why Python ?
C was good in 1972
Computers
changed a lot
in 47 years
https://obsolescence.wixsite.com/obsolescence/pidp-11
Guido van Rossum
Benevolent Dictator For Life (BDFL)
“Computer Programming for Everybody”
● An easy and intuitive language just as powerful
as major competitors
● Open source, so anyone can contribute to its
development
● Code that is as understandable as plain English
● Suitability for everyday tasks, allowing for short
development times
Improved Programmer’s
Productivity
Extensive Support
Libraries
Easy to learn
High Level
Community
Object-oriented
Extensible
(in C/C++)
Portable
Python core library
PyPi
Python is almost 30 years old
From Python 2 to Python 3
Python 2.7 Python 3.7
>>> [round(i+0.5) for i in range(6)]
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
>>> [round(i+0.5) for i in range(6)]
[0, 2, 2, 4, 4, 6]
>>> print "Hello"
Hello
>>> print "Hello"
SyntaxError: Missing parentheses in call
to 'print'. Did you mean print("Hello")?
>>> 5/2
2
>>> 5/2
2.5
>>> map(lambda x: 2**x, range(6))
<map object at 0x1026d34a8>
>>> map(lambda x: 2**x, range(6))
[1, 2, 4, 8, 16, 32]
Python 2 EOL in 2020 and Google “Grumpy”
https://github.com/google/grumpy
Python 2.7 to Go
source transpiler and
runtime
Python is one of the most loved language in 2018
https://insights.stackoverflow.com/survey/2018
and Python is the most wanted language
https://insights.stackoverflow.com/survey/2018
https://data-flair.training/blogs/python-career-opportunities/
MicroPython
MicroPython
“it is compact
enough to fit and
run within just 256k
of code space and
16k of RAM”
MicroPython Code Size
< 80KB
http://micropython.org/resources/code-dashboard/
MicroPython
Created in 2013 by Damien George, Australian
programmer and physicist
Kickstarter 2013 : PyBoard + MicroPython
BBC micro:bit : 2016
nRF51822, 16 MHz ARM Cortex-M0
“We enable and inspire all
children to participate in
the digital world, with
particular focus on girls
and those from
disadvantaged groups”
Micro:bit Educational Foundation
BBC Acorn (Cambridge / UK)
1981 : BBC Micro. 6502 CPU 1987 : Archimedes. ARM CPU
Micropython for the iot
Micropython for the iot
Runs on Cortex M3 and Tensilica Xtensa CPUs
ESP8266
● Wifi 802.11 b/g/n
● 4MB Flash
● 32 KiB instruction RAM
● 32 KiB instruction
cache RAM
● 80 KiB user-data RAM
US$ 5
ESP32
● Wifi 802.11 b/g/n
● Bluetooth v4.2
BR/EDR(*)
and BLE(*)
● Dual Core
● 4MB Flash
● 520 KiB SRAM
*) BR = Basic Rate, EDR = Enhanced Data Rate, BLE = Bluetooth Low Energy
US$ 8
PyBoard
● STM32F405RG
● 168 MHz Cortex M4
with hardware floating
point
● 1MiB flash ROM and
192KiB RAM
● 3-axis accelerometer
US$ 44
US$ 58 - 90
PyBoard (clone)
● STM32F405RG
● 168 MHz Cortex M4
with hardware floating
point
● 1MiB flash ROM and
192KiB RAM
● 3-axis accelerometer
US$ 17
Digi XBee3® Cellular LTE CAT 1
US$ 100
https://www.digi.com/products/embedded-systems/cellular-modems/xbee3-cellular-lte-cat-1
“Integrated MicroPython
programmability for edge
compute”
Edge computing
https://blog.octo.com/en/edge-computing-learn-to-delegate/
https://www.digi.com/blog/digi-xbee-cellular-versus-rudimentary-cellular-breakout-boards/
Pycom LoPy
US$ 30
MicroPython enabled development
board (LoRa, WiFi, Bluetooth)
https://www.seeedstudio.com/micropython-c-962/Pycom-LoPy-MicroPython-enabled-d
evelopment-board-LoRa-WiFi-Bluetoot-p-2785.html
MicroPython on bare metal Raspberry Pi Zero
https://github.com/boochow/micropython-raspberrypi
MicroPython on servers and desktop
https://github.com/micropython/micropython/wiki/Getting-Started
Commercial support : Zerynth
https://www.zerynth.com/
Live Coding
Simple LED Blinker
https://gitlab.forge.hefr.ch/fribourg-linux-seminar/19.05/py-blink
Remote temperature sensor
https://gitlab.forge.hefr.ch/fribourg-linux-seminar/19.05/py-temperature
Remote temperature sensor and LED
“Sonar” to measure distances
https://gitlab.forge.hefr.ch/fribourg-linux-seminar/19.05/py-sonar
“Sonar” to measure distance
References
http://bit.ly/upython19
● https://micropython.org/
● https://www.python.org/
● GOTO 2016 • MicroPython & the Internet of Things
by Damien George
● 35C3 - MicroPython – Python for Microcontrollers
● Pycon Ireland 2017: MicroPython :
The Next Step to World Domination by Steve Holden
● https://io.adafruit.com
● MicroPython for Leon (ESA)
● Writing fast and efficient MicroPython
● The Early Days of MicroPython
Backup
Abstract
According to the 2018 survey of Stack Overflow, Python is one of the most loved
programming languages and the most wanted one. Python is used in many
world-class software companies as well as in high schools, colleges and
universities. MicroPython is an implementation of the Python 3 programming
language optimized for embedded systems. During this presentation, I will present
MicroPython and its derivatives, and I will show you some typical use cases for
MicroPython. In the second part, I will demonstrate how to install the system on a
cheap microcontroller and during a live coding session, I will implement a
functional IoT device.

More Related Content

PDF
PLC - Programmable Logic Controller
PPT
Formation arduino 2018
PPTX
Pytest KT.pptx
PDF
Python programming : Classes objects
PPTX
Simple Introduction about ESP32 Presentation
PPS
Arduino Uno Pin Description
PDF
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
PPTX
Arduino Interfacing with different sensors and motor
PLC - Programmable Logic Controller
Formation arduino 2018
Pytest KT.pptx
Python programming : Classes objects
Simple Introduction about ESP32 Presentation
Arduino Uno Pin Description
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
Arduino Interfacing with different sensors and motor

What's hot (20)

ODP
Micro-python
PPTX
INTRODUCTION TO MICROCONTROLLER
PDF
Getting Started with Embedded Python: MicroPython and CircuitPython
PPTX
Interrupts in pic
PPTX
Internet of things cisco
PDF
LLMs Bootcamp
PDF
Introduction to python
PPTX
Yolov3
PDF
Practical introduction to IoT
PPTX
PCB layout using CNC machine
PDF
Edge Computing
PPTX
Generative AI Use-cases for Enterprise - First Session
PDF
Scalable Automatic Machine Learning in H2O
PDF
Arduino Projects
PPTX
smart blind stick
PPT
Embedded systems, 8051 microcontroller
PPTX
Fire fighting robot using arduino
PDF
And then there were ... Large Language Models
PPTX
My arduino presentation
PPT
IoT with Arduino
Micro-python
INTRODUCTION TO MICROCONTROLLER
Getting Started with Embedded Python: MicroPython and CircuitPython
Interrupts in pic
Internet of things cisco
LLMs Bootcamp
Introduction to python
Yolov3
Practical introduction to IoT
PCB layout using CNC machine
Edge Computing
Generative AI Use-cases for Enterprise - First Session
Scalable Automatic Machine Learning in H2O
Arduino Projects
smart blind stick
Embedded systems, 8051 microcontroller
Fire fighting robot using arduino
And then there were ... Large Language Models
My arduino presentation
IoT with Arduino
Ad

Similar to Micropython for the iot (20)

PPTX
IOT with Drupal 8 - Webinar Hyderabad Drupal Community
PDF
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
PDF
Elastic network of things with mqtt and micro python
PDF
Tangible Tools For Teaching With Python
PPTX
Python 101 For The Net Developer
PDF
Docker for the Internet of Things (IoT): An Introduction
PDF
Why Python Should Be Your First Programming Language
PDF
Docker opens the Doors for IoT
PDF
UC18NA-D3D202-Dianomic-IZoratti-Introduction-To-FogLAMP.pdf
PPTX
Chapter 2: Basics of programming pyton programming
PPTX
Raspbeery PI IoT
PPTX
The fight for surviving in the IoT world
PDF
The fight for surviving in the IoT world - Radu Vunvulea
PPTX
Starting from scratch to build MicroPython.pptx
PPT
2nd ARM Developer Day - mbed Workshop - ARM
PPTX
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
PDF
Rapid IoT Prototyping with Tizen on Raspberry Pi
PDF
Python_final_print_batch_II_vision_academy.pdf
PDF
Python_final_print_batch_II_vision_academy.pdf
PDF
Python_vision_academy notes
IOT with Drupal 8 - Webinar Hyderabad Drupal Community
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Elastic network of things with mqtt and micro python
Tangible Tools For Teaching With Python
Python 101 For The Net Developer
Docker for the Internet of Things (IoT): An Introduction
Why Python Should Be Your First Programming Language
Docker opens the Doors for IoT
UC18NA-D3D202-Dianomic-IZoratti-Introduction-To-FogLAMP.pdf
Chapter 2: Basics of programming pyton programming
Raspbeery PI IoT
The fight for surviving in the IoT world
The fight for surviving in the IoT world - Radu Vunvulea
Starting from scratch to build MicroPython.pptx
2nd ARM Developer Day - mbed Workshop - ARM
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Rapid IoT Prototyping with Tizen on Raspberry Pi
Python_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdf
Python_vision_academy notes
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
A Presentation on Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Getting Started with Data Integration: FME Form 101
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
1. Introduction to Computer Programming.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Heart disease approach using modified random forest and particle swarm optimi...
cloud_computing_Infrastucture_as_cloud_p
Univ-Connecticut-ChatGPT-Presentaion.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A Presentation on Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Machine Learning_overview_presentation.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Spectroscopy.pptx food analysis technology
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
Getting Started with Data Integration: FME Form 101
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A comparative analysis of optical character recognition models for extracting...
MIND Revenue Release Quarter 2 2025 Press Release
1. Introduction to Computer Programming.pptx

Micropython for the iot