Speech Recognition On An Arduino Nano?

Like most of us, [Peter] had a bit of extra time on his hands during quarantine and decided to take a look back at speech recognition technology in the 1970s. Quickly, he started thinking to himself, “Hmm…I wonder if I could do this with an Arduino Nano?” We’ve all probably had similar thoughts, but [Peter] really put his theory to the test.

The hardware itself is pretty straightforward. There is an Arduino Nano to run the speech recognition algorithm and a MAX9814 microphone amplifier to capture the voice commands. However, the beauty of [Peter’s] approach, lies in his software implementation. [Peter] has a bit of an interplay between a custom PC program he wrote and the Arduino Nano. The learning aspect of his algorithm is done on a PC, but the implementation is done in real-time on the Arduino Nano, a typical approach for really any machine learning algorithm deployed on a microcontroller. To capture sample audio commands, or utterances, [Peter] first had to optimize the Nano’s ADC so he could get sufficient sample rates for speech processing. Doing a bit of low-level programming, he achieved a sample rate of 9ksps, which is plenty fast for audio processing.

To analyze the utterances, he first divided each sample utterance into 50 ms segments. Think of dividing a single spoken word into its different syllables. Like analyzing the “se-” in “seven” separate from the “-ven.” 50 ms might be too long or too short to capture each syllable cleanly, but hopefully, that gives you a good mental picture of what [Peter’s] program is doing. He then calculated the energy of 5 different frequency bands, for every segment of every utterance. Normally that’s done using a Fourier transform, but the Nano doesn’t have enough processing power to compute the Fourier transform in real-time, so Peter tried a different approach. Instead, he implemented 5 sets of digital bandpass filters, allowing him to more easily compute the energy of the signal in each frequency band.

The energy of each frequency band for every segment is then sent to a PC where a custom-written program creates “templates” based on the sample utterances he generates. The crux of his algorithm is comparing how closely the energy of each frequency band for each utterance (and for each segment) is to the template. The PC program produces a .h file that can be compiled directly on the Nano. He uses the example of being able to recognize the numbers 0-9, but you could change those commands to “start” or “stop,” for example, if you would like to.

[Peter] admits that you can’t implement the type of speech recognition on an Arduino Nano that we’ve come to expect from those covert listening devices, but he mentions small, hands-free devices like a head-mounted multimeter could benefit from a single word or single phrase voice command. And maybe it could put your mind at ease knowing everything you say isn’t immediately getting beamed into the cloud and given to our AI overlords. Or maybe we’re all starting to get used to this. Whatever your position is on the current state of AI, hopefully, you’ve gained some inspiration for your next project.

Pi-Based Spectrometer Puts The Complexity In The Software

Play around with optics long enough and sooner or later you’re probably going to want a spectrometer. Optical instruments are famously expensive, though, at least for high-quality units. But a useful spectrometer, like this DIY Raspberry Pi-based instrument, doesn’t necessarily have to break the bank.

This one comes to us by way of [Les Wright], whose homebrew laser builds we’ve been admiring for a while now. [Les] managed to keep the costs to a minimum here by keeping the optics super simple. The front end of the instrument is just a handheld diffraction-grating spectroscope, of the kind used in physics classrooms to demonstrate the spectral characteristics of different light sources. Turning it from a spectroscope to a spectrometer required a Raspberry Pi and a camera; mounted to a lens and positioned to see the spectrum created by the diffraction grating, the camera sends data to the Pi, where a Python program does the business of converting the spectrum to data. [Les]’s software is simple by complete, giving a graphical representation of the spectral data it sees. The video below shows the build process and what’s involved in calibrating the spectrometer, plus some of the more interesting spectra one can easily explore.

We appreciate the simplicity and the utility of this design, as well as its adaptability. Rather than using machined aluminum, the spectroscope holder and Pi cam bracket could easily be 3D-printer, and we could also see how the software could be adapted to use a PC and webcam.

Continue reading “Pi-Based Spectrometer Puts The Complexity In The Software”

Hackaday Links Column Banner

Hackaday Links: November 22, 2020

Remember DSRC? If the initialism doesn’t ring a bell, don’t worry — Dedicated Short-Range Communications, a radio service intended to let cars in traffic talk to each other, never really caught on. Back in 1999, when the Federal Communications Commission set aside 75 MHz of spectrum in the 5.9-GHz band, it probably seemed like a good idea — after all, the flying cars of the future would surely need a way to communicate with each other. Only about 15,000 vehicles in the US have DSRC, and so the FCC decided to snatch back the whole 75-MHz slice and reallocate it. The lower 45 MHz will be tacked onto the existing unlicensed 5.8-GHz band where WiFi now lives, providing interesting opportunities in wireless networking. Fans of chatty cars need not fret, though — the upper 30 MHz block is being reallocated to a different Intelligent Transportation System Service called C-V2X, for Cellular Vehicle to Everything, which by its name alone is far cooler and therefore more likely to succeed.

NASA keeps dropping cool teasers of the Mars 2020 mission as the package containing the Perseverance rover hurtles across space on its way to a February rendezvous with the Red Planet. The latest: you can listen to the faint sounds the rover is making as it gets ready for its date with destiny. While we’ve heard sounds from Mars before — the InSight lander used its seismometer to record the Martian windPerseverance is the first Mars rover equipped with actual microphones. It’s pretty neat to hear the faint whirring of the rover’s thermal management system pump doing its thing in interplanetary space, and even cooler to think that we’ll soon hear what it sounds like to land on Mars.

Speaking of space, back at the beginning of 2020 — you know, a couple of million years ago — we kicked off the Hack Chat series by talking with Alberto Caballero about his “Habitable Exoplanets” project, a crowd-sourced search for “Earth 2.0”. We found it fascinating that amateur astronomers using off-the-shelf gear could detect the subtle signs of planets orbiting stars half a galaxy away. We’ve kept in touch with Alberto since then, and he recently tipped us off to his new SETI Project. Following the citizen-science model of the Habitable Exoplanets project, Alberto is looking to recruit amateur radio astronomers willing to turn their antennas in the direction of stars similar to the Sun, where it just might be possible for intelligent life to have formed. Check out the PDF summary of the project which includes the modest technical requirements for getting in on the SETI action.

Continue reading “Hackaday Links: November 22, 2020”

Oh, Holey Light

We consider ourselves well-versed when it comes to the technical literature plastered on hardware store parts. Acronyms don’t frighten us, and our Google-fu is strong enough to overcome most mysteries. One bit of dark magic we didn’t understand was the gobbledygook on LED lamps. Wattage is easy and color temperature made sense because it corresponds with warm and cool colors, but Color Rendering Index (CRI) sounds like deep magic. Of course, some folks understand these terms so thoroughly that they can teach the rest of us, like [Jon] and [Kevin], who are building a light controller that corrects inadequacies in cheap lamps by installing several lamps into one unit.

We learned a lot by reading their logs, which are like the Cliff Notes from a lighting engineer’s textbook, but we’ll leave it as an exercise for the students to read through. Their project uses precise light sensors to measure the “flavor” of light coming off cheap lamps so you can mix up a pleasing ratio. In some ways, they are copying the effects of incandescent bulbs, which emit light relatively evenly across the visible light spectrum, right into the infrared. Unfortunately, cheap LEDs have holes in their spectrum coverage, and a Warm White unit has different gaps compared with Daylight, but combining them just right gives a rich output, without breaking the bank.

DIY Radio Telescopes Hack Chat

Join us on Wednesday, February 12 at noon Pacific for the DIY Radio Telescopes Hack Chat with James Aguirre!

For most of history, astronomers were privy to the goings-on in the universe only in a very narrow slice of the electromagnetic spectrum. We had no idea that a vibrant and wondrous picture was being painted up and down the wavelengths, a portrait in radio waves of everything from nearly the moment of creation to the movement of galaxies. And all it took to listen in was an antenna and a radio receiver.

Over the years, radio telescopes have gotten more and more sophisticated and sensitive, and consequently bigger and bigger. We’re even to the point where one radio telescope often won’t cut it, and astronomers build arrays of telescopes spread over miles and miles, some with antennas that move around on rails. In the search for signals, radio astronomy has become the very definition of “Big Science.”

But radio astronomy doesn’t have to be big to be useful. James Aguirre, an astronomer at the University of Pennsylvania, spends his days (and nights) studying the radio universe with those big instruments. But he’s also passionate about down-scaling things and teaching everyone that small radio telescopes can be built on the cheap. His Mini Radio Telescope project uses a cast-off satellite TV dish and a couple of hundred bucks worth of readily available gear to scan the skies for all sorts of interesting phenomena.

Dr. Aguirre will join us on the Hack Chat to discuss all things radio astronomy, and how you can get in on the radio action on the cheap. Chances are good your junk pile — or your neighbor’s roof — has everything you need, and you might be surprised how approachable and engaging DIY radio astronomy can be.

join-hack-chatOur Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, February 12 at 12:00 PM Pacific time. If time zones have got you down, we have a handy time zone converter.

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on Hackaday.io. You don’t have to wait until Wednesday; join whenever you want and you can see what the community is talking about. Continue reading “DIY Radio Telescopes Hack Chat”

Another IoT Debacle: Charter Offers Home Insecurity

If you are a glass-half-empty person, you’ll view Charter’s announcement that they will shutter their home security and smart home service on February 5th as another reason not to buy into closed-source IoT devices. If you are a glass-half-full person though, you’ll see the cable company’s announcement as a sign that a lot of Zigbee hardware will soon flood the surplus market. Ars Technica reports that after investigation it appears that some of the devices may connect to a standard Zigbee hub after a factory reset, but many others will definitely not.

As you might expect, users were less than thrilled. Especially those that shelled out thousands of dollars on sensors and cameras. This sort of thing might be expected if a company goes out of business, but Charter just doesn’t want to be in the home security business anymore.

Continue reading “Another IoT Debacle: Charter Offers Home Insecurity”

Stick Your Own Samples In The Cheetah SpecDrum

The Sinclair ZX Spectrum was a popular computer in the 8-bit era, and particularly so in its homeland of the United Kingdom. It was known more for its low cost than its capabilities, but it gained many add-ons over the years. One of those was the Cheetah SpecDrum, which turned the Spectrum into a rudimentary drum machine. [PianoMatt] wasn’t happy with the original drum samples, so he set about loading a custom kit into the SpecDrum.

The SpecDrum software initially came with extra sample tapes, so [PianoMatt] knew it was an achievable task to load in custom samples. Starting by loading the software in an emulator, the RAM was then exported as raw data and loaded up in Audacity. After some experimentation, it was determined the samples were stored in 8-bit format at a sample rate of approximately 20 kHz. With this figured out, it was then possible to load replacement samples directly into RAM through the emulator.

However, this wasn’t enough for [PianoMatt]. Further digging enabled him to reverse engineer the format of the replacement sample tapes. Armed with this knowledge, [PianoMatt] then generated his own tape, complete with proper headers and labels for each drum sound.

It’s a tidy effort to bring a more modern sound to a now positively ancient piece of hardware. We’d love to hear a track with drums courtesy of the SpecDrum, so we’ll keep an ear out on Soundcloud. Mucking around with old sound hardware is a popular pastime in these parts – we’ve even seen people go so far as to build bespoke Sega chiptune players from scratch.