Posts | Comments

Planet Arduino

Archive for the ‘micropython’ Category

In the past, DIY tech enthusiasts faced limitations when it came to creating small and intricate projects. However, the introduction of technologies like MicroPython and tiny microcontroller boards such as the Arduino Nano revolutionized the field. This enabled makers to build genuinely projects like wearables, miniature robotics, and ultra-thin gadgets, ushering in a new era of innovation. In this article, we’ll explore MicroPython, its utility, the capabilities of the Arduino Nano family, and showcase some shrunken-down project examples.

What is MicroPython (and why does it matter)?

The Python programming language dates back to 1991, and is one of the most widely-known and used languages out there.

In 2014, a more lightweight version of Python was released, with the goal of being run on microcontrollers and other small systems. Thus, MicroPython was born and a new era of engineering began.

What does MicroPython bring to the table? Let’s take a look at some of the advantages:

  • It’s simple, allowing developers to write code in the famously accessible Python language.
  • It’s designed for small-scale projects and is able to operate with limited resources.
  • It’s versatile, and has the ability to work across a range of different microcontroller platforms.
  • It’s been used, successfully, in countless projects including Internet of Things devices, robotics, sensors and much more.

Understanding Nano boards

Now let’s look at the second ingredient in creating amazing, tiny projects — Nano boards. Developed by Arduino, these boards consist of a microcontroller unit, input and output pins, and components like LEDs and sensors.

Here’s what they offer:

  • A compact design, making them perfect for projects where space is a key concern.
  • A range of digital and analog input/output pins that can be easily programmed for more versatility.
  • They’re cost-effective and easy to find. 

Why small projects matter in tech

Do the best things actually come in small packages? Not always, but in the world of tech, this rings pretty true a lot of the time.

While big, grand creations are valuable too, smaller-sized projects have an incredibly useful role to play. Let’s take a look at why fun-sized designs are so important.

  • Space efficiency: Unlike their bigger counterparts, physically small projects don’t require much space, making them ideal for use in more compact environments like homes, or where more discrete and unobtrusive solutions are required — for example an automated hearing aid.
  • Expandable: Smaller projects are more modular — you can start with one piece and then add new parts as you go, based on your needs and new ideas.
  • Accessible: Small projects are simpler to start and cheaper to build, making them great choices for beginners or people with limited resources or financial constraints. They’re a great gateway to the world of home automation and DIY tech.
  • Customizable: Smaller projects are easy to tweak and adapt, making them more suited to customisation. This lets you build projects in exactly the way you desire and amend them over time.
  • Prototyping potential: Smaller hardware projects make great prototypes for bigger and more resource-heavy work. They enable you to experiment with different hardware components and concepts on a cheaper and lower-stakes scale before committing to a big, expensive project.
  • Compatibility with bigger systems: Platforms like Arduino’s Nano boards and MicroPython tend to be highly compatible with larger systems like home automation networks. This makes it effortless to integrate your smaller projects into your overall setup.
  • Lower power consumption: Thanks to their size, small-scale projects tend not to use up huge amounts of power, and are often built with energy efficiency in mind. This is not only good for the planet, but it also means your smaller projects can run for extended periods of time without the need for constant recharging.

Using Arduino with MicroPython

Now we have some idea of why small projects are so significant, let’s talk about how to start making them with Arduino and MicroPython.

If you remember, one of the great things about MicroPython is its simplicity — you don’t need to be a tech prodigy to learn the basics and start tinkering around with this language. It’s also highly established and there are a ton of resources and documentation for using this language across a number of different boards.

It’s imperative to keep in mind that programming an Arduino board with MicroPython is a very different process to using the Arduino IDE.

Here’s a quick guide to getting started with MicroPython on an Arduino board:

1. Install MicroPython on your Arduino board, and then load a Python script — called a script.py.

2. Download the Arduino Lab for MicroPython. This is a lightweight editor built to enable interaction between your computer and your Arduino board. It allows you to perform tasks like selecting a port and loading scripts.

3. Download the OpenMV editor. This platform enables you to program Arduino boards using a fork of the MicroPython language. The editor lets you upload scripts directly to the board and get started with your very first projects.

Arduino examples

There are currently five Arduino boards that officially support MicroPython: 

For a smart maker with imagination, the possibilities are almost endless here. Let’s explore a couple examples of small but spectacular Arduino projects brought to life with MicroPython.

Pico-Kubik quadruped robot

Big robots are so last century.

These days, the really cool kids are building tiny robots. Like this one, the Pico-Kubik robot built by Radomir Dopieralski.

It’s the latest in a line of quadruped robots, and this one is small enough to fit in the palm of your hand. One of the two versions runs MicroPython, and even carries its own webcam.

InkPlate 10

With the right tools, it’s possible to build projects that are literally paper-thin.

Enter the InkPlate 10 — a 25cm ePaper display that can be programmed using Arduino and MicroPython. It’s a razor-thin tablet that can be easily programmed, and is made from recycled kindles and similar tech. It’s also available at a very wallet-friendly price point.

The future of tiny tech

As time goes on, we’ll be able to build smaller and smaller projects. This means the future for tiny tech is truly exciting, with some fascinating potential use cases on the horizon. Here’s a glimpse at some things to look forward to here:

  • AI integration: As small hardware becomes capable of running lightweight AI models, we could see the emergence of new functions like tiny smart cameras with object recognition.
  • Low-power designs, with tiny tech projects using increasingly sustainable resources: The ability to run for longer and use renewable energy sources and battery technology will allow for more efficient and eco-friendly designs.
  • Even smaller projects: As the technology around Nano boards and programming continues to develop, it’ll be possible to create smaller and smaller projects, opening the doors to even more possibilities in areas like wearables and healthcare devices.
  • Better connectivity: Small projects will be able to use technologies like 5G and Wi-Fi 6 more easily and smoothly, allowing for more versatile applications like remote control and use in IoT networks.
  • Open-source communities: As open-source communities for hardware and software continue to grow and develop, we’ll see even more shared knowledge and libraries of open-source code aimed at helping developers and makers create their own tiny projects.
  • More diverse uses for tiny tech: In the future, we could see even wider applications for this kind of technology, from wearable health monitors and highly precise farming sensors to new ways of monitoring the environment.
  • A greater focus on security: As tiny tech becomes more common, it’ll also become more of a target for hackers. This will prompt a push to take security more seriously here, driving more sophisticated and smart approaches to device safety.

Embrace tiny tech with Arduino

The future for tiny tech projects is truly exciting. Today’s makers and tech enthusiasts have access to a wealth of tools, techniques, and learning resources that is growing rapidly, all the time.

At Arduino, our Project Hub is filled with examples of smaller projects. Our Nano boards give you the tools to break through new frontiers of creativity and innovation, taking your smart home and DIY projects to the next level.

Contact us to learn more about Nano boards and Arduino in general, and get started today.

The post Great things come in tiny packages: Get started with Arduino and MicroPython today appeared first on Arduino Blog.

Arduino Lab Editor for MicroPython

At the end of last year (November 2022) we announced initial support for MicroPython in the Arduino ecosystem, and continued to quietly work on the toolkit for this language.

We continuously expand the list of Arduino boards for which a MicroPython firmware is provided (available here)

Additionally, we are now releasing new tools to help developers use this language with Arduino Boards as well as third party ones. These tools are released as experimental, under the umbrella of Arduino Labs.

Arduino Lab Editor for MicroPython

Arduino Lab Editor for MicroPython has now reached version 0.8 with these key features:

  • Improved UI
  • Better file management (subfolder support)
  • More stable file-system operations for save/upload/download/run
  • Manage libraries and modules more easily in the `lib` folder and keep a cleaner board storage

Arduino Lab Installer for MicroPython

Arduino Lab Installer for MicroPython is a new tool which simplifies the process of flashing the MicroPython firmware image on Arduino boards.

Arduino Lab Editor for MicroPython

Last but not least, we have created an initial list of MicroPython packages that we consider useful to learn and experiment with this language. The list is published as Arduino MicroPython Package Index (here)

Arduino Lab Editor for MicroPython

While investigating existing packages we quickly realized that many were available but not always up-to-date or in line with the latest MicroPython versions or certain target hardware. Therefore we decided to  maintain a curated list of useful packages which are tested to be compatible with Arduino boards, and most importantly with updated versions of the official MicroPython..

You can browse the list, download the packages from their corresponding Github repository and install them via Arduino Lab Editor for MicroPython. We plan to release tools to easily search, download and install from this package index in the future. 

Anybody can contribute to the Arduino MicroPython Package Index! If you want to propose a package to be added, follow the contribution guidelines published in the repo.

Everyone at Arduino is excited about this new adventure, and we believe that we can contribute to this ecosystem as it keeps maturing and growing its user-base across the Maker, Education and Professional spaces.

We can’t wait to see what you’ll build!

The post Experiment with new tools for MicroPython appeared first on Arduino Blog.

At Arduino we like to experiment with new technologies to figure out if we can use them to improve the tools we make for our users. We’ve recently been experimenting with the Python language as a possible extension for our programming platforms, considering how it has become the number one language for many types of users. Specifically we’re looking at MicroPython, the version of Python that runs on microcontrollers. We’ve created a partnership with OpenMV, which ported their computer vision oriented virtual machine to some of our products and enabled us to do incredible stuff with the Nicla Vision (for example).

Expanding on this initial experience we were lucky enough to partner with the creator of MicroPython, Damien George, to port the official the virtual machine to a number of Arduino products. You can find our code here. We’re sure you’ll going to love it!

Thanks to one of our developers (Ubi de Feo) we were able to test MicroPython on a class of students and we’ve learned a lot from that experience. In particular, we noticed that it’s hard to find a very simple cross platform MicroPython IDE that would be as easy to use as the original Arduino IDE.

Luckily we came across the work of Murilo Polese, who developed a simple tool we were able to adapt and use for teaching. The results have been so good that we decided to collaborate with him to produce a tool we can share with the community.

We’re very excited to announce the new Arduino Lab for MicroPython, a simple, cross-platform IDE for MicroPython that supports any board with a serial REPL interface so it can also work with non-Arduino boards.

This is not an official product yet, it’s an experimental tool — but we wanted people to play with it so we created a new website “Arduino Labs,” where we’ll post experimental tools for people to try out and give us feedback. It’s not guaranteed that they will become fully released products. In the meantime, enjoy them and try them out!

You can find Arduino Lab for MicroPython at labs.arduino.cc.

The post MicroPython officially becomes part of the Arduino ecosystem appeared first on Arduino Blog.

Micropython for Arduino

Python support for three of the hottest Arduino boards out there is now yours. Through our partnership with OpenMV, the Nano RP2040 Connect, Nano 33 BLE and Nano 33 BLE Sense can now be programmed with the popular MicroPython language. Which means you get OpenMV’s powerful computer vision and machine learning capabilities thrown in.

OpenMV IDE and MicroPython Editor

While you can’t use Python directly with the Arduino IDE, you can use the OpenMV editor, and its version of MicroPython. From the editor, you can install MicroPython and load your scripts directly to the supported Arduino boards.

MicroPython is a great implementation of the full Python programming language, designed to run on microcontrollers. There’s extensive documentation all across the web, which is another huge advantage of learning and using Python for your Arduino projects.

There are so many reasons to get excited about MicroPython for these new Arduino boards. To name a few…

  • OpenMV’s machine learning and computer vision tools.
  • Great for computer science education.
  • Easy for web developers and coders to switch from other platforms to Arduino.
  • Huge number of MicroPython libraries, tutorials, guides and support online.
  • Simple to upgrade hardware as project demands increase (eg, upgrade from a Nano RP2040 Connect to a Portenta H7).

There are also lots of Arduino + Python projects that have been posted over the years. Now you can add the Nano devices to those projects and expand on them with their new MicroPython capabilities.

Python for Nano RP2040 Connect

Get Started with Python on Arduino

To help you get cracking, we’ve put together a few guides for each of the supported Arduino boards. The Portanta H7 already supports MicroPython, but we’ve included it below for the sake of completion.

Firstly you’ll need to install the OpenMV IDE on your computer. You can grab that from the OpenMV download page right here

If it’s the first time you’ve used Python on your Arduino board, you’ll need to follow a few steps to get everything working together. Depending on which board you’re using, you might need to update the bootloader to make it compatible with OpenMV. Then you can connect to the board to upload the latest firmware and make it compatible with the editor.

There are guides to take you through the process for each board, and it’s not a complex task. Once completed, your boards will be ready to program them using MicroPython.

These simple tutorials will get you moving quickly.

Furthermore, you can find a few examples of MicroPython scripts you can upload and run on the various boards, too. It’s a great way to test the Python waters with your Arduino boards, and pick up a couple of hints and tips on using the language.

If you’ve got any resources, hints or tips of your own when it comes to learning or using Python, please do share them with the community! We want to hear all about your experiences, and any projects you build using Arduino and Python together.

We’ll keep you updated as we add more documentation and tutorials for MicroPython over on Arduino Docs, so keep an eye out for those.

The post Power of Python for Arduino Nano RP2040 Connect and Nano 33 BLE appeared first on Arduino Blog.

[Zoltán] sends in his very interesting implementation of a NumPy-like library for micropython called ulab.

He had a project in MicroPython that needed a very fast FFT on a micro controller, and was looking at all of the options when it occurred to him that a more structured approach like the one we all know and love in CPython would be possible on a micro controller too. He thus ended up with a python library that could do the FFT 50 times faster than the the pure Python implementation while providing all the readability and ease of use benefits that NumPy and Python together provide.

As cool as this is, what’s even cooler is that [Zoltan] wrote excellent documentation on the use of the library. Not only can this documentation be used for his library, but it provides many excellent examples of how to use MicroPython itself.

We really recommend that fans of Python and NumPy give this one a look over!



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook