Posts | Comments

Planet Arduino

Archive for the ‘siri’ Category

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.

robotic assistant communicates using animated GIFsanimated GIFs work great and are very expressive

Read more on MAKE

The post The Peeqo Robot Communicates Using Only Animated GIFs appeared first on Make: DIY Projects and Ideas for Makers.

Feb
01

Siri controlled Arduino using Ruby

arduino hacks, dino, iphone hacks, ruby, siri, siriproxy Comments Off on Siri controlled Arduino using Ruby 

siri-proxy-ruby-arduino

This snippet of Hello World code lets [Nico Ritschel] turn the Pin 13 LED on his Arduino on and off using Siri, the voice-activated helper built into iPhones. The trick here is using the Ruby programming language to get Siri Proxy talking to Arduino via the USB connection. He calls the project siriproxy-arduino.

On one end of the hack resides SiriProxy, a package not approved by Apple which is capable of intercepting the Siri messages headed for Apple’s own servers. The messages are still relayed, but a copy of each is available for [Nico's] own uses. On the other side of things he’s building on the work of [Austinbv's] dino gem; a Ruby package that facilitates control of the Arduino. It includes a sketch that is uploaded to the Arduino board, opening up a Ruby API. The collection of code seen above defines the pin with the LED connected and then listens for a specific Siri commands to actuate it.

Take a look at [Nico's] explanation of the module in the video after the break.


Filed under: arduino hacks, iphone hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook