We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Scientific MicroPython for Microcontrollers and IoT

00:00

Formal Metadata

Title
Scientific MicroPython for Microcontrollers and IoT
Subtitle
IoT programming with Python
Title of Series
Number of Parts
611
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language
Production Year2017

Content Metadata

Subject Area
Genre
Abstract
MicroPython is a FOSS implementation of Python 3 optimised to run on amicrocontroller with MHz and tens or hundreds of Kbytes of RAM. I will presentMicroPython in terms of hardware and software, including some boards withnetwork access, like WiFi, Bluetooth and LoRa. But even with these hardwareconstraints, scientific MicroPython is already available and practical, to beshown from the perspective of users and developers. MicroPython is a implementation of Python 3 optimised to run on amicrocontroller, created in 2013 by the Physicist Damien P. George. TheMicroPython boards runs MicroPython on the bare metal and gives a low-levelPython operating system running interactive prompt or scripts. The MicroPython boards currently use 32 bit microcontrollers clocked at MHzand with RAM limited to tens or hundreds of Kbytes. These are themicrocontroller boards with official MicroPython support currently in thebeginning 2017 : Pyboard, Pyboard Lite, WiPy 1/2, ESP8266, BBC Micro:bit,LoPy, SiPy, FiPy. They cost between USD3-40, are very small and light, aboutsome to tens of mm in each dimension and about 5-10 g, have low powerconsumption, so MicroPython boards are affordable and can be embedded inalmost anything, almost anywhere. MicroPython boards have many electronic interfaces : digital input/output(GPIO) ports, analog inputs (via Analog Digital Converter), analog outputs(via Digital to Analog Converter), wireless (WiFi, Bluetooth, LoRa), etc. SoMicroPython on these boards can be used to control all kinds of electronicprojects. In terms of hardware, 2016 was the year of MicroPython, as new boardscompatible with MicroPython arrived : ESP8266 boards (there are more than 10types, with WiFi), BBC Micro:bit (with Bluetooth LE, free distributed to 1million British students of 11-12 year-old), LoPy (with LoRa, WiFi, BluetoothLE), SiPy (with Sigfox, WiFi, Bluetooth LE). Even a 5 network board wasannounced for April 2017 delivery, FiPy with LoRa, Sigfox, cellular LTE-CATM1/M2(NBIoT), WiFi, Bluetooth LE. In terms of software, MicroPython allows microcontroller programming directlywith Python 3, which is easier and more productive than programming withArduino IDE, C/C++, etc. And MicroPython is well suited for Internetprogramming, so MicroPython boards are a natural choice for IoT (Internet ofThings), for example running a simple web server to show a sensor output (textand graphics), sending sensor data to IoT cloud, etc. This fact is veryimportant as today there are some billions of IoT devices worldwide, and in2020 some tens of billions are expected. Even with RAM constraints (tens to hundreds of Kbytes), scientific MicroPythonis not only possible, but already available and practical to use, withMicroPython modules capable of numerical calculations, FFT (Fast FourierTransform), calculations with uncertainties, etc. I will list the scientificMicroPython modules which are available, as well as show how to port Python 3modules to MicroPython, squeezing the source code in tens of Kbytes. Some hints will be given to the FOSS community to be open minded aboutMicroPython : be aware that MicroPython exists, MicroPython is a betterprogramming option than Arduino in many ways, MicroPython boards are availableand affordable, porting more Python 3 scientific modules to MicroPython,MicroPython combines well with IoT.
17
Thumbnail
24:59
109
Thumbnail
48:51
117
Thumbnail
18:37
128
146
Thumbnail
22:32
162
Thumbnail
23:18
163
Thumbnail
25:09
164
Thumbnail
25:09
166
Thumbnail
24:48
171
177
181
Thumbnail
26:28
184
Thumbnail
30:09
191
Thumbnail
25:08
232
Thumbnail
39:45
287
292
Thumbnail
25:14
302
Thumbnail
26:55
304
Thumbnail
46:54
305
314
317
321
Thumbnail
18:50
330
Thumbnail
21:06
333
Thumbnail
22:18
336
Thumbnail
24:31
339
Thumbnail
49:21
340
Thumbnail
28:02
348
Thumbnail
41:47
354
Thumbnail
26:01
362
Thumbnail
18:56
371
Thumbnail
13:12
384
385
Thumbnail
25:08
386
Thumbnail
30:08
394
Thumbnail
15:09
395
411
Thumbnail
15:10
420
459
473
Thumbnail
13:48
483
501
Thumbnail
32:59
502
Thumbnail
14:48
511
518
575
Thumbnail
25:39
590
Thumbnail
25:00
592
Thumbnail
23:32
MicrocontrollerComputer programmingWeightInternetworkingSoftwareMIDIExecution unitMaß <Mathematik>Ordinary differential equationGamma functionRadical (chemistry)Maxima and minimaFrame problemEstimationHill differential equationMultiplication signOpen sourceField (computer science)Term (mathematics)Connectivity (graph theory)Projective planeMachine visionWebsiteVideoconferencingKernel (computing)MicrocontrollerFormal grammar2 (number)Revision controlView (database)BitPresentation of a groupSource codeSoftware testingCompass (drafting)PhysicistSoftware bugComputer hardwareImplementationState of matterMereologyOrder (biology)Mathematical optimizationMusical ensembleGame controllerFormal languageMacro (computer science)Total S.A.FirmwareFile formatGoodness of fitWell-formed formulaComputer animationXML
Moment of inertiaSoftwareWeb browserRadio-frequency identificationSoftwareSmith chartSemiconductor memoryMicrocontrollerSoftware bugMemory managementCodeMultiplication signInheritance (object-oriented programming)XML
Service (economics)Source code
Musical ensembleWater vapor
Maxima and minimaConvex hullMusical ensembleInteractive televisionRevision controlSource codeXML
Maxima and minimaEndliche ModelltheorieCodeStatisticsCompilation albumDistanceCategory of beingScripting languageError messageoutputCalculationReading (process)Standard deviationComputer fileCompilerPropagation of uncertaintyOperator (mathematics)AnalogyInformationPhysical quantityRevision controlPhysicalismBitDisk read-and-write headFlash memoryType theoryPhysical systemLogical constantWordInternet der DingeMusical ensembleReliefMacro (computer science)Special unitary groupAndroid (robot)Symbol tableFacebookMiniDiscAsynchronous Transfer ModeSource code
InfinityMaxima and minimaNormed vector spaceSocial classMusical ensembleFreewareSerial portDifferent (Kate Ryan album)CodeBitWhiteboard
Gamma functionInterior (topology)Host Identity ProtocolComputer fileOrdinary differential equationPressureExecution unitFunction (mathematics)Single-precision floating-point formatAssembly languageInclusion mapMenu (computing)Wireless LANMaxima and minimaGame controllerSpecial unitary groupArmMusical ensembleSoftwareType theoryGradient descentDrop (liquid)Process (computing)SupercomputerPhysicalismMeasurementError messageMathematical modelAsynchronous Transfer ModeScientific modellingProjective planeDependent and independent variablesServer (computing)Fast Fourier transformWhiteboardReading (process)PressureWeb 2.0EstimatorWeb pageSoftware developerSet (mathematics)Software testingMicrocontrollerProbability density functionInternet der DingeSource codeXML
Computer animation
Transcript: English(auto-generated)
Good afternoon, it's a pleasure to be here, it's my first time here, I'm from Brazil and I apologize for the presentation is not perfect. I have lost my leverage.
I'm from Brazil and my leverage was lost during two days. Somehow I also received the components for the demonstration, the material for
the demonstration and so it was a little bit less than the presentation. At least I'm here, I'm lost about there in the morning, in the afternoon, before, but I'm going to write the video. I'm talking to you about the scientific microbiome for microcontrollers in the IEP.
I'm a physicist, but I work a lot with the compassion of physicists and I try to use IOT, microcontrollers, programming, using the formalization that's needed for safe source data.
So I will put a critical view about the many sensors that IOT are making available for billions of
people, but this data of the sensors should be analyzed in terms of error, precision, how many digits, etc.
Microphyto is a field in the open source implementation of phyto3, it's not 100% compatible, it's something like 98-99% compatible because it was meant to work with tens, for example, ten gigabytes of the run.
It's a phyto3, but very optimized, it was created by Daniel George, he's a physicist also, and it was created three, four years ago.
And he created the bot, the first bot, the language, and there is a community around him, so
the site of microphyto, there is a test drive, sometimes it is online, really, and there are documentation, etc.
There is knowledge here for the images, the firmware, for example, for many bugs, Python 1, Python Lite, Wi-Fi, that I'm showing here.
Well, microphyto, until 2015, had only two bugs, two hardware bugs, bibot and Wi-Fi, Wi-Fi with Wi-Fi.
Okay, but in the beginning of the last year, you had some releases like it,
microphyto supported for ESP8266, VDC microbit for more than one million children from the United Kingdom.
It was given for children of 11 to 12 years old, and you can also buy VDC microbit. Wi-Fi 2, Wi-Fi and Bluetooth, Wi-Fi was the first microcontroller, Wi-Fi, Bluetooth, and LoRa, and it was natively microphyto.
And the other bugs, SciPy with a sick box, OpenEV, it runs microphyto and has a camera, a little camera, optimized to machine vision.
How these bugs run microphyto? These two don't run microphyto natively, you have to install microphyto.
The first bug, this version is a new one, but the first one was almost the same. Wi-Fi, the second bug, Wi-Fi first, the MicroPy project for ESP8266 last year, VDC microbit, and the new kernel.
And you can develop without installing any software, you can use the browser to develop.
It's very important for children and parents to have a simple tool to develop. Wi-Fi 2, LoPy, and OpenEV, a new version, I think next month, and
the older version, so it has very small version, microcontroller with a camera, using MicroPy.
And the, sorry, I don't have time to rush, the free memory of these bugs is between 80 KB, VDC microbit,
only 80 KB, to almost 100 KB of Wi-Fi code. So to develop for microphyto is different from developing through Python, because you have your memory constraint, very important.
And, well, about the demonstration, first I show almost the last one, this microcontroller, this bug is LoPy with a lot of,
So you can have some kilometers of communication, 20 kilobits per second, approximately, until just some kilometers, depending on the region.
And VPC microbit, here, excellent price, and it is being used for 1 million children.
And this year, there will be a microbit for international version, using all the countries, so microbit is now an organization, not only rich.
And simple to remember when you are one, not in front of a lot of people.
I will use this, for example, it's very simple to use, I recommend you
use MicroPyto in the interactive mode, interactive mode, you can also make scripts, of course. So I use a terminal, using USB-C, the connection, to enter in MicroPyto, or the first version, it's a new version of the first version.
So this kernel, it's zero, MicroPyto, almost the last version, there is a new version in general, and it's not the compiler language, yes, it's Python.
It's like a microcomputer, running Python almost as a operating system, so it's the dream
of Python users, only Python, not Linux, not MacOS, not Windows, only Python, almost full Python. And, well, some of the models are already loaded, for example, the 5-word model has a lot of
some models, for example, information, the type of information of this word, microcontroller, you have here about 100 KB,
and the flash memory is something about 90 KB, there are some files there, so it shows less. And, yes, you have the user, the version, of the 5-word, and it's very simple to
read, I'll show a sensor, connected to the ADC, analogical to digital, a property of this word.
This word has some inputs within 12 bits of the analogical to digital code, and to read the ADC part, it's very simple, it's one line of code.
Yes, I read the word, because I have here infrared rangefinder of the sharp here, it can measure the distance between 10 to 150 centimeters.
So, I'll run a script to, okay, and this, what I'd like to show
that today data is stable, the physical quantity is stable, the reading is not stable.
You have a lot of noise, all the sensors have noise, all the physical quantities, I'm a physicist, how they measure the physical quantities, quantities in the world have errors, uncertainties, and the IoT community is forgetting this important thing.
When we are publishing system data, it's important to take into account this, this reality, okay? So, the quantity here is not stable, the distance, okay?
And I'll run another script to show the statistics of these readings, okay? So, the distance of my hand was 16 centimeters, 17 centimeters, with a standard deviation.
Without statistics treatment, it was a huge, more than one centimeter, the standard deviation. With physical treatment, removing some peaks, some data not good, it was a loose.
And now I will show when I increase the distance, when I increase the distance, the error is increased.
For example, and there I think we'll use it more. So, the error is increased with the distance, it's not the constant.
Here we import another script with uncertainty calculation. So, I have imported a model, I have created the adapted model, a model, sorry, from byte to micro byte,
a compilation of uncertainty errors from error propagation. Here, I have to put the head on the stack over here.
So, we have 70 centimeters, which are available in one centimeter, but if the distance is increased, the error is increased, okay? And this is done by error propagation, set it to propagation.
It's a code, very simple script. So, this code is a class, and it's possible to run in machines,
in micro byte boards with free memory, it's not free memory, there's no problem. And this code was not available before.
Here, I present another board.
Here, I have ESP8266, microcontrollment, configured with the micro pipe, and the serial port is a little bit different.
There is a lot of sensor connected here,
it's a DME280 sensor with pressure, humidity, and temperature. All of them, they have a set of errors. So, I'll show statistics.
Oh, before. Just to show that this microcontroller has about,
where is that? It has 28 kilobytes of error, okay? I'll show the reading of the sensor.
Oh, yes, it's working. So, we have the pressure reading, it has a lot of noise, and I run the same sensor with other configuration,
because this sensor has many modes of reading, and in this new configuration, the error is a lot smaller. So, it's very important to understand the sensors.
The PDF of this sensor has about 50 pages. It takes a little time, yes? So, the uncertainty is just four, instead of a very huge one before. And the web server running on this micro pipe mode,
and it shows the three quantities, physical quantities, with errors.
And you have here, you can see that the errors, for example, before parameters, measurement parameters,
that you can configure the error estimation of the sensor.
The majority of people exposes the data sensor without showing the error. Every error, it's very important. And the scientific model is available for a micro pipe.
So, the math model is available, and not exactly the same for all boards. For example, it's very limited. You have, for a pipe board, a fast Fourier transform in assembly, a simple code available from a micro pipe.
It's very fast, okay? And you can compare with a super computer where it was some years ago. With a pipe board, a pipe board that's here, it's comparable to a brave woman calculating test Fourier transform using a micro pipe.
And I participated in this project with Paul, where there's an IoT experiment, where all the sensors will have the control of the error statistics.
Okay? So, we have the responsibility to show for the community about 10 sensors, all of them, controlling the details of the measurements. And the other development using a micro controller is done with a micro pipe.
Okay? Thank you very much. Thank you very much.