Jun 17, 2014

Back in Black - a DIY raspberry pi Boombox: Initial Setup

Start with the Software Installation for the Day & Night Sampler. Put a test system together with breadboard and wire jumpers - you can use that as a model to refer to when you make the real deal. Really. Not kidding, here...

Oh, back already? That was fast!

Let's keep going...

By this point, you should have a working raspberry pi mpd system. You need this first, before you proceed with the installations on this page. That gives you a known good starting point which will help when you need to debug things.
If you followed along with the previous build, you should have a raspberry pi, that will:
  • display "Now Playing" song title
  • respond to remote button presses
  • produce sound from speakers (either test speakers or the one's you'll end up using)
If not, troubleshoot it! Most common problems are loose or poorly connecting wires; insufficient power; something missing from the software installation.

It's working? OK, continue..

Make the following changes.

To install the code, download it from here: thisoldgeek rpi-boombox

For code running on the raspberry pi:
  • Delete /etc/init.d/rpi_boombox.
  • Install the python scripts for rpi_boombox_v2.py and rotary_class.py in /home/pi
  • You should haven already installed VFD.py in /home/pi if you followed the above instructions
  • Save the rpi_boombox_v2_init.sh script in a directory of your choice; instructions for installing this script are on this page
    • Make sure you change any reference in those instructions from rpi_boombox to rpi_boombox_v2
For code running on the Arduino:
    • Download the HT1632_LedMatrix Library from github (not my repository)
      • This is for the Sure LED 0832 Matrix. If you want to use a different LED Matrix, you will need to adjust which library you use and, most likely, some Arduino code
    • Copy the HT1632_LedMatrix lib to your sketchbook/libraries folder
    Gather the new Hardware
    There are three new pieces of hardware to get working:
    • Neopixel 12 ring(s) (two needed)
      • Solder wires to GND, +V and Data In
    • Sure 3208 LED Matrix
    • rotary encoder - you can solder a small protoboard like the picture below and reuse it again for your final build

    Also, there are added jumper wire connections to the GPIO's of the raspberry pi:
    • 3 pins for the rotary encoder
    • 1 pin for a HIGH/LOW toggle switch to the arduino
    Test the Spectrum Shield
    Solder up long female headers to the Sparkfun Spectrum Shield and plug it into your Arduino. By now, you should have read John Boxall's MSGEQ7 Spectrum Analyzer Tutorial, number 48 in his series of tutorials. Download example 48.1 to your Arduino. Connect a 3.5mm headphone extension cable from the USB sound dongle on the raspberry pi to the input of the Spectrum Shield. With a serial monitor running on your Arduino, do you see audio frequency values rolling by? Good!

    Test the Neopixels
    • Copy the sketch boombox_music_visualizer.ino to your sketchbook folder
    • Start Arduino and upload the boombox_music_visualizer.ino to your target Arduino board
      • The LEDs are set to ON on startup in the sketch. Change led_toggle to read like the following line to force them OFF on start;
        int led_toggle = 0; // takes input from Rpi to turn lights on/off
      • Unplug your Arduino
    • Run a jumper wire from raspberry pi pin  to pin X on the Arduino
      • This will toggle ALL the LEDs HIGH/LOW (ON/OFF) from the Arduino
    • Attach a single NeoPixel to the Arduino
      • DIN = Pin XX, GND to GND, +V to +V
    • Restart the Arduino, with the toggle jumper, NeoPixel and headphone extension in place
    • Play some music through the raspberry pi, gradually increasing volume; you should see the NeoPixel react

    Make the Frame, Next

      No comments:

      Post a Comment