Monthly Archives: August 2012

Raspberry Pi, Battle of the Enclosures

via Wolf Paulus » Embedded

Overturned Basket with Raspberries and White Currants, 1882
By Eloise Harriet Stannard (1829 – 1915)

Eventually, you will start looking for an enclosure for the Raspberry Pi. Even during the early hardware development phase of your project, you can put the Raspberry Pi into an enclosure, given that the mainboard doesn’t have any on/off switches and that a Cobbler Breakout Kit provides easy access to the Raspi’s GPIO Pins (on a neighboring solderless breadboard).
Unlike for many other popular embedded development platforms, there are already many enclosures for the Raspberry Pi to chose from; many of which are listed over here at

We have bought two Adafruit Pi Boxes and two Raspberry Pi Cases from Barch Designs.

Adafruit Pi Box

  • Crystal-clear Acrylic (6 pieces)
  • Engraved Labels on all Connector Slots
  • Long Slot to connect a 26-pin IDC cable (e.g. Cobbler Breakout Kit)
  • No additional vents or cooling required
  • $14.95


The case has no screws or standoffs and the little feet have to be squeezed to make the pieces snap together.
Very elegant design, however, (probably accelerated by the Raspberry Pi’s heat emission) after a few days of use, the acrylic became extremely brittle and started to show cracks around the cutouts. One of the feet broke off, while we were trying to open the enclosure, rendering the case useless (all feet are needed to snap the enclosure parts together again.)
Despite operating extremely carefully, the same happened to the second case only a few days later. Kudos to Adafruit though. Once we mentioned our experience with the enclosure, a refund was issued.

While this could have been a temporary issue related to the acrylic used for our cases, we would not recommend the enclosure for longer use or if you needed to open and close the enclosure often or even rarely.

Raspberry Pi Case by Barch Designs

  • CNC Machined from Billet Aluminum
  • Customizable Engraving
  • Long Slot to connect a 26-pin IDC cable (e.g. Cobbler Breakout Kit)
  • Acts as a Heat Sink
  • LED Fiber Optics
  • $69.99 (incl. shipping)


This precisely enclosure is milled from Solid 6061-T6 Aircraft Grade Billet Aluminum in the USA. Fiber Optic cables that have been manufactured into the case and each cable is positioned directly above an LED.
The whole enclosure acts as an heat sink, even a small package of thermal paste is included.
While the price is about four times that of the Acrylic enclosure, if you need an enclosure that lasts you may want to consider this one. It is the Mercedes among the Pi cases, but money well spent.

Raspberry Pi / Case by Barch Designs / with EW-7811Un USB Wireless Adapter

Free Elektor magazine September 2012

via Pololu - New Products

Get a FREE copy of Elektor magazine’s September issue with your order while supplies last. This offer is only available for orders shipped to USA or Canada. To get your free issue, enter the coupon code ELEKTOR0912 into your shopping cart. The magazine will add 5.3 ounces to the package weight when calculating your shipping options.

Scientists Control Superconductors With Rays Of Light

via News

A century after the discovery of superconductivity mankind is still struggling to harness its tantalizing possibilities. Superconductors allow an electric current to flow with zero resistance giving us lossless energy transfer. A looped superconductive wire can carry a charge forever with no power source. Superconductors also have extraordinary magnetic properties. Because they exclude magnetic fields from their interior, they force causing magnets to levitate -again forever. A property that...

How to Solder Elektor’s September Issue

via News

Many of you know how to handle a soldering iron. When you are a starter we all joke: make sure you have the correct end! By the time you're an expert, you can probably do some SMD work.   What Jan Buiting (Editor International Edition) is trying in this video is completely weird and new; he is soldering a magazine! Without any problems he connects you from article to article and make sure you will  know exactly what the new issue of Elektor will offer you....

Accessing Raspberry Pi via Serial

via Wolf Paulus » Embedded

Using a serial connection to connect to a Raspbery Pi has many advantages. The boot process (Kernel boot messages go to the UART at 115,200 bit/s) can be monitored, without the need to hookup an HDMI-Monitor. Once booted, you can of course login through a serial terminal as well, i.e. the serial connection allows logging-in form a remote computer without running an SSH daemon on the Raspi.

UART TXD and RXD pins are easily accessible (GPIO 14 and 15), however, like for all GPIO pins, the voltage levels are 3.3 V and are not 5 V tolerant!

Since most of the desktop and laptop computers don’t come equipped with a serial port anymore, accessing the Raspberry Pi via a Serial Connection requires some requisites. I have recently connected to the Raspberry Pi using three different hardware setups ..

1. USB to Serial Adapter

There are many USB-to-Serial adapters available and while not all of them are capable to handle the highest data transfer speeds, the Keyspan HS-19 (OS-X drivers are available here) is certainly one of the best.
However, adapters based on the Prolific 2303 chip, like the Zonet ZUC3100, seem to be a little less expensive, well-supported in Linux, and much more widespread. Drivers for 2303 based devices can be found here, if required, use GUEST as user name and password to gain access.
E.g. I’m currently using the Mac OS X Universal Binary Driver v1.4.0 on OS X 10.8.1 without any issues.

1.1. Level Shifter

Very few of those USB-to-Serial adapters have the standard RS-232 +/- 12V voltage levels on the serial ports (the Zonet ZUC3100 w/ the pl2303 chip however does!) and using a level shifter is certainly a very good idea. Since the Raspi wants no more than 3.3V, TTL-RS-232 level converters based on the Maxim MAX3232 are your best choice.

This photo shows the blue Zonet ZUC3100 Usb-to-Serial adapter, with a Maxim MAX3232 based level shifter. Since the level shifter needs to be powered, the Raspi’s 3.3V pin (red) and Ground (black) are connected to the Level-Shifter. Yellow and Orange are used for the Transmit and Receive lines.

On OS X, a simple Terminal with the screen /dev/tty.usbserial 115200 command issued is all what is needed to connect to the Raspberry Pi. A more dedicated application like CoolTerm may become handy as well.

2. FTDI Basic 3.3V – USB to Serial.

I have a basic breakout board for the FTDI FT232RL USB to serial IC, which is mainly used to program those Arduino boards that don’t have an USB connector. It can of course also be used for general serial applications. Big benefit here is that the FTDI Basic 3.3V already provides the 3.3V levels that the Raspbi requires. The Virtual COM Port Drivers (VCP-Drivers) for the host computer are available here
Since the FTDI Basic does’t need to be powered, only the TXD and RXD pins need to be connected.

This photo shows the FTDI Basic 3.3V Usb-to-Serial adapter, with only two (TXD and RXD) pins connected to the Raspberry Pi. Again, the FTDI Basic is powered through the USB connection coming from your host PC or Laptop. Still, the Raspberry Pi needs to be powered through its micro-usb port.

3. FTDI Basic 3.3V – USB to Serial.

If you look hard and long enough, you will find USB-to-Serial Cable, 6 Female Header Wires, 3.3V I/O, like this one over here at Micro Controller Shop. Adafruit has one as well here.

Cable like these are the easiest way ever to connect to the Raspberry Pi’s serial console port, since they can also power the Raspi.

The USB-to-Serial cable (uses an FTDI FT232RQ) is a USB-to-Serial (3.3V TTL level) converter cable which allows for a simple way to connect 3.3V TTL interface devices to USB.

The 3.3V TTL signals are color coded as follows:

  • Black – GND
  • Brown – CTS
  • Red – +5V DC supply from USB
  • Orange – TXD
  • Yellow – RXD
  • Green – RTS

This photo shows the Micro Controller Shop’s FTDI based 3.3V Usb-to-Serial adapter cable, powering the Raspberry Pi, as well as connecting to its TXD and RXD pins.

Open Rack Design Guide Available

via Open Compute Project

The Open Rack is the first rack standard that is designed for data centers, one that integrates the rack directly into data center infrastructure.

Today we released a design guide for Open Rack. This guide provides specifications and guidelines to show suppliers of IT equipment how they can build systems compatible with the Open Rack.

You can download the design guide and the technical specification from the Open Rack page. We welcome your feedback below.

UnDecima. Audio Output from Arduino.

via coolarduino

Added Part 2, on 26 August, 2012.

I already have one project where arduino outputs audio signal to USB speakers via software 10-bits PWM.  In first, I was not satisfied with quality of sound generated via PWM. There are just not enough speed in arduino engine  to run PWM well.  For example for 20.000 Hz audio, PWM has to be at least 2 – 3 times higher  above normal frequency range, or 40 – 60 kHz. If we multiply this value with 10-bits resolution, we would get 40 – 60 MHz, that is too much for small arduino to drive.

In second, the idea to create multichannel  audio system was boggling my mind for about a year now. This is how UNDECIMA project was born.  1 + 11,  or 12 channel !!! audio system running on arduino UNO board with full 10-bits resolution – maximum available with internal ADC. Project gets its name because there is 1 Master channel, and 11 linearly delayed copy of the same audio stream, or Puppets channels,  In its essence, this is acoustic  Phase Array.


 As you can see on posted drawings, the “heart” of the project is 10-bit multiplying (parallel) digital analog converter DAC1022.  Output of the IC than buffered with OPA and “demultiplex’d”  via two 74HC4051 8-channel analog switches. Outputs of the switches loaded by sampling and hold capacitors 0.01 uF, to filter out unwanted sampling frequency noise.  DAC is configured for single supply power line. Usually, they recommend to buffer output with / high input impedance / high slew rate / rail – to – rail / OPA in such configuration. Which I don’t have, and it costs about half a price of DAC itself, So, this is why I implemented two variable voltage references based on NE5532 and couple of pots. Difference in voltages between two references forms a “span”. Lower voltage creates an off-set for cheap non rail-to-rail OPA LF351, with adequate slew rate 13 V/usecond.  OPA is heavily loaded by sampling and hold capacitors, which it sees as connected in parallel at its output, 0.12 uF overall!  To minimize distortion level due overloading of the OPA, span couldn’t be adjust too wide, and preset in current design 1.414 V, providing exactly 1V RMS output for pure sine wave. I know, that 12 buffers / filters inserted after switches would solve a problem, but idea to solder more than 100 electronics components on a breadboard doesn’t look attractive for me.

( *I will try to find another  IC / circuits capable to drive big capacitive load later on. )


 Software part of the project is straightforward ”sample-delay-output” function, completely wrapped inside interrupt  subroutine. Main loop is empty. In setup 16 digital pins configured as outputs, 10 of them represent data bus, 5 are address bus and last one is check-point to measure performance with oscilloscope. Timer 2 defines a “heartbeat”, and fires interrupt  every 25 usec, or at 40 kHz. ADC configured to take samples on analog input A5 (first 4 analog pins belong to data bus). Conversion prescaler: 1 MHz, allowing sampling to be completed with fast speed. I left two digital pins D0 and D1 free, as my initial attempts to use them in data bus failed. Arduino periodically refuses to reload updates, I’m not sure if it’s Linux problem or on-board USB/RS232 converter.  Each sample, received from the ADC, is shifted left on two bits to skip D0 and D1, and plus one bit more (3 bits left shift overall) to fix “imperfection” of input preamplifier stage, as NE5532 (again) “non rail-to-rail” OPA. Look for drawings in “Audio Input” blog.  Measurements show that each channel is receiving a data for about 1 usec “window”, which is quite fast, nevertheless not fast enough to run 16 channels or to do something else with data before sending them out. In current hardware implementation the “bottle neck” is OPA, as DAC has settling time only 500 nanoseconds.

  Link to arduino UNO sketch: UnDecima.

 To be continue….

  Part 2.

  After I expressed my concern about heavily loaded OPA,  I was thinking, that it would be nice to run some measurements, in order to decide what part number would be better for this specific hardware realization (LF351 replacement), or if I have a few candidates, it would make sense to compare them based on measurements results, instead of what I can hear with my own ears. It didn’t take long to download and install JAAA application, which turn my laptop (Linux) into “home-brew” DSP laboratory.  To cancel any distortion generated in ADC (plus another non rail-to-rail OPA*) on performance evaluation of the OUTPUT stage, I modified sketch adding sine-wave LUT table, basically turning it into Sine test generator.  20 – 20.000 Hz, sweeping  along frequency axis by pot, connected to same pin A5, ground and +5V power rail.

 First of all, I check if my “off-set” 2.000 V was set correctly, as according to data sheet 3V is a minimum.

  Test confirmed, that 2V off-set was a mistake. The best results at 3V, with distortion level IMD-2 and IMD-3 less than 0.03%.  And there is no surprise, that level goes up with a Span ( difference in V-1 and V-2), simply because OPA is loaded harder.  All data were taken with phasor equals to 0. Look at the last line, where phasor was set to 11, approximately “worst case scenario” – when load of the OPA jumping up and down, in other words, when one channel is charging its capacitor, in less than 0.5 microseconds next channel connected to OPA output  asking just opposite, to discharge a cap. It happens, when relation between phasor and test frequency forms 180 degree phase difference in neighboring channels. OPA just have no time to “settle” in between. Still not bad,  for $0.60 “obsolete” OPA.

 Second test, variation of the distortion level over frequency range. I’d not comment, just look at the pictures:

 Summary: the results are quite remarkable.  They show, that Arduino is capable to run 12 channels audio system with less than 0.03 % THD.  Distortion level would be a little bit higher than 0.03 % if all 12 channel outputs not “in phase” melody, but not much than 0.05 % or so, as it’s quite unusual to have exactly 180 degree out-of-phase 100% magnitude ( what I highlighted in red line in posted table). Anyway, I will fix it replacing LF351.

  Link to arduino UNO sketch:  Generator

 * Things to DO:  I have to test INPUT for distortion level as well, more to come in part 3….

A4988 Stepper Motor Driver Carrier, Black Edition

via Pololu - New Products

Our Black Edition A4988 stepper motor driver carrier is a higher-performance drop-in replacement for the original A4988 stepper motor driver carrier. It features a four-layer PCB for better thermal performance, allowing the A4988 microstepping bipolar stepper motor driver to deliver approximately 20% more current than our two-layer version. Like our original carrier, the Black Edition offers adjustable current limiting, overcurrent protection, and five different microstep resolutions. It operates from 8 – 35 V and can deliver up to 2 A per coil with sufficient additional cooling.

RL78 Green Energy Challenge ends August 31!

via News

The Renesas RL78 Green Energy Challenge ends August 31! Now's the time to see how your low-power applications meet high-performance designs. Succeed, and you'll win a grand prize of $8,000 and a trip to Renesas DevCon in October 2012.  Click here for complete details and tips for entering. Submit your entry by August 31, 2012.   [ Click here for tips on registering for the competition. If you’ve already received your registration number, labeled your files with it and zipped...

Traveling Light

via Nuts and Volts

I’m a fan of tablet computers, the seemingly endless library of apps, and the growing body of hardware add-ons. For example, I’ve worked with the open source Hijack interface and TechBasic to make a heart rate monitor on my iPad. Also in my addon library is the suite of virtual instruments from Oscium — a digital oscilloscope, logic analyzer, and spectrum analyzer. These three instruments — each only a bit larger than the standard iPad connector — have (until now) been collecting dust.

The Arduino Wifi Shield is now available

via Nuts and Volts

The Arduino WiFi Shield connects your Arduino to the internet wirelessly. Connect it to your wireless network by following a few simple instructions to start controlling your world through the internet. As always with Arduino, every element of the platform – hardware, software and documentation – is freely available and open-source. This means you can learn exactly how it's made and use its design as the starting point for your own circuits.


Summer Deal: £20 off DVD Elektor 1990 – 1999

via News

Elektor started with digital print files in 1995 and that’s also the year the first annual CD-ROM appeared, enabling readers to browse Elektor on a PC, produce hard copy of their favourite articles, and search for keywords, all using a purpose designed shell program. Later year volume CD-ROMs employed the Adobe pdf format which greatly simplified the compilation and production of CD-ROMs and they have been around now for 17 years without fail.   However, many readers expressed a desire...

Tiny WiFi Adapter for Raspberry Pi

via Wolf Paulus » Embedded

[Updated on Feb. 2. 2013 for (2012-12-16-wheezy-raspbian) Kernel Version 3.2.27+]

The extremely small EW-7811Un USB wireless adapter looks like the perfect WiFi adapter for the Raspberry Pi. Not only is it tiny and relatively inexpensive, it also seems capable enough to be a great companion device for the Raspi. While elinux still shows that some users report timeouts trying to initialize the module, I cannot verify this with 2012-12-16-wheezy-raspbian.

WiFi is not really necessary for the Raspberry Pi. It already comes with an ethernet port, provides RS-232 (aka serial-) connectivity, and has two USB ports. However, in case you wanted to add WiFi to the Raspi, this little adapter seems to be as good as any. Here is why:

The Edimax EW-7811Un

  • complies with wireless IEEE802.11b/g/n standards
  • adjust transmission output by distance and CPU offload, to reduce power consumption when wireless is idle
  • is currently the smallest wireless adapter
  • currently cost between US$ 9 and US$ 15

more than enough reasons to cut the cord and add WiFi connectivity to the Raspberry Pi.

After performing the usual initial configuration in raspi-config, using WiFi Config (a GUI tool sitting at the desktop when starting LXDE with startx) is by far the easiest way to get the Edimax EW-7811Un configured.

But let’s quickly run through the steps of creating that bootable SDCard before dealing with the actual WiFi issues:

Creating that bootable SDCard

  1. Download the image file from
  2. Unzip the file to get to the image file.
  3. df -h to determine which drive is used for the sdcard, e.g. integrated SDCard Reader turned out to be disk2 for me.
  4. sudo diskutil unmount /dev/disk2s1
  5. sudo dd bs=1m if=/Users/wolf/Downloads/2012-12-16-wheezy-raspbian.img of=/dev/rdisk2
  6. sync
  7. sudo diskutil eject /dev/rdisk2

On a class 10 SD Card, the whole process shouldn’t take much longer than 70 seconds maybe. Insert the SDCard into the Raspi, power up, boot, and use the on screen menu:

In case you need to do this over a network, the Raspberry Pi’s default hostname is raspberrypi. I.e.
ssh pi@raspberrypi .. the pasword is raspberry

sudo raspi-config

  • Expand root_fs
  • Change password
  • Change locale to EN_US.UTF-8 UTF-8 (un-select english UK and select select in long list)
  • Set Time zone (America / Los_Angeles)
  • Change memory split to 128:128
  • Enable ssh

Finally reboot: sudo shutdown -r now
Running the raspi-config again to execute update feature, reboot and login.
Now finding more updates and upgrades like so:

sudo apt-get update
sudo apt-get upgrade

Changing the PI’s hostname

Edit the host name in these two locations:

  • sudo nano /etc/hostname
  • sudo nano /etc/hosts

Adding WiFi support / EW-7811Un

With previous wheezy builds, I had to install the realtek firmware, blacklist the already installed 8192cu driver and install a new one. Not this time. ifconfig shows the wlan0 interface and iwlist wlan0 scan can be used to scan for available Wifi access-points, without any firmware installation or driver updates.


All what’s needed to do to connect the Raspberry Pi to a Wifi Network, is to add a network configuration to /etc/wpa_supplicant/wpa_supplicant.conf.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

The network configuration depends very much on your network, SSID, Password Security etc. However, here is what I have added, to make the EW-7811Un connect to my WiFi network:


With the correct WiFi network configuration added to the wpa_supplicant.conf file, the ethernet cable can be removed and the Raspberry Pi will automatically switch over to WiFi.
This behavior is pre-configured in /etc/network/interfaces, which looks something like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Raspberry Pi – WiFi (Edimax EW-7811Un)

Backup the SD Card

Once done with setting up Raspian, I usually create an backup image that later can be copied onto the same or a different SD Card (of equal size).


Insert the perfect SDCard into the Card Reader and find out how to address it. Again, for me that usually is disk2s1.

sudo diskutil unmount /dev/disk2s1
sudo dd bs=1m if=/dev/rdisk2 of=~/RASP_3_2_27.img
sudo diskutil eject /dev/rdisk2

Depending on the size of the SDCard, this will create a huge file (like 16GB) an may take a while (like 7min).

Restore or Copy

Insert am empty SDCard into the Card Reader and find out how to address it. Once again, for me that usually is disk2s1.

sudo diskutil unmount /dev/disk2s1
sudo dd bs=1m if=~/RASP_3_2_27.img of=/dev/rdisk2
sudo diskutil eject /dev/rdisk2