A cool thing i saw at CES was the “RaZberry”. The Razberry is a $59 Pi shield that turns your Raspberry Pi into a Z-Wave enabled Home Automation gateway. It comes pre-compiled with Z-Wave wireless network management software which you can drop your own web interface onto. As long as you know basic HTML and JSON you can have an app up with no problems. Here is info on the API. If you want to try home automation and have z-wave hardware this is a great project. I know i am looking forward to playing with it.

Some Details:

Sigma 3102 Z-Wave Tranciever Chip

32 Kbyte EEPROM

PCBA Antenna 868/908 MHz

Connects to PI’s GPIO

C or JSON baed API

Data subscription model for low network traffic

How do I get started?

Order to board and a Raspberry PI.

Follow the guidelines on the Raspberry blog how to load a operating system of your choice to the board.

Plug in the RaZberry board, log in and type in the following command line: wget http://www.z-wave.me/install_razberry.sh -qO – | sh -c

Overview – What is it

Using a Raspberry Pi you can create a pretty cool stand alone Pandora Streamer. Its a pretty easy project to put together and will only take an evening. Even though this project is basic from a Electrical Engineering standpoint you will learn the basics of GPIO, Python, BASH and basic Circuts. The best part is you can totally use this project on a daily basis. This version also will allow you to use the device as a Airplay reciever when you are not using Pandora.

I do not just want to show you what i did but show you where i went wrong and how i got the correct answers so you will feel confident trying this stuff yourself. This project cost me about $50 – $75 USD and was a blast.

If you choose to go wireless (much cleaner) plug the WIFI adapter into one of the USB ports. Log into the Pi using a keyboard/mouse and HDMI connection. You want to be using the actual Linux GUI not SSH. On the desktop use the “WiFi Config” tool to set up the connection to your wireless network. I was not successful setting it up on my network using just ssh.

Step 2 – Install Pianobar

Pianobar is a command line interface for Pandora. It is super lightweight and will work well with Python.

A. Download and Install

sudo apt-get install pianobar

Accept all of the prompts to install. Type “Pianobar” at the prompt after installation to see it run. It will ask for your email and password but we will automate that in a minute. After starting it will ask which station to play. Select your favorite. After selecting it you will see a 18 digit code in parenthesis next to the station name, copy this we will need it for the config file. Type “?” after it starts to see a list of commands.

B. Set up a config file for Pianobar

If you have been logged into the Pi as the user “Pi” then Pianobar has installed into “/home/pi/.config/pianobar”. Under the Pianobar folder is a config folder, we will put a config file in there that will allow the app to auto-signin. Download the config file below.

In the User section replace user = [Your Email], password = [Your Password] with your credentials. Also, replace autostart_station = [Favorite Station ID] with the ID of the station you want the device to tune to first. Enter the 18 digit code you copied from the last step.

Step 3 – Set Up FIFO

What i learned: In this section i tried creating the FIFO file as a standard one, not using the mkfifo command. I spent a long time trying to figure out where i went wrong.

FIFO is a file that allows communication between Pianobar and our Python scripts. Basically Pianobar is always looking at this file for changes and will treat the text in the file as user input. The config file we added points Pianobar to the folder for FIFO.

fifo = /home/pi/.config/pianobar/ctl

This folder does not exist yet so create it with:

mkfifo /home/pi/.config/pianobar/ctl

To test that everything is working correctly, restart Pianobar. In another terminal window, enter:

echo ‘n’ >> /home/pi/.config/pianobar/ctl

You should be able to fully control Pianobar this way. Once you full understand this concept then the Python scripts will make more sense.

Step 4 – Connect the LCD

What I learned: The original circuit called for a 3.3v voltage regulator connected to the 5v bar. I realized this was not needed since the LCD i used could use direct 3.3v from the Raspberry PI. That circuit got simple at that point with only a 1k resistor between Tx and Rx.

A. Connect Power

Connect the 5V on the LCD to the 3.3V rail (5V label on this exact model of LCD is a misprint, it is actually 3.3V)

Connect GND to the Ground Rail.

B. Connect Tx

Connect Rx from the LCD to Tx on the Pi using a 1K resistor (Brown, Black, Red, Silver/Gold) in between.

Connection Diagram

Edit: In this Diagram GND should be connected to the GND rail not SDA, sorry.

Step 5 – Connect your Buttons

What I learned: The original circuit had the switch wired to where the 1k and 10k resistors meet. I found that this would not always work as desired but the diagram below works well.

You will be using the following 6 GPIO pins (SDA, SLC, 4, 17, 27, 22) for input. You need to build a circuit for each

A. Build the button Circuit

Power > 10k > 1K. The 1K splits to the GPIO pin (its the D1 – LED in the diagram) and the Switch witch goes to ground.