MicroPython and ESP8266 Airboat
Water Python
An airboat project uses a standalone WiFi web server for remote control.
My daughters and I have built a number of airboat projects, but this time I thought that I'd use MicroPython [1], a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimized to run on microcontrollers.
For this project, my goal was to create a MicroPython standalone WiFi access point and use it as a small web server for controlling the airboat fans.
Hardware
The hardware for this project included:
- 1 ESP8266 module (WiFi microchip)
- 2 L9110 fans
- 1 Arduino Uno proto shield (or use a small breadboard)
- 9V battery or portable phone charger
- K'Nex blocks
- 1 small plastic box
- 2 plastic water bottles
- Duct tape
MicroPython is supported on a number of WiFi-enabled ESP32 and ESP8266 modules. These modules are well priced, with the NodeMCU module starting around $5. Most of the ESP8266 modules also support Lua and Arduino C/C++ programming.
For this project, I used a WeMos ESP8266 module, which comes in a Arduino Uno form factor (Figure 1). I like the WeMos modules, because I can use my Uno proto shields. Also, these modules support 5V DC, as opposed to the typical MicroPython modules, which only support 3.3V. The fans will work with 3.3V, but they generate a lot more wind power at 5V.
The L9110 fans (Figure 2) designed for Arduino projects only cost about $5. They have four pins: VCC, GND, INA (direction), and INB (on/off). For this project, I only used forward-spinning fans, so I only needed to use the INB pin.
Boat Construction
For the boat frame, I used K'Nex pieces because they are lightweight and sturdy (Figure 3); however, other construction kits could be used, as well. Water bottles provided flotation, and duct tape secured the bottles to the frame. To help protect the electronics, I used a small plastic snack container. The fans were wire-wrapped to the boat frame.
MicroPython Setup
Among the available MicroPython development environments, the uPyCraft IDE [2] that I used for this project is well-integrated (Figure 4) and has some excellent tutorials to help you get started.
Typically for MicroPython projects, you create two applications: boot.py
and main.py
. I like to equate this arrangement to Arduino, which has a setup()
function (boot.py
in Python) and a loop()
function (main.py
in Python). For this example, I wanted to keep the documentation simple, so I put everything in the boot.py
file; however, a main.py
file is recommended for larger projects.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.