Running Four Brushless Motors With A Single Pi Pico

Sometimes, you have to drive four motors, and you need to do so with a certain level of control. You could throw a lot of parts at the problem, but you don’t necessarily have to. As [Shaun Crampton] demonstrates, you can run four brushless DC motors with a single Pi Pico.

[Shaun] set about developing a brushless motor controller from scratch with the Pico, relying on its PIO hardware and the TI DRV8313 — a handy three phase motor driver. Before he knew it, he was implementing field oriented control (FOC) in MicroPython, only to find that it was a little too slow for proper motor control work. He soon switched to C for the lower overheads, and was readily driving a brushless motor with his own code. Before long, he’d implemented torque limiting and PID speed control. He was even able to optimize things to the point where he had four motors hanging off a single Pi Pico, complete with Hall sensors for feedback.

The full story is well worth reading, as it goes from “Hello, World” all the way to the end of the project. If you’ve never experienced the joy of your own code getting a motor to spin, you might enjoy following in [Shaun’s] footsteps. Files are on GitHub for the curious.

We’ve seen a lot of motor controllers around here, many of which draw heavily from other projects online. It’s a great way to learn the basics of what is a very well established field. Meanwhile, if you’re cooking up your own project in this space, do drop us a line!

BreadboardOS, A Command Line Interface For The Pico

Operating systems! They’re everywhere these days, from your smart TV to your smartphone. And even in your microcontrollers! Enter BreadboardOS for the Raspberry Pi Pico.

BreadboardOS is built on top of FreeRTOS. It’s aim is to enable quick prototyping with the Pi Pico. Don’t confuse operating system with a graphical environment — BreadboardOS is command-line based. You’d typically interface with it via a serial terminal emulator, but joy of joys, it does support color!

Using BreadboardOS is a little different than typical microcontroller development. Creating an application involves adding a “service” which is basically a task in FreeRTOS parlance. The OS handles running your service for you. Via the text interface, you can query running services, and start or kill them at will.

Meanwhile, running df will happily give you stats on the flash usage of the Pi Pico, and free will tell you how full the memory is doing. If you really want to get raw, you can make calls to control GPIO pins, the SPI hardware, or other peripherals, and do it right on the command line.

BreadboardOS isn’t for everyone, but it could prove a useful tool if you like that way of doing things. It’s not the only OS out there for the Pi Pico, either!

Continue reading “BreadboardOS, A Command Line Interface For The Pico”

A capacitive touch MIDI instrument that doubles as a bookmark.

MIDI Bookmark Marks The Spot Where Work And Play Intersect

Have you ever wanted to take a break from reading or studying to just rock out for a few blissful minutes? If you’re anything like us, you like to rock out most of the time and take the occasional break to do your reading. Either way, you really can’t go wrong with this MIDI bookmark from [Misfit Maker].

The guts of a MIDI bookmark.This slick little bookmark may look 3D printed, but it’s all carefully-cut foam board in two thicknesses. Even the keys are made foam board — they’re just wrapped in carbon fiber so they look extra cool.

Underneath that carbon fiber is a layer of aluminium tape to make them capacitive. [Misfit Maker] recommends using copper tape instead because it allows for wires to be soldered directly to the keys.

The brains of this beauty is in the form of an ESP32 which is controlling an MPR-121 capacitive touch sensor. If you’d like to make one of these for yourself, there are plenty of helpful GIFs embedded in the thorough write-up. Be sure to check out the brief demo after the break.

If you want to easily MIDI-fy something and use touch inputs, you can’t really go wrong with the Raspberry Pi Pico, which does capacitive touch natively. Check out this MIDI kalmiba to learn more.

Continue reading “MIDI Bookmark Marks The Spot Where Work And Play Intersect”

A beehive sits on bricks with an outdoor-rated box full of electronics to monitor the hive.

Hive Monitor Is The Bee’s Knees

Beekeeping is quite the rewarding hobby. There’s delicious honey and useful wax to be had, plus you get the honor of knowing that you’re helping to keep the bee population surviving and thriving. [Ben Brooks] likes to keep tabs on the hive, but doesn’t like the idea of opening it up more often than necessary. After a couple of beekeeping rodeos, [Ben] decided to build his own tracker to get reports on the health and the activity of the hive through Home Assistant.

A white outdoor-rated box opened to reveal electronics to monitor a beehive.This hive tracker features a light sensor, a temperature sensor, and three strain gauges to measure the weight. There would be four, but a mouse decided to take a bite of the wires in the most nightmarish place to repair.

Everything runs off of an ESP32, and there’s an external antenna involved because the hive is nearly out of Wi-Fi range. The strain gauges are the affordable bathroom-scale type, and [Ben] has extras for if and when the number of hives goes up.

We like the combination of hard work and simplicity going on here — [Ben] milled and drilled the PCB himself, and used phone plugs to connect the temperature and weight sensors. Unfortunately, the plugs make the strain gauges a little finicky, so [Ben] says he would probably use screw terminals next time, or might be soldering the wires sooner rather than later. Consider this one a work in progress, and keep watching for updates as [Ben] works out the kinks.

Interested in beekeeping, but don’t want to build a traditional hive? Check out this beehive in a bottle.

A small gauge showing power generated by a house's solar panels.

Cute Solar Power Gauge Brightens The Day

What’s the first thing you want after installing solar? All the sunshine you can get, of course. Especially if you did it in the wintertime. And what would be more fun than monitoring your power generation, especially leading up to the equinox, or start of spring? Probably not much, especially if you built a cute solar power gauge like [Ben] did to keep him from obsessively checking his phone.

At the heart of this build is the affordable Seeed Xiao ESP32C3, which controls an equally cost-effective automotive stepper via an L293D H-bridge driver. Then it was just a matter of hooking it into Home Assistant. As power is generated by the solar system, the cute little sun on the gauge rises and shows the kilowattage gained.

Unfortunately there’s no real data sheet for the stepper, so [Ben] opted to use the 5 V from the USB that’s powering the ESP32. However, it seems like this might not be enough power because the gauge appears to drift a bit. To fix this, [Ben] runs the stepper_init script twice a day, which cranks the dials all the way forward then all the way backward before settling on the last known value.

Are you interested in solar? Here’s how you can build a small power system.

Two assembled 1 dollar TinyML boards

$1 TinyML Board For Your “AI” Sensor Swarm

You might be under the impression that machine learning costs thousands of dollars to work with. That might be true in many cases, but there’s more to machine learning than you might think. For instance, what if you could shower anything with a network of cheap machine-learning-enabled sensors? The 1 dollar TinyML project by [Jon Nordby] allows you to do just that. These tiny boards host an STM32-like MCU, a BLE module, lithium ion power circuitry, and some nice sensor options — an accelerometer, a pair of microphones, and a light sensor.

What could you do with these sensors? [Jon] has talked a bit about a few commercial and non-commercial applications he’s worked on in his ML career, and tells us that the accelerometer alone lets you do human presence detection, sleep tracking, personal activity monitoring, or vibration pattern sensing, for a start. As for the sound input, there’s tasks ranging from gunshot or clapping detection, to coffee roasting process tracking, voice and speech detection, and surely much more. Just a few years ago, we’ve seen machine learning used to comfort a barking dog while its owner is away.

Bottom line is, you ought to get a few of these in your hands and start playing with ML. You still might need a bit of beefier hardware to train your code, but it gets that much easier once you have a network of sensors waiting for your command. Plus, since it’s an open source project, you’ll have a much easier time adding on any additional capabilities your particular application might need.

These boards are pretty cost-optimized, which makes it possible for you to order a couple dozen without breaking the bank. The $1 target is BOM cost, especially if you opt to not include one of the pricier sensors. You can assemble these boards yourself, or get them assembled at a fab of your choice for barely a cost increase. As for software, they will work with the emlearn framework.

Everything is on GitHub — from KiCad sources to Jupyter notebooks. As for Hackaday.io, there are five worklogs of impressive insight — the microphone worklog alone will teach you about microphone amplification in low-power conditions while keeping the cost low. Not as price-constrained and want to try on some image processing tasks? Here’s a beautiful Pi Pico ArduCam board with a camera and a TFT screen.

A render of the USB Blaster, showing all the major parts

The Cheapest USB Blaster Ever, Thanks To CH552

Here’s a CH552G-based USB Blaster project from [nickchen] in case you needed more CH552G in your life, which you absolutely do. It gives you the expected IDC-10 header ready for JTAG, AS, and PS modes. What’s cool, it fits into the plastic shell of a typical USB Blaster, too!

The PCB is flexible enough, and has all the features you’d expect – a fully-featured side-mounted IDC-10 header, two LEDs, a button for CH552 programming mode, and even a UART header inside the case. There’s an option to add level shifter buffers, too – but you don’t have to populate them if you don’t want to do that for whatever reason! The Hackaday.io page outlines all the features you are getting, though you might have to ask your browser to translate from Chinese.

Sadly, there’s no firmware or PCB sources – just schematics, .hex, BOM, and Gerber .zip, so you can’t fix firmware bugs, or add the missing USB-C pulldowns. Nevertheless, it’s a cool project and having the PCB for it is lovely, because you never know when you might want to poke at a FPGA on a short notice. Which is to say, it’s yet another CH552 PCB you ought to put in your PCB fab’s shopping cart! This is not the only CH552G-based programming dongle that we’ve covered – here’s a recent Arduino programmer that does debugWire, and here’s like a dozen more different CH552G boards, programmers and otherwise.