You don’t necessarily need to be a programmer to play with microcontrollers. Simply grab some pre-made firmware from someone else, and use it on your microcontroller - done!
For example, get an affordable ESP32 microcontroller board and a cheap 8x8 WS2812 LED matrix panel, and upload the awesome WLED firmware to your microcontroller - right from within your browser.
With just three wires and very limited soldering expertise, you can create this color cube with a rich list of selectable light effects:
All required parts cost less than €10 in total, the project takes just half an hour to build, and no fancy knowledge, special tools or expert soldering skills are required:
Here is everything you need to build your own color cube.
Overview
Using firmware that was made by someone else puts someone else in full control of your device: the firmware you choose does whatever its author programmed it to do.
That’s not as limiting as it might initially seem:
-
Special Purpose Firmware: Firmware like WLED is highly specific and controls LED strips and matrix panels. The author added a wireless interface accessible from your smartphone, plus so many options and features that you can tailor the firmware completely to your needs. Whether you want ambient lighting, a flashing emergency light, or intricate LED strip control, pre-defined firmware allows your microcontroller to handle these tasks without requiring you to write any code.
-
Adjustable Firmware: Firmware like ESPEasy and EspHome takes care of all the complex aspects, such as implementing a web interface or enabling over-the-air updates (OTA). This type of firmware isn’t tailored to a single purpose. Instead, it offers customizable options through graphical interfaces or configuration files (e.g., YAML). This flexibility enables you to create specific solutions without directly writing C++ code.
-
Interpreters: If you’re interested in programming but find C++ too complex, consider using an Interpreter firmware. These firmwares allow you to program your microcontroller using higher-level scripting languages such as LUA, Basic, Python, or JavaScript. The interpreter handles the translation of your script into the assembly language that the microcontroller understands, simplifying the process.
Uploading New Firmware
Uploading existing firmware to your microcontroller often only requires a Chromium-based browser (as shown in the WLED project).
If you already have the binary firmware file, you can also use specialized flashing tools. These tools are designed for specific microcontroller types and can be run locally or via websites. For example, the Adafruit ESPTool works well for flashing firmware onto ESP32 microcontrollers.
Special Purpose Firmware
Special Purpose Firmware targets a highly specific use case. Within this use case, the firmware let you customize and tailor the solution to your needs using a variety of web interfaces and/or smartphone apps. The already mentioned WLED firmware is an example, and there are many more.
CO2 Sensor
CO2 Gadget turns a CO2 sensor into a smartphone app. It runs on any ESP32 microcontroller, and it comes with a web browser-based firmware flashing tool.
The hardest part often is finding the correct links: the authors’ web page is huge and not structured too well. Links to the browser-based firmware uploads can be found somewhere in the middle of it.
There are different firmware versions, targeting ESP32 microcontrollers with different displays attached to them.
Source code is hardware neutral. Once it gets compiled into a binary by an IDE, it is converted into a hardware-specific firmware. This firmware can now only be used on the particular hardware (microcontroller board) that was specified during compile time. When you take the shortcut and directly upload pre-fabricated firmware, you must be certain that it was indeed made for your particular microcontroller and board. Else, the firmware will not run (correctly).
Programmable Firmware
The classic type of programmable firmware is interpreters. Interpreters can understand script languages, allowing users to avoid low-level programming and instead focus on the actions the microcontroller should perform.
An interpreter translates the script instructions submitted by the user into actual machine code executed by the microcontroller. While interpreters simplify programming, scripts are generally limited, and interpreters introduce overhead that can increase energy consumption and execution time.
To address these limitations, frameworks like ESPHome have emerged. These frameworks use configurations to describe desired states or behaviors. These configurations are then compiled into a binary firmware file. Unlike interpreters, ESPHome produces firmware that runs as efficiently and quickly as if it had been manually programmed in C++.
Interpreters
Most interpreters designed for microcontrollers are primarily used in educational environments or to play with microcontrollers.
Interpreters powerful enough to be of interest to the industry typically require full-blown computers (e.g., Python, which needs a PC or Raspberry Pi).
Efforts have been made to create optimized script languages like MicroPython that run on small microcontrollers. However, the trend today is toward frameworks like ESPHome, which is just as simple to use as a script language, but much more powerful, producing clean binary firmware files.
For completeness, here’s an overview of interpreters that can be used with small microcontrollers.
LUA
- Lua (eLUA) – Embedded Lua is a lightweight implementation of the Lua programming language for embedded systems.
- NodeMCU – NodeMCU is a project that develops ESP8266 and ESP32 microcontroller boards bundled with an adaptation of eLUA that is guaranteed to match the hardware. The preinstalled firmware can easily be replaced with any other firmware, including custom firmware you write yourself if you are interested in the hardware board but not in Lua.
Python
- MicroPython – The MicroPython firmware executes scripts written in Python 3 and also supports interactive console operation (REPL, read-eval-print loop). It includes a small subset of the Python standard library and is optimized to run on microcontrollers with limited resources (RAM and storage).
- CircuitPython – A derivative of MicroPython, designed by Adafruit to make learning and using Python on microcontrollers simpler. It focuses on ease of use and education.
JavaScript
- Espruino – A JavaScript interpreter for microcontrollers, allowing you to develop embedded applications using JavaScript with an interactive JavaScript environment.
- JerryScript – A lightweight JavaScript engine intended for microcontrollers with constrained resources. It features low memory usage and can run on microcontrollers with less than 64KB of RAM. It supports a subset of the ES5.1 standard.
BASIC
- ESPBasic – A BASIC interpreter for ESP8266 microcontrollers. It allows easy and wireless programming.
- TinyBASIC – A minimalistic version of the BASIC programming language, designed for resource-constrained systems.
Others
- Squirrel – A high-level scripting language, somewhat inspired by Lua, designed to be lightweight and embeddable, with an object-oriented approach.
- TinyGo – A Go compiler that translates Go code into machine code, enabling it to run on microcontrollers.
- WASM3 – A WebAssembly interpreter designed for small devices and microcontrollers that can run WebAssembly bytecode on microcontrollers.
Slow Website?
This website is very fast, and pages should appear instantly. If this site is slow for you, then your routing may be messed up, and this issue does not only affect done.land, but potentially a few other websites and downloads as well. Here are simple steps to speed up your Internet experience and fix issues with slow websites and downloads..
Comments
Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.
Here is how your comments are stored
Whenever you leave a comment, a new github issue is created on your behalf.
-
All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.
-
There is no third-party provider, no disrupting ads, and everything remains transparent inside github.
Github Users Yes, Spammers No
To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant utteranc.es the permission to submit issues on your behalf.
If you don’t have a github account yet, go get yourself one - it’s free and simple.
If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.
Discussions
For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.
(content created May 11, 2024 - last updated Dec 17, 2024)