Lala Amps Up Audio in Latest Imp OS Release

June/24/13

The Imp gets more powerful all the time as our embedded team adds features with each new Imp OS release. As we saw last week, the latest Imp OS is particularly exciting with features like the ability to turn WiFi on and off, faster WiFi join, and more memory for user programs. One of the most anticipated features is the addition of the fixed-frequency DAC class, which gives developers access to the Imp’s digital-to-analog converters. This means that bringing audio to your Internet-connected project is now easier than ever.

Building a project around a microcontroller most often means you’ll need external hardware if you want to generate analog signals. The Imp’s integrated DACs are a reminder of just how much power the Imp has under the hood. All you need for audio output is an amplifier, and some external memory if you’re interested in recording or playing back more than a few seconds of audio.

Eager to take the DAC for a spin, the Imp team has been working on a new Electric Imp reference design, called Lala, which adds audio input and output to a single board: an Imp-intercom! Lala has a 4MB SPI flash memory chip on-board, which is enough space to hold just over 4 minutes of 16 kHz, A-law compressed audio. You can check out the Lala design on the Electric Imp developer wiki or in action through this video.

Audio output opens the doors to a lot of cool new project ideas. At our recent Electric Imp hackathon, the team spent time brainstorming imp-enabled devices we’d like to build and have. Here’s a few of our favorites:

Tweeting Cuckoo Clock

Inspired by the Flock Clock built by Berg and Twitter a few weeks ago, one of our team members took the idea of a physical clock connected to social media one step further - what if the little bird could actually tweet the tweet? We tossed the idea around and realized the pieces were all there!

  • This application is a great use case for an Electric Imp agent. An agent is a partner to your device firmware that runs in the Electric Imp cloud. Agent code is written in Squirrel, just like device firmware, and runs in a VM on the Electric Imp servers. Agents are always on, always connected, and the best way to implement an HTTP interface for your device. Agents are in beta right now, along with the new Electric Imp IDE, which makes it easy to write and control your agent. If you’re interested in joining the beta, please email info@electricimp.com.

  • The agent talks to the Twitter API and keeps an eye out for tweets at a specific account or hashtag.

  • When a tweet arrives, the agent sends the text along to your favorite text-to-speech engine. AT&T Labs has one up and running at the moment that will happily return a wav file.

  • The agent reads the WAV file and relays the audio data down to the Imp in the clock. Tweets are short, so there’s no need to even stash the audio away in flash memory - the Imp can just hold it in memory.

  • The Imp drives a motor to deploy the bird and plays back the tweet!

“Looks Like Rain!” Umbrella

The Bay Area is well known for its various microclimates. True, most of the time our Los Altos office enjoys warm weather and lots of sun - but in the winter a rogue raincloud can be a very unpleasant surprise on the four-block walk to the sandwich shop. What if your umbrella could remind you to take it along?

  • Use your favorite local weather API to get local conditions and forecasts. We’ve long been fans of Dark Sky, and it has saved us from soggy shoes on more than one occasion. The forecast.io backend that powers Dark Sky has a nice API with a JSON interface that’s perfect for an agent!

  • Keep your imp-enabled umbrella by the door. It wakes up when you grab the handle, and some data changes hands in the blink of an eye:

  • The agent calls for local conditions from your weather API of choice.

  • Just like the tweeting clock, the agent relays the forecast along to your favorite text-to-speech engine and gets an audio file back.

  • The agent relays the audio data down to the imp in the umbrella, which springs to life: “Light rain for the next 15 minutes. Better take me with you!”

And you thought Mary Poppins had a cool umbrella.

There are some very exciting Imp-enabled products on the way that are going to give the Internet of Things a voice, so stay tuned and keep listening!

Tom Buttner
Systems Engineer