We’re in an exciting time for cheap microcontrollers, as with both the rise of RISC-V and the split between ARM and its Chinese subsidiary, a heap of super-cheap and very capable parts are coming to market. Sometimes these cheap chips come with the catch of being difficult to program though, but for one of them the ever-dependable [CNLohr] has brought together his own open-source toolchain. The part in question is the WCH CH32V003, which is a ten-cent RISC-V part that has an impressive array of capabilities. As always though, there’s a snag, in that we’re also told that while supplies are improving this part can be hard to find. The repository is ready for when you can get them again though, and currently also contains some demo work including addressable LED driver code.
As an alternative there’s a comparable and slightly cheaper ARM-based part, the Puya PY32. It’s reckoned to be the cheapest of the flash-based microcontrollers, and like the WCH part is bearing down on the crop of one-time-programmable chips such as the famous and considerably less powerful 3-cent Padauk. This end of the market is certainly heating up a little, and from our point of view this can only mean some exciting projects ahead.
Synthesizers can make some great music, but sometimes they feel a bit robotic in comparison to their analog counterparts. [Sound Werkshop] built a “minimum viable” expressive synth to overcome this challenge. (YouTube)
Dubbed “The Wiggler,” [Sound Werkshop]’s expressive synth centers on the idea of using a flexure as a means to control vibrato and volume. Side-to-side and vertical movement of the flexure is detected with a pair of linear hall effect sensors that feed into the Daisy Seed microcontroller to modify the patch.
The build itself is a large 3D printed base with room for the flexure and a couple of breadboards for prototyping the circuits. The keys are capacitive touch pads, and everything is currently held in place with hot glue. [Sound Werkshop] goes into detail in the video (below the break) on what the various knobs and switches do with an emphasis on how it was designed for ease of use.
Modern WiFi-enabled microcontrollers have made it affordable and easy to monitor everything from local weather information to electricity usage with typically no more than a few dollars worth of hardware and a little bit of programming knowledge. Monitoring one’s own utility data can be a little bit more difficult without interfering with the metering equipment, but we have seen some clever ways of doing this over the years. The latest is this water meter monitoring device based on a Raspberry Pi Pico.
The clever thing here isn’t so much that it’s based on the tiniest of Raspberry Pis, but how it keeps track of the somewhat obscured water flow information coming from the meter. Using a magnetometer placed close to the meter, the device can sense the magnetic field created as water flows through the meter’s internal sensors. The magnetic field changes in a non-obvious way as water flows through it, so the program has to watch for specific peaks in the magnetic field. Each of these specific waveforms the magnetometer detects counts to 0.0657 liters of water, which is accurate for most purposes.
Before video games, there were pinball machines. Not that they don’t exist today, but a modern pinball machine will likely have microprocessors and other fancy things that traditional pinball machine designers could never dream of. [Eli] had one of these mechanical machines from 1974 as a kid and, later, encountered a more modern machine with a rudimentary microprocessor and other integrated circuits onboard. One thing this enabled is the ability to remember high scores. But you have to physically look at the machine, and you can only see the top four scores. [Eli] decided to adapt the machine to upload high score data to the Internet, and it is a fun project.
[Eli]’s design goals were to make it automatic and robust. That is, if the network is down or the machine loses power, you shouldn’t lose high score data. In addition, he didn’t want to change the appearance or damage the 40-year-old machine. You can see a video of how it all turned out below.
The Laser Cue machine is one of many built around the “Williams System 7” platform. A 6808 CPU, along with some I/O chips to manage all the lights, sensors, and bells. The game has only 1K of RAM, 12K or ROM, and 128 bytes (no prefix, just bytes) of RAM with battery backup. There was even a common “operating system” called Flipper ROM, and that’s actually documented over on GitHub.
The ESP32 version of the WiFi interface board
Since the memory for the machine is all in external chips, it was a reasonable idea to replace the CPU with a board that monitored signals on the board. The CPU would plug into this new board, and then a newer microcontroller with an Internet connection could eavesdrop on bus traffic. However, removing the old CPU and jamming pins into the ancient socket was worrisome, so instead, [Eli] elected to tap into a test connector that was already on the board but not plugged into anything.
An ESP32 is more than capable of the speeds, although connecting to 5 V logic was a bit of a problem. The CPU has 5 V tolerant pins, but some of the 25 available pins on the development board either set items on boot or may briefly be outputs and were thus unusable. To reduce the necessary pins, [Eli] decided to do some of the decoding in separate logic. Instead of using TTL chips, he elected to use a programmable logic array.
After that, it seemed it would be straightforward, but there was something preventing the ESP32 from reading each bus cycle. [Eli] never got to the bottom of it but instead switched to the Raspberry Pi Pico W. Using the chip’s special I/O processors made the job easy, and it worked perfectly. The rest of the project was just fit and finish. Be sure to read to the end to find out the lessons learned which might help you on your next similar project.
A modern DIY machine might even have an FPGA inside. Don’t have room for a big full-sized pinball machine? No problem.
There might seem like a wide gulf between the rapid prototyping of a project and learning a completely new electronics platform, but with the right set of tools, these two tasks can go hand-in-hand. That was at least the goal with this particular build, which seeks to use a no-soldering method of assembling electronics projects and keeping code to a minimum, while still maintaining a platform that is useful for a wide variety of projects.
As a demonstration, this specific project is a simple Wi-Fi connected temperature monitoring station. Based around an ESP32 and using a DS18B20 digital temperature sensor, the components all attach to a back plate installed in a waterproof enclosure and are wired together with screw-type terminal breakout boards to avoid the need for soldering. The software suite is similarly easy to set up, revolving around the use of Tasmota and ESPHome, which means no direct programming — although there will need to be some configuration of these tools.
With the included small display, this build makes a very capable, simple, and quick temperature monitor. But this isn’t so much a build about monitoring temperature but about building and prototyping quickly without the need for specialized tools and programming. There is something to be said for having access to a suite of rapid prototyping tools for projects as well, though.
Earlier versions of the Arduino IDE made uploading files to an ESP32’s SPIFFS filesystem easy via the ESP32FS plugin. Sadly, that’s no longer possible under the rewritten Arduino 2.0 IDE. Thankfully, [myhomethings] has stepped up to solve the problem with a new tool that also adds some new functionality.
The tool in question is the ESP32 Web Updater and SPIFFS File Manager. It features a web interface courtesy of the ESPAsyncWebServer library. Simply dialing into the ESP32’s IP address will grant one access to the interface. Once connected files can be uploaded to the ESP32, or deleted at will. Text files can be created and populated through the interface as well, and the SPIFFS file system can also be formatted if required. Plus, as a bonus, the interface allows for handy over-the-air firmware updates. One need only export a compiled binary from the Arduino IDE, and then load the resulting *.bin file into the ESP32 via the web interface. It does come with the caveat that if new firmware is uploaded that doesn’t include the ESP32 Web Updater itself, there will be no way to do further firmware updates in this manner.
For those working on projects that may need regular file system management, the tool may be very useful. Alternatively, if you just need to do OTA updates on an ESP32, we recently featured a way of doing them through GitHub.
There’s a bit of a contest going on when it comes to which is the cheapest microcontroller, yet most of the really cheap ones have one big trade-off in that they have one-time programmable (OTP) memory, generally requiring the use of an (expensive) device emulator during development. This raises the question of what the cheapest reprogrammable MCU is, which [Jay Carlson] postulates is found in the Puya PY32 ARM Cortex-M0+ based series.
Although [Jay] has previously mentioned that these cheap OTP (like the 3-cent Padauk PMS150) MCUs make sense for large volume production) it’s also easy to see that for small volumes and for hobbyists it’s much easier and cheaper to just reflash the firmware in the same cheap MCU rather than using an expensive in-circuit emulator. This is where the Puya PY32 comes into play, with parts ranging from 8 cents a pop (basic PY32F002A) to $0.74 for the more full-featured models on LCSC, and packages ranging from a miniscule DFN, to LQFP and hand soldering friendly SOIC. Continue reading “Puya PY32: The Cheapest Flash Microcontroller You Can Buy Is Actually An ARM Cortex-M0+”→