Use MicroPython with Make Things Happy Boards

We all love MicroPython: flash the firmware, write a few lines of Python, and your program is running. But as soon as you need to connect the microcontroller to real-world signals and loads, things get more complicated. Now you’re dealing with voltage and current levels, relays, power outputs, analog signals—and often isolation and protection as well.

That means sourcing add-on boards or designing your own circuitry. Before long, a simple software project has turned into a hardware project too.

There’s an easier way: pick a MicroPython-capable microcontroller, pair it with IoTsmart or IoTbase, and add the inputs and outputs you need with IoTextra modules.

MicroPython stays your familiar software tool, while the Make Things Happy platform handles the hardware connection to the real world.

Choose a Hardware Platform You Already Know

Let’s start with the microcontroller. There’s no need to switch platforms: use IoTsmart, or connect a compatible MicroPython board through IoTbase.

IoTsmart is available with RP2040, RP2350A, and ESP32-S3, while IoTbase supports the Raspberry Pi, Raspberry Pi Pico, and Arduino Nano board families—all options are shown in the diagram below. Support for ESP32-C6 and Adafruit Feather is in development.

Whichever option you choose, you use the same IoTextra modules.

MicroPython platform options: IoTsmart and IoTbase with IoTextra modules

Tap the diagram to view full size

Connecting to the Real World: IoTextra Modules

Once you’ve chosen the controller, the next step is connecting it to real signals and loads. Don’t spend time designing and debugging your own hardware for level shifting, isolation, protection, and load switching. That’s exactly what IoTextra modules are for.

They add what a microcontroller board usually lacks: isolated digital inputs, power outputs, relays, and analog inputs for standard voltage and current signals.

Choose only the functions you need now; you can add more modules later. Below are the four main groups of IoTextra capabilities.

IoTextra digital inputs
IoTextra digital outputs
IoTextra relay outputs
IoTextra analog inputs

MicroPython Examples

That takes care of the hardware. Now let’s see how it looks in MicroPython. You can start with a few lines of code, move on to I²C, and use ready-made drivers for real projects. All source code is open and available on GitHub.

Basic Examples: GPIO

In the simplest setup, an IoTextra module plugs directly into IoTsmart via the HOST connector. Each channel maps to one of the AP0–AP7 pins, so the standard machine.Pin is all you need—no drivers, no I²C. The examples are written for IoTsmart RP2040; for a different controller, just change the pin numbers at the top of the file.

The examples handle the modules’ active-low logic and switch all outputs off at startup.

IoTextra Input—polling 8 galvanically isolated digital inputs

View the example on GitHub

IoTextra Relay2—cycling through 4 relays one at a time

View the example on GitHub

IoTextra MOSFET2—controlling 8 MOSFET outputs in two isolated groups

View the example on GitHub

More Advanced Examples: I²C

Digital IoTextra modules can also be controlled over I²C through the onboard TCA9534 expander. This frees up microcontroller pins and lets you put several IoTextra modules and other I²C peripherals on the same bus. Analog modules work over I²C only.

IoTextra Relay2 + OLED—the relays are switched through the TCA9534, and their state is shown on an SSD1306 128×32 display. The expander address is detected automatically, and the relays don’t toggle during initialization. The example is written for IoTbase PICO and IoTbase NANO (ESP32-S3 or RP2040) and works with IoTextra Combo after changing a single parameter.

View the example on GitHub

IoTextra Analog—an interactive test of four differential channels on two ADS1115 ADCs. ADC addresses are detected automatically, and the PGA gain is selected based on the configured voltage or current range. Out-of-range readings are flagged.

View the example on GitHub

Ready-Made IoTextra Drivers

These examples are a quick way to get started and see how everything works. But in a real project, you don’t have to work directly with machine.Pin, the TCA9534, or the ADCs every time.

Ready-made MicroPython drivers for IoTextra modules currently in production are already available in IoTflow Kernel. They support digital modules in GPIO and I²C modes, including latching relays and ISO1211-based inputs, analog modules based on the ADS1115 and ADS7828, and configuration storage in EEPROM.

IoTflow Kernel on GitHub

Getting Started

1.    Choose IoTsmart, or a MicroPython board with the matching IoTbase.

2.    Add the IoTextra modules you need.

3.    Install MicroPython as usual for your controller.

4.    Run one of the examples above.

From there, move on to the IoTextra drivers as your project grows.