Remoticon Video: How To Use Machine Learning With Microcontrollers

Going from a microcontroller blinking an LED, to one that blinks the LED using voice commands based on a data set that you trained on a neural net work is a “now draw the rest of the owl” problem. Lucky for us, Shawn Hymel walks us through the entire process during his Tiny ML workshop from the 2020 Hackaday Remoticon. The video has just now been published and can be viewed below.

This is truly an end-to-end Hello World for getting machine learning up and running on a microcontroller. Shawn covers the process of collecting and preparing the audio samples, training the data set, and getting it all onto the microcontroller. At the end of two hours, he’s able to show the STM32 recognizing and responding to two different spoken words. Along the way he pauses to discuss the context of what’s happening in every step, which will help you go back and expand in those areas later to suit your own project needs.

Continue reading “Remoticon Video: How To Use Machine Learning With Microcontrollers”

Network Booting The Pi 4

We’ve talked about PXE booting the Raspberry Pi 3B+, and then looked at the Raspberry Pi 4 as a desktop replacement. But there’s more! The Pi 4 sports a very useful new feature, the flashable bootloader. Just recently a beta version of that bootloader was released that supports PXE  — booting up over the network — which has become a must-have for those of us who have had consistently bad experiences with root filesystems on SD cards.

Pi with no SD CardWhat are the downsides, I hear you ask? You might see slower speeds going across the network compared to a high quality SD card, particularly with the Pi 4 and its improved SD card slot. PXE does require an Ethernet cable; WiFi is not enough, so you have that restriction to contend with. And finally, this isn’t a portable option — you are tethered to that network cable while running, and tethered to your network to boot at all.

On the other hand, if you’re doing a permanent or semi-permanent install of a Pi, PXE is absolutely a winner. There are few things worse than dragging a ladder out to access a Pi that’s cooked its SD card, not to mention the possibility that you firewalled yourself out of it. Need to start over with a fresh Raspbian image? Easy, just rebuild it on the PXE server and reboot the Pi remotely.

Convinced PXE is for you? Let’s get started! Continue reading “Network Booting The Pi 4”

Preserved Lemons On A Hacker’s Budget

“If you wish to make an apple pie from scratch, you must first invent the universe.” [Carl Sagan]. If you wish to make preserved lemons the same way as [Uri Tuchman], you have to start with that mentality. Video also below. The recipe for [Uri]’s preserved lemons involves two ingredients see sea salt, and sliced lemons, but we don’t expect you came here looking for a recipe and the food is less important than the journey.

Recipes take for granted that we have all the necessary utensils on hand, but what if you are missing one? What if you are missing all of them? Life’s lemons won’t get the best of us, and if we’re utensil-poor and tool-rich we will make those lemons regret trying to take a bite out of us. The first fixture for cutting lemons is a cutting board, then a knife, and finally an airtight container. We see him make all of them from stock material by hand. Does that seem like a lot of work? You forgot that if you’re going to eat up, you’ll need a serving platter and fork. If he ever opens a restaurant, don’t expect it to be fast food.

Maybe humans will only need one tool in the kitchen someday but at least one cat receives food from a single silicone-brained tool.

Continue reading “Preserved Lemons On A Hacker’s Budget”

Building A Foam Machine From A Leaf Blower And A Water Pump

Imagine a tub overflowing with bubble bath, except it’s a club dancefloor and music is pumping all night. This is what is known as a “foam party” — a wild and exciting concept that nonetheless many are yet to experience. The concept exploded in popularity in Ibiza in the 1990s, and foam parties are regularly held at nightclubs and festivals the world over.

Foam is generated with the obviously-named foam machine, and these can be readily purchased or hired for anyone wishing to host such an event. However, that’s not the hacker way. If you’re a little ingenious and take heed of the safety precautions, here’s how you can do it yourself.

Continue reading “Building A Foam Machine From A Leaf Blower And A Water Pump”

A Raspberry Pi Is A Hardware Hacker’s Swiss Army Knife

By now most of us have used a Raspberry Pi at some level or another. As a headless server it’s a great tool because of its price point, and as an interface to the outside world the GPIO pins are incredibly easy to access with a simple Python script. For anyone looking for guidance on using this device at a higher level, though, [Arun] recently created a how-to for using some of the Pi’s available communications protocols.

Intended to be a do-everything “poor man’s hardware hacking tool” as [Arun] claims, his instruction manual details all the ways that a Raspberry Pi can communicate with other devices using SPI and I2C, two of the most common methods of interacting with other hardware beyond simple relays. If you need to go deeper, the Pi can also be used as a full JTAG interface or SWD programmer for ARM chips. Naturally, UART serial is baked in. What more do you need?

As either a tool to keep in your toolbox for all the times you need to communicate with various pieces of hardware, or as a primer for understanding more intricate ways of using a Raspberry Pi to communicate with things like sensors or other computers, this is a great write-up. We also have more information about SPI if you’re curious as to how the protocol works.

Thanks to [Adrian] for the tip!

A Lecture By A Fun Guy

Many people hear “fungus” and think of mushrooms. This is akin to hearing “trees” and thinking of apples. Fungus makes up 2% of earth’s total biomass or 10% of the non-plant biomass, and ranges from the deadly to the delicious. This lecture by [Justin Atkin] of [The Thought Emporium] is slightly shorter than a college class period but is like a whole semester’s worth of tidbits, and the lab section is about growing something (potentially) edible rather than a mere demonstration. The video can also be found below the break.

Let’s start with the lab where we learn to grow fungus in a mason jar on purpose for a change. The ingredient list is simple.

  • 2 parts vermiculite
  • 1 part brown rice flour
  • 1 part water
  • Spore syringe

Combine, sterilize, cool, inoculate, and wait. We get distracted when cool things are happening so shopping around for these items was definitely hampered by listening to the lecture portion of the video.

Continue reading “A Lecture By A Fun Guy”

The Simplest Possible DIY Ultrasonic Levitator

We thought that making things levitate in mid-air by the power of sound was a little bit more like magic, or at least required fancy equipment. It turns out that you can do it yourself easily enough with parts that any decent hacker’s closet should have in abundance: a motor-driver IC, two ultrasonic distance pingers, and a microcontroller. This article shows you how (translated here, scroll down).

But aside from a few clever tricks, there’s not that much to show. The two HC-SR04 ultrasonic distance sensors are standard fare, and are just being used as a cheap source of 40 kHz transducers. The circuit uses a microcontroller, but any source of 40 kHz square waves should suffice. Those of you who could do that with a 555 (or a Raspberry Pi), this one’s for you! A stepper motor driver bumps up the voltage applied to the transducers, but you could use plain-vanilla transistors as well.

It’s all the little details that count, however. You need to position the two ultrasonic drivers fairly precisely to create a standing wave, and while you can start at 8.25 mm and trial-and-error it, the article demonstrates using an oscilloscope to align the capsules by driving one and reading the signal out of the other and tweaking them until they’re in phase. Clever!

The author also takes the ultrasonic-transparent grille from one of the unused receivers and uses it as a spoon to help position the styrofoam bits in the sound waves. We always wondered how you’d do that!

It turns out that it’s easy to make a DIY ultrasonic levitation desk toy, and none of the parts are expensive or critical. The missing ingredient is just the gumption to try it, and now we have that, too.

As cool as they are, the HC-SR04 modules aren’t perfect for all distance sensing applications. Here’s everything you need to know about them, including hacks to make them work up-close. And since HC-SR04 sensors come cheapest in ten-packs, you’ll be wondering what you’re going to do with the other eight. That problem has apparently also been solved.