Q&A with Arduino-Based Skube Codesigner

The Arduino-based Skube

The Arduino-based Skube

Andrew Spitz is a Copenhagen, Denmark-based sound designer, interaction designer, and programmer. Among his various innovative projects is the Arduino-based Skube music player, which is an innovative design that enables users to find and share music.

Spitz worked on the design with Andrew Nip, Ruben van der Vleuten, and Malthe Borch. Check out the video to see the Skube in action. On his blog SoundPlusDesign.com, Spitz writes: “It is a fully working prototype through the combination of using ArduinoMax/MSP and an XBee wireless network. We access the Last.fm API to populate the Skube with tracks and scrobble, and using their algorithms to find similar music when in Discover mode.”

Skube – A Last.fm & Spotify Radio from Andrew Nip on Vimeo.

The following is an abridged  version of an interview that appears in the December 2012 issue of audioXpress magazine, a sister publication of Circuit Cellar magazine..

SHANNON BECKER: Tell us a little about your background and where you live.

Andrew Spitz: I’m half French, half South African. I grew up in France, but my parents are South African so when I was 17, I moved to South Africa. Last year, I decided to go back to school, and I’m now based in Copenhagen, Denmark where I’m earning a master’s degree at the Copenhagen Institute of Interaction Design (CID).

SHANNON: How did you become interested in sound design? Tell us about some of your initial projects.

Andrew: From the age of 16, I was a skydiving cameraman and I was obsessed with filming. So when it was time to do my undergraduate work, I decided to study film. I went to film school thinking that I would be doing cinematography, but I’m color blind and it turned out to be a bigger problem than I had hoped. At the same time, we had a lecturer in sound design named Jahn Beukes who was incredibly inspiring, and I discovered a passion for sound that has stayed with me.

Shannon: What do your interaction design studies at CIID entail? What do you plan to do with the additional education?

Andrew: CIID is focused on a user-centered approach to design, which involves finding intuitive solutions for products, software, and services using mostly technology as our medium. What this means in reality is that we spend a lot of time playing, hacking, prototyping, and basically building interactive things and experiences of some sort.

I’ve really committed to the shift from sound design to interaction design and it’s now my main focus. That said, I feel like I look at design from the lens of a sound designer as this is my background and what has formed me. Many designers around me are very visual, and I feel like my background gives me not only a different approach to the work but also enables me to see opportunities using sound as the catalyst for interactive experiences. Lots of my recent projects have been set in the intersection among technology, sound, and people.

SHANNON: You have worked as a sound effects recordist and editor, location recordist and sound designer for commercials, feature films, and documentaries. Tell us about some of these experiences?

ANDREW: I love all aspects of sound for different reasons. Because I do a lot of things and don’t focus on one, I end up having more of a general set of skills than going deep with one—this fits my personality very well. By doing different jobs within sound, I was able to have lots of different experiences, which I loved! nLocation recording enabled me to see really interesting things—from blowing up armored vehicles with rocket-propelled grenades (RPGs) to interviewing famous artists and presidents. And, documentaries enabled me to travel to amazing places such as Rwanda, Liberia, Mexico, and Nigeria. As a sound effects recordist on Jock of the Bushvelt, a 3-D animation, I recorded animals such as lions, baboons, and leopards in the South African bush. With Bakgat 2, I spent my time recording and editing rugby sounds to create a sound effects library. This time in my life has been a huge highlight, but I couldn’t see myself doing this forever. I love technology and design, which is why I made the move...

SHANNON: Where did the idea for Skube originate?

Andrew: Skube came out of the Tangible User Interface (TUI) class at CIID where we were tasked to rethink audio in the home context. So understanding how and where people share music was the jumping-off point for creating Skube.

We realized that as we move more toward a digital and online music listening experience, current portable music players are not adapted for this environment. Sharing mSkube Videousic in communal spaces is neither convenient nor easy, especially when we all have such different taste in music.

The result of our exploration was Skube. It is a music player that enables you to discover and share music and facilitates the decision process of picking tracks when in a communal setting.

audioXpress is an Elektor International Media publication.

DIY IoT: Build a ‘Net-Connected System Today

It’s time to join the Internet of Things (IoT) revolution. Try building a ‘Net-enabled design with WIZnet’s W5500 “smart” Ethernet chip. It’s easier than you think.

In a thorough introduction to the technology, Tom Cantrell presented a garage door monitoring design. He explained:

The W5500 (see Figure 1) starts with a standard 10/100 Ethernet interface (i.e., MAC and PHY) but then goes further with large RAM buffers (16-KB transmit and 16-KB receive) and hardware TCP/IP protocol processing. I discovered WIZnet’s first chip, the  W3100, way back in 2001. Of course by now, as with all things  silicon, the new W5500 is better, faster, and  lower cost. But the concept is still exactly  the same: “Internet enable” applications by  handling the network chores in hardware so  the application microcontroller doesn’t have to do it in software.

Cantrell - WIZ550io

Figure 1: The WIZnet W5500 is an Ethernet chip with a difference—large RAM buffers and hardware TCP/IP processing that make it easy for any microcontroller to go online.

The large RAM buffers help decouple the  microcontroller from network activity. In a  recent project (see my article, “Weatherize  Your Embedded App,” Circuit Cellar 273,  2013), I used the RAM to receive an entire  10-KB+ webpage, completely eliminating the  need for the microcontroller to juggle data at  network speed. And any of the 32-KB on-chip  RAM that isn’t needed for network buffering  is free for general-purpose use, a big plus for  typically RAM-constrained microcontrollers. The other major WIZnet hardware assist  is TCP/IP processing using IP addresses, sockets, and familiar commands including OPEN, CONNECT, SEND, RECEIVE, DISCONNECT.  The high-level interface to the network frees  up microcontroller cycles and code space that  would otherwise be needed for a software TCP/IP stack.

Cantrell goes on to present his design for a ‘Net-connected garage door monitoring system.

For prototyping, check out the WIZnet  ioShield (see Photo 1), which is a baseboard  for the WIZ550io that includes an SD card  socket. There are ioShields for different  platforms (e.g., Arduino, LaunchPad,  mbed, etc.), and with 0.1” headers they are  breadboard friendly.

Photo 1: If you want a fancy server with lots of eye candy, a microSD card is the way to go. The WIZnet ioShields include the card socket and are available for various platforms. The Arduino version is shown here.

Photo 1: If you want a fancy server with lots of eye candy, a microSD card is the way to go. The WIZnet ioShields include the card socket and are available for various platforms. The Arduino version is shown here.

Cantrell prototyped a client version of what he calls his “garage  door ‘Thing’ using an Arduino  and a WIZ550io connected to Exosite (see Photo 2).

A prototype of the client version of my garage “Thing” is shown.

Photo 2: A prototype of the client version of my garage “Thing”

Wondering how to get two clients (e.g., ) to interact with each other? Cantrell used Exosite.

Over on the Exosite website, after signing up for a  free “Developer” account, it was a quick and easy mainly point-and-click exercise to configure my “Device,” “Data,”  “Events,” and “Alerts” (see Photo 3).  As a client, there’s no need to keep the “Thing’s”  Ethernet link powered all the time. Data only needs to  be sent when the garage door opens or closes, but I also  recommend sending a periodic heartbeat just in case. My  garage door monitor will only generate a minute or two  of network activity (i.e., door state changes and hourly  heartbeats) per day, so there’s opportunity for significant  energy savings compared to a 24/7 server.

It only takes a few minutes to set up a simple Exosite dashboard including an e-mail alert. I can “see“ my  garage door without getting off the couch and now, via Exosite, from the farthest reaches of the web.

It only takes a few minutes to set up a simple Exosite dashboard including an e-mail alert. I can “see“ my garage door without getting off the couch and now, via Exosite, from the farthest reaches of the web.

You can download the entire article,  “Connect the Magic: An Introduction to the WIZnet W550,” for free to learn about Cantrell’s garage door control system built with a WIZnet and an Arduino Uno.

Editor’s note: If you have an idea for an innovative, ’Net-enabled electronics system, this is your opportunity to share your original design with the world. Enter the WIZnet Connect the Magic 2014 Design Challenge for a chance to win a share of $15,000 in prizes and gain recognition by Elektor International Media and Circuit Cellar. WIZnet is the sponsor. Eligible entries will be judged on their technical merit, originality, usefulness, cost-effectiveness, and design optimization. The Entry submission deadline is 12:00 PM EST August 3, 2014. How to enter: Implement WIZnet’s WIZ550io Ethernet module, or W5500 chip, in an innovative design; document your project; and then submit your entry. The complete rules and regulations are available on the Challenge webpage.

 

Raspberry Pi-Based Network Monitoring Device

In 2012, Al Anderson, IT director at Salish Kootenai College in Pablo, MT, and his team wired the dorms and student housing units at the small tribal college with fiber and outdoor CAT 5 cable to provide reliable Internet service to students. “Our prior setup was wireless and did not provide very good service,” Anderson says.

The 25 housing units, each with a small unmanaged Ethernet switch, were daisy chained in several different paths. Anderson needed a way to monitor the links from the system’s Simple Network Management Protocol (SNMP) network monitoring software, Help/Systems’s InterMapper. He also wanted to ensure the switches installed inside the sun-exposed utility boxes wouldn’t get too hot.

The Raspberry Pi is a small SBC based on an ARM processor. Its many I/O ports make it very useful for embedded devices that need a little more power than the typical 8-bit microcontroller.

Photo 1: The Raspberry Pi is a small SBC based on an ARM processor. Its many I/O ports make it very useful for embedded devices that need a little more power than the typical 8-bit microcontroller.

His Raspberry Pi-based solution is the subject of an article appearing in Circuit Cellar’s April issue. “We chose the Raspberry Pi because it was less expensive, we had several on hand, and I wanted to see what I could do with it,” Anderson says (see Photo 1).

The article walks readers through each phase of the project:

“I installed a Debian Linux distro, added an I2C TMP102 temperature sensor from SparkFun Electronics, wrote a small Python program to get the temperature via I2C and convert it to Fahrenheit, installed an SNMP server on Linux, added a custom SNMP rule to display the temperature from the script, and finally wrote a custom SNMP MIB to access the temperature information as a string and integer.”

Setting up the SBC and Linux was simple, Anderson says. “The prototype Raspberry Pi has now been running since September 2012 without any problems,” he says in his article. “It has been interesting to see how the temperature fluctuates with the time of day and the level of network activity. As budget and time permit, we will be installing more of these onto our network.”

In the following excerpt, Anderson discusses the project’s design, implementation, and OS installation and configuration. For more details on a project inspired, in part, by the desire to see what a low-cost SBC can do, read Anderson’s full article in the April issue.

DESIGN AND IMPLEMENTATION
Figure 1 shows the overall system design. The TMP102 is connected to the Raspberry Pi via I2C. The Raspberry Pi is connected to the network via its Ethernet port. The monitoring system uses TCP/IP over the Ethernet network to query the Raspberry Pi via SNMP. The system is encased in a small acrylic Adafruit Industries case, which we used because it is inexpensive and easy to customize for the sensor.

The system is designed around the Raspberry Pi SBC. The Raspberry Pi uses the I2C protocol to query the Texas Instruments TMP102 temperature sensor. The Raspberry Pi is queried via SNMP.

Figure 1: The system is designed around the Raspberry Pi SBC. The Raspberry Pi uses the I2C protocol to query the Texas Instruments TMP102 temperature sensor. The Raspberry Pi is queried via SNMP.

Our first step was to set up the Raspberry Pi. We started by installing the OS and the various software packages needed. Next, we wrote the Python script that queries the I2C temperature sensor. Then we configured the SNMP daemon to run the Python script when it is queried. With all that in place, we then set up the SNMP monitoring software that is configured with a custom MIB and a timed query. Finally, we modified the Raspberry Pi case to expose the temperature sensor to the air and installed the device in its permanent location.

OS INSTALLATION AND CONFIGURATION
The Raspberry Pi requires a Linux OS compiled to run on an ARM processor, which is the brain of the device, to be installed on an SD card. It does not have a hard drive. Setting up the SD card is straightforward, but you cannot simply copy the files onto the card. The OS has to be copied in such a way that the SD card has a boot sector and the Linux partitioning and file structure is properly maintained. Linux and Mac OS X users can use the dd command line utility to copy from the OS’s ISO image. Windows users can use a utility (e.g., Win32DiskImager) to accomplish the same thing. A couple of other utilities can be used to copy the OS onto the SD card, but I prefer using the command line.

A Debian-based distribution of Linux seems to be the most commonly used Linux distribution on the Raspberry Pi, with the Raspbian “wheezy” as the recommended distribution. However, for this project I chose Adafruit Learning Systems’s Occidentalis V0.2 Linux distribution because it had several hardware-hacker features rolled into the distribution, including the kernel modules for the temperature sensor. This saved me some work getting those installed and debugged.

Before you can copy the OS to the SD card, you need to download the ISO image. The Resources section of this article lists several sources including a link to the Adafruit Linux distribution. Once you have an ISO image downloaded, you can copy it to the SD card. The Resources section also includes a link to an Embedded Linux Wiki webpage, “RPi Easy SD Card Setup,” which details this copying process for several OSes.

The quick and dirty instructions are to somehow get the SD card hooked up to your computer, either using a built-in SD reader or a peripheral card reader. I used a USB attached reader. Then you need to format the card. The best format is FAT32, since it will get reformatted by the copy command anyway. Next, use your chosen method to copy the OS onto the card. On Linux or Mac OS X, the command:

dd bs=4M if=~/linux_distro.img of=/dev/sdd

will properly copy the OS onto the SD card.

You will need to change two important things in this command for your system. First, the
if parameter, which is the name the in file (i.e., your ISO image) needs to match the file you downloaded. Second, the of device (i.e., the out file or our SD drive in this case) needs to match the SD card. Everything, including devices, is a file in Linux, in case you are wondering why your SD drive is considered a file. We will see this again in a bit with the I2C device. You can toast your hard drive if you put the wrong device path in here. If you are unsure about this, you may want to use a GUI utility so you don’t overwrite your hard drive.

Once the OS is copied onto the SD card, it is time to boot up the Raspberry Pi. A default username and password are available from wherever you download the OS. With our OS, the defaults are “pi” and “raspberry.” Make it your first mission to change that password and maybe even add a new account if your project is going to be in production.

Another thing you may have to change is the IP address configuration on the Ethernet interface. By default, these distributions use DHCP to obtain an address. Unless you have a need otherwise, it is best to leave that be. If you need to use a static IP address, I have included a link in the Resources section with instructions on how to do this in Linux.

To access your Raspberry Pi, hook up a local keyboard and monitor to get to a command line. Once you have the network running and you know the IP address, you can use the SSH utility to gain access via the network.

To get SNMP working on the Raspberry Pi, you need to install two Debian packages: snmpd and snmp. The snmpd package is the actual SNMP server software that will enable other devices to query for SNMP on this device. The second package, snmp, is the client. It is nice to have this installed for local troubleshooting.

We used the Debian package manager, apt-get, to install these packages. The commands also must be run as the root or superuser.

The sudo apt-get install snmpd command installs the snmpd software. The sudo part runs the apt-get command as the superuser. The install and snmpd parts of the command are the arguments for the apt-get command.

Next we issued the
sudo apt-get install snmp command, which installed the SNMP client. Issue the ps -ax | grep snmpd command to see if the snmpd daemon is running after the install. You should see something like this:

1444 ? S 14:22 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid

If you do not see a line similar to this, you can issue the sudo /etc/init.d/snmpd command start to start the service. Once it is running, it is time to turn your attention to the Python script that reads the temperature sensor. Configure the SNMP daemon after you get the Python script running.

The Raspberry Pi’s final installation is shown. The clear acrylic case can be seen along with the Texas Instruments TMP102 temperature sensor, which is glued below the air hole drilled into the case. We used a modified ribbon cable to connect the various TMP102 pins to the Raspberry Pi.

The Raspberry Pi’s final installation is shown. The clear acrylic case can be seen along with the Texas Instruments TMP102 temperature sensor, which is glued below the air hole drilled into the case. We used a modified ribbon cable to connect the various TMP102 pins to the Raspberry Pi.

A Low-Cost Connection to the IoT

In Circuit Cellar’s March issue, columnist Jeff Bachiochi tests the services of a company he says is “poised to make a big impact” on the Internet of Things (IoT).

This shows the I2C interface Bachiochi designed to enable available clamp-on current sensors to be monitored. He added four of these circuits to a PCB, which includes the circuitry for an imp card.

This shows the I2C interface Bachiochi designed to enable available clamp-on current sensors to be monitored. He added four of these circuits to a PCB, which includes the circuitry for an imp card.

Established in 2011, Electric Imp offers a flexible connectivity platform meant to enable any device to be connected to the IoT. The platform, called the “imp,” provides an SD-card sized module (including an 802.11b/g/n Wi-Fi radio package) that can be installed on any electronic device to go online. A powerful processor runs the imp OS.

“You only need to supply an SD card socket (and a few other components) to your product to give it connectivity,” Bachiochi says. “The imp’s processor has the power to run your entire product if you wish, or it can be connected via one of the supported serial protocols. The imp OS provides secure connectivity to the imp cloud. The imp cloud keeps your imp updated with the latest firmware, features online development tools, and provides cloud-side services for every imp in the field.”

“As with many cloud service organizations, development is generally free,” Bachiochi adds. “Once you’ve committed and have product rollout, the service will charge for its use. This could be a flat fee, a per-connection or data throughput fee, or a combination of fees. Basically you (or your customer) will have to pay to have access to the information, which pays for the support framework that keeps it all working.”

In his article, Bachiochi dives into a straightforward data-collection project to demonstrate how to use the imp in a product. The goal of his application was to log the activity of 220-V water pump and twin water softeners.  The project is the launching point for his comprehensive and detailed look at the imp’s hardware, software, and costs.

“It’s easy to design product hardware to use the imp,” he says. “There are two imp models, a card that can be inserted into an SD-type socket or an on-board module that is soldered into your product. Each version has advantages and disadvantages.”

Regarding software, Bachiochi says:

“Developing an imp application requires two parts to provide Wi-Fi access to your project: the device code (running in the imp) and the agent code (running on the imp cloud). The imp cloud, which is your connection to your device via the imp APIs, provides you with a development IDE. Web-based development means there is nothing else you need to purchase or install on your PC. Everything you need is available through your browser anytime and anywhere.”

Bachiochi also discusses the Electric Imp platform’s broader goals. While an individual can use the imp for device connectivity, a bigger purpose is to enable manufacturers to provide convenient Internet access as part of their product, Bachiochi says.

“The imp has two costs: The hardware is simple, it currently costs approximately $25 for an imp card or module. If you are using this in your own circuit within your own network, then you’re done,” he says. “If you want to roll out a product for sale to the world, you must take the next step and register for the BlinkUp SDK and Operations Console, which enable you to create and track factory-blessed products.”

BlinkUp, according to the Electric Imp website, integrates smoothly into apps and enables manufacturers and their customers to quickly connect products using a smartphone or tablet. The Operations Console enables tracking product activity and updating product firmware at any time, Bachiochi says.

The imp offers more than a low-cost way for DIYers and developers to connect devices to the Internet, Bachiochi says. A designer using the imp can save project costs by eliminating a microcontroller, he says. “Almost any peripheral can be easily connected to and serviced by the imp’s 32-bit Cortex M3 processor running the imp OS. All code is written in Squirrel.”

Bachiochi’s comprehensive article about his imp experience and insights can be found in the March issue, now available for membership download or single-issue purchase.

Bachiochi used the Electric IMP IDE to develop this code. Agent code on the top left runs on the imp cloud server. The device code on the top right is downloaded into the connected imp.

Bachiochi used the Electric IMP IDE to develop this code. Agent code on the top left runs on the imp cloud server. The device code on the top right is downloaded into the connected imp.

Remote Control and Monitoring of Household Devices

Raul Alvarez, a freelance electronic engineer from Bolivia, has long been interested in wireless device-to-device communication.

“So when the idea of the Internet of Things (IoT) came around, it was like rediscovering the Internet,” he says.

I’m guessing that his dual fascinations with wireless and the IoT inspired his Home Energy Gateway project, which won second place in the 2012 DesignSpark chipKIT challenge administered by Circuit Cellar.

“The system enables users to remotely monitor their home’s power consumption and control household devices (e.g., fans, lights, coffee machines, etc.),” Alvarez says. “The main system consists of an embedded gateway/web server that, aside from its ability to communicate over the Internet, is also capable of local communications over a home area wireless network.”

Alvarez catered to his interests by creating his own wireless communication protocol for the system.

“As a learning exercise, I specifically developed the communication protocol I used in the home area wireless network from scratch,” he says. “I used low-cost RF transceivers to implement the protocol. It is simple and provides just the core functionality necessary for the application.”

Figure1: The Home Energy Gateway includes a Hope Microelectronics RFM12B transceiver, a Digilent chipKIT Max32 board, and a Microchip Technology ENC28J60 Ethernet controller chip.

Figure 1: The Home Energy Gateway includes a Hope Microelectronics RFM12B transceiver, a Digilent chipKIT Max32 board, and a Microchip Technology ENC28J60 Ethernet controller chip.

Alvarez writes about his project in the February issue of Circuit Cellar. His article concentrates on the project’s TCI/IP communications aspects and explains how they interface.

Here is his article’s overview of how the system functions and its primary hardware components:

Figure 1 shows the system’s block diagram and functional configuration. The smart meter collects the entire house’s power consumption information and sends that data every time it is requested by the gateway. In turn, the smart plugs receive commands from the gateway to turn on/off the household devices attached to them. This happens every time the user turns on/off the controls in the web control panel.

Photo 1: These are the three smart node hardware prototypes: upper left,  smart plug;  upper right, a second smart plug in a breadboard; and at bottom,  the smart meter.

Photo 1: These are the three smart node hardware prototypes: upper left, smart plug; upper right, a second smart plug in a breadboard; and at bottom, the smart meter.

I used the simple wireless protocol (SWP) I developed for this project for all of the home area wireless network’s wireless communications. I used low-cost Hope Microelectronics 433-/868-/915-MHz RFM12B transceivers to implement the smart nodes. (see Photo 1)
The wireless network is configured to work in a star topology. The gateway assumes the role of a central coordinator or master node and the smart devices act as end devices or slave nodes that react to requests sent by the master node.

The gateway/server is implemented in hardware around a Digilent chipKIT Max32 board (see Photo 2). It uses an RFM12B transceiver to connect to the home area wireless network and a Microchip Technology ENC28J60 chip module to connect to the LAN using Ethernet.

As the name implies, the gateway makes it possible to access the home area wireless network over the LAN or even remotely over the Internet. So, the smart devices are easily accessible from a PC, tablet, or smartphone using just a web browser. To achieve this, the gateway implements the SWP for wireless communications and simultaneously uses Microchip Technology’s TCP/IP Stack to work as a web server.

Photo 2: The Home Energy Gateway’s hardware includes a Digilent chipKIT Max32 board and a custom shield board.

Photo 2: The Home Energy Gateway’s hardware includes a Digilent chipKIT Max32 board and a custom shield board.

Thus, the Home Energy Gateway generates and serves the control panel web page over HTTP (this page contains the individual controls to turn on/off each smart plug and at the same time shows the power consumption in the house in real-time). It also uses the wireless network to pass control data from the user to the smart plugs and to read power consumption data from the smart meter.

The hardware module includes three main submodules: The chipKIT Max 32 board, the RFM12B wireless transceiver, and the ENC28J60 Ethernet module. The smart meter hardware module has an RFM12B transceiver for wireless communications and uses an 8-bit Microchip Technology PIC16F628A microcontroller as a main processor. The smart plug hardware module shows the smart plugs’ main hardware components and has the same microcontroller and radio transceiver as the smart meter. But the smart plugs also have a Sharp Microelectronics S212S01F solid-state relay to turn on/off the household devices.

On the software side, the gateway firmware is written in C for the Microchip Technology C32 Compiler. The smart meter’s PIC16F628A code is written in C for the Hi-TECH C compiler. The smart plug software is very similar.

Alvarez says DIY home-automation enthusiasts will find his prototype inexpensive and capable. He would like to add several features to the system, including the ability to e-mail notifications and reports to users.

For more details, check out the February issue now available for download by members or single-issue purchase.