Introduction: A Raspberry Pi Project Maker Station

A Project Maker Station comprising of two Raspberry Pi's in a custom case. With a distinctly 80's feel.

The following is a general description of the project build and the problems encountered whilst building.

Step 1: Project Concept

A Project Maker Station that is self contained. The idea being to have a computer cabinet with a keyboard, mouse and LCD screen allowing access to GPIO breakout and easy bread boarding, with discrete power to any projects.

This led to the idea of having two Raspberry Pi's. One to handle GUI and communication, the other to handle all of the GPIO experimentation. In essence one machine operating completely headless, the Slave-Pi. The other being the remote communicator or Master-Pi. However all should be contained in one custom cabinet within easy access.

This is a project that will remain within the confines of my own network for the most part, and is not expected to be mobile.

Step 2: Parts List

Wood : Cabinet

  1. wood (plyboard, whatever came to hand)
  2. wood screws
  3. Cabinet feet (cork board)

Paint : Cabinet

  1. Paint
  2. Gripper

Parts : Cabinet

  1. Vivitar Speakers, 1, Dollar General. $6.00 each
  2. 5V Powered USB 4-port Hub
  3. Motion Sensor
  4. LCD Screen 14.1" Samsung LTN141P2-L01 (salvaged from a laptop computer), Amazon, $49.00 each
  5. LCD Driver Board, 1, Ebay, $28.49 each
  6. HDMI to VGA converter, 1, Amazon, $6.99 each

Wood : Project Maker Board

  1. p/n 50244 1 x 6 x 24 Select Pine Craft Board, 1, Lowes, $4.67 each
  2. p/n 50234 1 x 4 x 24 Select Pine Craft Board, 1, Lowes, $2.18 each
  3. p/n 50227 1 x 2 x 36 Select Pine Craft Board, 1, Lowes, $1.68 each
  4. Canakit GPIO Breakout for raspberry Pi (with ribbon cable), 1, Canakit, $9.95 each
  5. Solderless Breadboard, 2, Amazon, $2.71 each

Power Supply

  1. p/n 2750694 SPST Rocker Switch (Red), 1, Radio Shack, $3.49 each
  2. ATX Power Supply (salvaged parts, AC BEL U p/n 41A9739), 1, Aliexpress, $50.00 each
  3. LED (any color), 2, Amazon, $0.05 each
  4. 220 to 330 Ohm Resistor, 2, Amazon, 0.05 each

Keyboard

  1. USB ADESSO model no. AKB-110B, 1, Walmart, $23.20 each
  2. Rii K12 Ultra Slim keyboard, 1, Amazon, $24.39 each
  3. Logitech B100 Optical Mouse, 1, Walmart, $7.69 each
  4. Game Controller Pad, 2, Amazon, $10.99

Raspberry Pi

  1. Raspberry Pi Model B+, 1, Element14, $25.00 each
  2. Raspberry Pi 2, 1, Element14, $35.00 each
  3. nRFL01+ Mini Project Board, 1, Instructables Project, $7.44 each
  4. 8GB SD Card, 2
  5. USB 64GB Flash Drive
  6. Canakit usb WiFi adapter

I have used bits and pieces from other projects or salvaged from various places. The wood for the most part came from off cuts in my garage. Where I could source a similar piece I have listed it here with a price.

Step 3: The Cabinet

I do not have access to any lazer cutters or cnc machines, so everything was cut either by hand or with a jig saw and a Dremmel tool.

The important size determining pieces are the LCD screen and the ATX power supply. The dimensions I used here were really dictated by the size of the LCD screen.

Using the general schematic in the attachments I marked out the side pieces and then roughly cut them out using a jig-saw. I sanded the pieces to improve the fit.

I roughly cut the top, bottom and back pieces. The front piece will also need to have a center hole cut out to accommodate the screen. This was done very roughly using a drill and jig saw. All of the pieces were then cleaned up as best I could using a Dremmel tool with a sanding attachment and a larger sanding tool. All of the imperfections would be filled and hidden as best I could with wood filler and paint.

I assembled the cabinet pieces. Using a general wood filler, I filled and then sanded and shaped the pieces as seen fit. I continued to fill, then sand, and shape the cabinet until the desired shape and fit was obtained.

I used #6 1 1/4 inch wood screws that were too long for my project, so I needed to cut and grind them down, before using wood filler to cover them over.

The screen and project holes were then cleaned up using 1/4" beading or framing. This was cut to fit with 45° angles, giving a few mm overlap to hide the ugly access holes.

I used hinge pieces from a wardrobe set that I had lying around to attach the back of the cabinet.

Step 4: Paint It

I gave the cabinet three coats of Gripper (just a can I had lying around the garage). I then followed by giving the cabinet four coats of exterior matt black paint. All paint was applied by hand using a brush.

This was an organic build, so I continued to cut, paint, sand and shape during the whole painting process.

Step 5: The Project Maker Board

The Project Maker Board was created using project boards purchased from the local home improvement store.

Using :

3/8 x 6 x 36 inch craft board - this board creates the table top. Cut to 14.5 inches in length.

3/8 x 3 x 36 inch craft board - this board creates the cabinet slot connector. Cut to 11 inches in length.

3/8 x2x24 inch craft board - this board creates the usb stand-off. Cut to 2 inches in length.

Glue the larger two pieces of board together using general purpose wood glue, clamp and set aside to set for 24 hours. Now channel out the cable routes, these will allow ribbon cables and leads to be directed out of the cabinet to the top of the board, for use with solderless bread boards. The pictures indicate how this was all put together. The measurements are fairly arbitrary, all depending on the overall size of the cabinet.

The idea here is that different Project Maker Boards may be attached to the system for various purposes. A game pad for an arcade, or more complex Maker Bread Boards. This board is a very simple GPIO breakout, with discrete 5V power rail taken from a solderless breadboard for general maker play.

Step 6: Sound : Build a Simple Amplifier Using an LM386 (or Perhaps Not!)

LM386

I tested the simplest circuit I could make using an LM386 by setting it out on a breadboard. Taking the schematic I had drawn up in Fritzing and using the components that I had on hand, I laid out the circuit on a breadboard, plugged a cable into the computer and played a radio stream. This was more than adequate for my purpose. I played with a number of different capacitors that I had on hand, and then settled on using 100uF 16V electrolytic capacitor. Now I became a little too confident, changed up the circuit and decided to lay it down on 60 x 40 mm prototype board. Poor layout and planning led to the LM386 becoming toast.

I now had to find another solution to provide sound for the system.

Problems Encountered

  1. The LM386 circuit worked beautifully on the breadboard, however on building the circuit on prototype board I inadvertently reversed the voltage through the circuit. The IC became nice and hot, and now it doesn't work. This was just too bad, as it was the only LM386 that I had.
  2. Spending more time planning the circuit layout on protoboard would alleviate a lot of the problems I encountered. I tend to build as I go, which in a lot of cases is not the best way to approach a design or build. In an attempt to encourage myself to plan a little more I designed a work sheet in Microsoft Word that should allow me to sketch out the component layout before soldering anything permanently to the boards.

As time was marching on I decided to take the easy route and purchase a set of compact speakers from the Dollar General. Vivitar Compact Speaker System Item#V03017 at a cost of $6.00. I then hot glued the speakers into the top of the cabinet, beneath the holes I had already cut for some salvaged laptop speakers. I may eventually attach the 3V3 line to the speakers, however I do not need sound that often so for the moment battery power is fine. For the most part these will remain in the OFF position.

References:

Step 7: ATX Power Supply

Using a salvaged ATX power supply.

24 Pin Motherboard Connector P1

  1. Orange, 3V3
  2. Orange, 3V3
  3. Black, Ground
  4. Red, 5V, ---> *** added screw terminal 5V to Raspberry Pi ***
  5. Black, Ground
  6. Red, 5V, ---> *** added screw terminal 5V to Raspberry Pi ***
  7. Black, Ground
  8. Grey, Power Good, ---> Anode of a Green LED (POWER GOOD INDICATOR)
  9. Purple, 5V Stand By
  10. Yellow, 12V, ---> Anode 12V Power Plug supply to LCD screen
  11. Yellow, 12V
  12. ---
  13. Orange/Brown, 3V3 Sensing ---> keep orange and brown wires connected
  14. Blue, -12V
  15. Black, Ground
  16. Green, Power On ---> connect to switch
  17. Black, Ground
  18. Black, Ground
  19. Black, Ground
  20. ---
  21. Red, 5V, ---> *** added usb cable, to supply 5V to the Solderless project breadboard
  22. Red, 5V, ---> Anode of a Red LED (POWER ON INDICATOR)
  23. ---
  24. Black, Ground
--- indicate that there is no connection to this pin

4 Pin 12V Motherboard Power Connector P2

  1. Black, Ground
  2. Black, Ground
  3. Yellow, 12V
  4. Yellow, 12V
This connector was left intact, for use at a later date.

Power Connector P3

  • Yellow, 12V
  • Black, Ground
  • Red, 5V ---> Powered USB 4 port Hub
  • Black, Ground ---> Powered USB 4 port Hub
  • Orange, 3V3

Power Connector P4

  • Yellow, 12V
  • Black, Ground
  • Red, 5V
  • Black, ground
  • Orange, 3V3
This connector was left intact, for use at a later date.

All connections were made using screw terminals soldered to the required wire voltage supply, with a ground.

Problems Encountered

  1. The power supply would shut down when the Raspberry Pi was attached. It would appear that the system goes into over current shutdown. On further inspection I found that attaching a hard drive to the power supply, either on P3 or P4, would give a stable supply. I surmised that the 12V rail required a load too. I took a 100 Ohm, 5W 10% resistor sandbar and placed this on the 12V line. Now the power supply stayed on. I used an old Go-Phone to test the power supply as I did not want to brick a Raspberry Pi. Once the system is assembled, the screen will operate from the 12V rail, perhaps we will obtain a stable power supply and not need the load resistors. In fact this was the case, once all of the components were attached, the sandbars were not required.
  2. When the 10 Ohm resistor was attached, it became incredibly hot. I decided to use another resistor in series to place 20 Ohms on the 5V line. I would have liked to use 100 Ohms, but did not have another sandbar to use. I found that once all of the components for the system were connected, primarily the LCD screen, then these load resistors were not required. I subsequently removed them from the build.
  3. The Raspberry Pi operates with low current. This is indicated by the rainbow colored square in the top right hand corner of the screen. I found that placing a 100uF electrolytic capacitor across the supply fixed this problem.
  4. The micro usb cable I purchased from the Dollar Store was not "man enough" for the job. It was fine for small current draws, but once the Raspberry Pi 2 started to operate, the power became unstable. I put this down to the small wire size in the cheap cable. I decided to supply power to the Raspberry Pi's using a custom connector, and also placed a 100uF electrolytic capacitor across the power inlet.

References:

  1. Encyclopedia of ATX to Bench Power Supply Conversion by Russ Hensel
  2. ATX by Wikipedia
  3. ATX Power Supply Pinout Tables, Tim Fisher

Step 8: USB 4 Port Hub

I Soldered leads to the power inputs on the USB hub. Cut the casing to allow the leads access. Then hot glued the whole thing into the cabinet allowing access to the connectors through the hole cut in the cabinet. I Connected the power leads to a screw connector on a 5V power line.

Step 9: A 160 GB Hard Drive That Did Not Make It Into the Project

This was an old hard drive enclosure, at the time it had a nice rubber like finish. However this plastic would seem to degrade very quickly. The enclosure now has a very sticky feel, with a distinctly melted appearance. The first picture clearly shows this. I decided to remove the contents and place it in the project build.

  1. Dismantle the hard drive case.
  2. Remove the PCB and hard drive.
  3. Solder leads to the power connector.
  4. Connect the power leads to the 12V screw terminals on the ATX power supply.

However cabinet space was not really ideal for this component, so I decided to use a 64GB flash drive instead. I will use the Hard Drive for another project.

Step 10: Supply Power to the Raspberry Pi

Raspberry Pi B+

Using the test point pads, I soldered leads to PP1(Red) and PP3(Green), I also placed a 100uF electrolytic capacitor across PP1 and PP3 pads (actually soldering to the wire leads, then isolating with heat shrink). This has stabilized the supply to the Raspberry Pi, the boot up appears to be much faster, and there is no low power notification in the top right hand corner. The leads were then connected to a screw block connector on the 5V power line (Red).

  • PP1---> 5V
  • PP3 ---> Ground

Raspberry Pi 2

Using the test point pads, I soldered leads to PP2(Red) and PP5(Green), I also placed a 100uF electrolytic capacitor across PP2 and PP5 pads (actually soldering to the wire leads, then isolating with heat shrink). The leads were then connected to a screw block connector on the 5V power line (Red).

  • PP2 ---> 5V
  • PP5 ---> Ground

The electrolytic capacitor placed across the 5V pad and Ground stabilized the power draw significantly. The single board units would start initially with the rainbow square in the top right hand corner of the screen. Once the capacitor was added, the rainbow square did not reappear.

Step 11: Test the Components

I laid out the most of the components I intended to install into the system prior to installing into the cabinet. Attached the ATX power supply, then turned it all on. Everything seemed to work, so I decided to proceed with the build.

The LCD Screen

I purchased a driver board for my laptop screen, over a year ago with the intention of making a project like this. It is important to order correctly as firmware drivers must be compatible with the screen you are going to use. The screen details should be communicated to the driver board vendor so that they may install the correct firmware for the screen you are using.

I am using a LTN 141P2-L01 salvaged from a Hewlett Packard Compaq laptop.

Step 12: Place the Components Into the Cabinet

I used a lot of hot glue whilst proceeding with the build.

Install the components into the cabinet:

  1. Install the USB hub. Secure it to the cabinet using hot glue.
  2. Install the motion sensor to the front of the cabinet. Secure it using hot glue.
  3. Install the LCD screen, use hot glue to secure it firmly to the cabinet. install the two backing boards to prevent the screen from falling out. Secure the backing boards with hot glue.
  4. Install the ATX power supply. Secure the power supply to the cabinet using hot glue.
  5. Install the Raspberry Pi B+ to the front of the cabinet. Secure the stand offs to the cabinet using hot glue.
  6. Install the Raspberry Pi 2 to the back of the cabinet. Secure the stand offs using hot glue.
  7. Install the Vivitar speakers, hot glue the speakers to the top of the cabinet. For the time being the speakers will remain battery powered, however they may be connected to the 3V power line if desired.

Step 13: One Raspberry Pi to Control Them All

Using a Raspberry Pi 2 to control the cabinet, this will be the Master unit. The Raspberry Pi B+ will be controlled via ssh from the Raspberry Pi 2, this will be the Slave unit.

The idea here will be to insert SD cards for the specific uses required. For example Raspbian will be the main Maker profile used. But removing the Raspbian SD card and inserting a card with PiMAME would turn the Maker into an arcade box. Insert KODI for a media box. The SD card offers almost unlimited flexibility in this manner.

Step 14: Install the Raspberry Pi B+ Operating System (Raspbian Jessie Lite)

All of the software installation was performed from a laptop PC running on Linux Peppermint6.

The Raspberry Pi B+ will be the project testing unit. This board will have Raspbian Lite installed on an 8GB SD card. Ensure that the Raspberry Pi B+ is connected to the internet by Ethernet cable for this initial setup.

  1. Download the Raspbian Lite Operating System Image form here.
  2. Format an 8GB SD Card using your favorite SD card formatter.
  3. Copy the system image to the SD card, using your favorite disk image copier.
  4. Place the SD card in the Raspberry Pi B+ .
  5. Boot the Raspberry Pi B+ .
  6. Log into the Raspberry Pi.
  7. Login ID = pi
  8. Login Password = raspberry

Now change the font size in case we may want to operate this unit using a screen as shown in some of the pictures. The HDMI to VGA adapter may be plugged into either the Raspberry Pi 2 or the Raspberry Pi B+.

sudo apt-get update 
sudo apt-get upgrade 
sudo dpkg-reconfigure console-setup 
  • select UTF-8select Guess Optimal Character Set
  • select Terminus font
  • select 16x32 font size (or one of the other sizes that are listed)

Now install rpi-update (rpi-update is included by default in the full Raspian image). This will bring the system firmware up to date. You do not necessarily have to perform this operation, but it is a handy tool to have in place.

sudo apt-get update 
sudo apt-get install rpi-update -y

Now update the operating system firmware.

sudo rpi-update 
sudo reboot
sudo apt-get update 
sudo apt-get upgrade 

Now setup the system parameters.

sudo rpi-config
  • expand the filesystem
  • set the relevant regional settings
  • set the time zone
  • set the desired Advanced Settings
  • ssh, spi, ic2, serial, etc.

Install some applications if desired.

sudo apt-get install mc -y
sudo apt-get install avrdude -y
sudo apt-get install lynx -y

Th Raspbian Lite Operating System has now been installed. The system may now be tweaked according to personal preference.

Step 15: Raspberry Pi 2 : Install the Operating System

The Raspberry Pi 2 will be the GUI Master control unit. This board will have the full Raspbian image installed on an 8GB SD card.

Ensure that the Raspberry Pi 2 is connected to the internet by Ethernet cable for this initial setup.

  1. Download the Raspbian Operating System image from here
  2. Format an 8GB SD card
  3. Write the Raspbian image to the SD card
  4. Place the SD card into the Raspberry Pi 2
  5. Boot the Raspberry Pi into the Raspbian GUI

Start the Raspberry Pi Configuration application and make the appropriate localization settings. Then ensure that all of the required kernel switches are set.

  1. expand the file system
  2. ssh ---> [yes]
  3. spi ---> [yes]
  4. i2c ---> [yes]
  5. serial ---> [yes]
  6. Finish and Reboot the system.

I like to use the terminal, so after rebooting into the graphical GUI, press and hold [CTRL][ALT][F1], this will allow logging into a terminal workspace. To move back to the graphical GUI press [CTRL][ALT][F7].

use [CTRL][ALT][F1-F7] to move between workspaces, workspace F7 is the graphical X system.

sudo apt-get update
sudo apt-get ugrade

We may leave it here, however I updated the system firmware using:

sudo rpi-update
sudo reboot

I created a simple bash script to automate a lot of this:

  1. download the script
  2. rename the file

mv -iv raspbian_build.sh.txt raspbian_build.sh
chmod o+xwr raspbian_build.sh 
chown pi raspbian_build.sh
chown :pi raspbian_build.sh

now simply uncomment the lines that are required, or comment out the lines that are not required, then:

./raspbian_build.sh

The script should proceed and install the desired applications along with the nRF24L01 and Adafruit DHT libraries. It will also change the size of the default swap partition.

Note: this is a very simple poorly written script. There is no error checking or problem capture. For the most part it works, but take care with it. The default script will simply update the system, install the libraries and change the swap partition. However a few edits will allow applications to be installed or removed, depending on the image result desired.

Monitor the script as it runs, answer the prompts accordingly with either [Y] or [N]. The prompting will mostly be concerned with the installation of the nRF24L01+ libraries.

Step 16: Install the Optimized NRF24L01+ Libraries

Now install the nRF24L01 Optimized Libraries onto both Raspberry Pi's. The current revision as of this writing is V1.14.

wget https://tmrh20.github.io/RF24Installer/RPi/install.sh
chmod +x install.sh
./install.sh

Answer Y to all of the prompts. This will download all of the required optimized libraries for the nRF24.

We do not need this script anymore, so we will remove it.

rm install.sh
sudo apt-get install libboost1.50-all -y 
sudo apt-get update
sudo apt-get upgrade 
sudo reboot

Now do a make install for the Python RF24 libraries as they are needed.

cd rf24libs
cd RF24
sudo make install
cd examples_linux
sudo make install
cd extra
make
sudo make install
cd ~/rf24libs/RF24/
cd interrupts
make
sudo make install
cd ~/rf24libs/RF24/
cd ~/rf24libs/RF24/pyRF24

Now make sure that we can compile the nRF24 libraries for the Raspberry Pi. The swap space in the default Raspian configuration is not large enough to cope with the library installation, so we need to make the following changes.

free
sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
sudo mkswap /var/swap.img
sudo swapon /var/swap.img
free
sudo ./setup.py install

This is the solution as shown in the reference below by Goldseal.

Ensure that a nRF24L01+ mini project board is attached to the Raspberry Pi B+ and also to the Raspberry Pi 2.

cd ~/rf24libs/RF24/examples_linux

Now edit the pingpair_dyn.py example to reflect the pin layout of the nRF24L01+ mini project board

nano pingpair_dyn.py

Change or add the following lines to the program code.

#RPi B+
# Setup for GPIO 22 CE and CE0 CSN for RPi B+ with SPI Speed @ 8Mhz
#radio = RF24(RPI_BPLUS_GPIO_J8_15, RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ)
# Setup for nRF24L01+ mini project board for RPi B+
# GPIO 25 CE and CE0 CSN
radio = RF24(RPI_BPLUS_GPIO_J8_22, RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ)

[CTRL][X}

answer [yes] to save the file

change the name of the example program, this will keep the default example untouched.

pingpair_dyn_mpb.py

[ENTER]

sudo python pingpair_dyn_mpb.py

The screen should display the details shown in the pictures.

Set the Raspberry Pi B+ as the Transmitter and the Raspberry Pi 2 as the Receiver. The screen should now display the received packets from the Raspberry Pi B+.


Problems Encountered

  1. In the Optimized nRF24 libraries the directory examples_RPi, does not exist any more, it is now called examples_linux.
  2. There are many more example files, the directory structure appears to be very different. I have found that I need to move through the directory structure performing make as needed.
  3. There is not enough swap space to compile the nRF24L01 libraries using the default system. pyRF24 setup.py terminates with an error Killed(program cc1plus).

References

Optimized High Speed NRF24L01+ Driver Class Documentation, V1.14 by TmRh20

[SOLVED] g++: internal compiler error: Killed(program cc1plus), Bitcoin Forum

Step 17: Install the Adafruit DHT Libraries

Now install the Adafruit DHT library onto both Raspberry P's.

git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo python setup.py install 
cd /examples nano simpletest.py

change the lines below in order to conform to the nRFL01+ mini project board pin layout for the DHT11 temperature and humidity sensor.

sensor = Adafruit_DHT.DHT11
...
pin = 4
sudo python simpletest.py

Now test the program

sudo python simpletest.py

Now return to the home directory.

cd ~

References

DHT Humidity sensing on Raspberry Pi or Beaglebone Black with GDOCS Logging, Adafuit

Step 18: Network

Set static IP addresses using the local router. I prefer this method as it is intended that for the most part this project will not be connected outside of my own network. Using the primary network router dhcp management is a much easier and neater option. I have set aside index address 200-255 for my own static use. I will never use them all.

eth0 static IP addresses

  • Raspberry Pi B+ : 192.168.0.210
  • Raspberry Pi 2 : 192.168.0.220

wlan0 static IP addresses

  • Raspberry Pi B+ : 192.168.0.215
  • Raspberry Pi 2 : 192.168.0.225

Remove dhcpcd5 on the Raspian-Lite system.

sudo apt-get remove dhcpcd5 -y

Install wicd-curses.

sudo apt-get install wicd-curses -y
sudo apt-get update
sudo apt-get upgrade
sudo apt-get reboot
sudo wicd-curses

Now use wicd-curses to select the desired Wifi network and set automatic login for future reboots.

Use the graphical user interface to connect the Raspberry Pi 2 to the WiFi network.

This is the easiest means of connection. Both Raspberry Pi's are available for ssh from anywhere on the network. The Project Maker Station just needs to be plugged into a wall outlet and turned on.

For the most part, this is my preferred set up. However it is perhaps wasteful of a WiFi dongle that could be put to better use elsewhere.

References

  1. Raspberry Pi ASAP Setup Guide,
  2. How to assign a Static IP to The Raspberry Pi, by LiveSparks
  3. WiFi - Access Point out of a Raspberry Pi (Repeater), by MrPyr0fiRe
  4. Raspberry Pi - Web Server / Wireless Access Point (WAP), by 56052

Step 19: Test the Project : Hello World in Motion

Blinky

A simple Hello World Blinky LED circuit and Python script was used to test the project

The simple Blinky circuit as shown in the Fritzing diagram was laid out on the solderless breadboard. The Python script was then used to test the circuit. Running the Python script on the Raspberry Pi B+, from the Raspberry Pi 2, using SSH through the bash shell interface.

Place an led on the bread board, anode to GPIO17, cathode to a 220 Ohm resistor, which should then be connected to ground.

open a bash shell on the Raspberry Pi 2.

ssh pi@192.168.0.215
sudo python example1.py

The LED should blink.

Motion Sensor

Now try the motion sensor. Build the circuit as shown in the Fritzing diagram above. Power to the 5V rail and ground to GND. The sensor should be connected to GPIO4.

sudo python example2.py

The led should flash when motion is detected by the sensor.

Step 20: Finishing Touch : Add a Logo

The finishing touch, a logo. Using a soldering iron to burn the logo into a piece of wood to make a badge for the cabinet. Then attach the badge to the cabinet.

Step 21: Raspberry Pi Collateral Damage!!!

I destroyed one Raspberry Pi B+ when I was very careless removing it from the cabinet, I inadvertently knocked one of the 4R7 inductor components off of the board. This will be a repair job for later. I managed to de-solder the remaining damaged part using a piece of copper wire bent around the component, however I also took away the small components next to the piece. I will look to completing a repair later perhaps, however Element14 is selling the Raspberry Pi B+ for $12.99 at the moment.

Step 22: The Final Piece

Some pictures of the final assembled project.

Step 23: Thoughts and Conclusions

Thoughts on expansion and improvement

Just a few thoughts on where I might like to take this project for the future.

Multiple Operating Systems

Berryboot

Install various Operating Systems on a Flash Drive, then boot to a selected operating system as required. However rpi-config should not be performed, as this could potentially break the Berryboot system.

In fact it does, I tried and had to prepare my SD card for Berryboot again.

NOOBS

A number of different operating systems, selectable from a menu as required. The operating systems may be configured on a flash drive if desired.

Project Maker Boards

Project Maker Boards may be added for different purposes, these may be configured to give for example:

  • More Power Rails, 3V, 5V, 12V
  • Different Breadboard configurations
  • Combine with an Arduino or ATmega/ATtiny type project
  • Joystick and game buttons for a Game Arcade

Add lights to the inside of the cabinet

  • 5050 led strips on the 12V rail, controlled by a Raspberry Pi or by an ATmega328 or ATtiny85.

Use the 5V Standby line

  • Use an ATmega328 to remotely turn the system on or off
  • Place the Master Raspberry Pi on the Standby line, then use the network or nRF24L01 to signal the system to boot up or shutdown

Sound

  • Take the sound output to an amplifier. Build a small sound system within the cabinet that could be used as stand alone Media Center.

Network Connection

Connect the Slave-Pi unit to the Master-Pi unit using an Ethernet cable, then share the WiFi connection of the Master-Pi unit with the Slave-Pi unit.

Conclusions

This project was more involved than I initially expected.

I enjoyed the build for the wood cabinet, it could have been better planned, however I was very pleased with the final product.

The hard drive addition was an after thought, the project had progressed too far for it to be included tidily. However the use of a flash drive is a reasonable compromise. The storage capacity of 64GB should be more than adequate for most purposes.

The operating system setup was extremely informative, but took a lot of effort and research. I did not realize initially just how inadequate the swap space for the default installation really is.

Sharing the WiFi caused considerable problems. I found this part of the build extremely difficult. For my own purposes the use of two WiFi dongles and static IP set by my router was the easier option. Removal of dhcpcd5 simplified a lot of the process. However I feel that further research should be taken to learn how to work with and use the configuration files.

The nRF24L01 libraries have changed quite significantly even from my last project. These required some effort to achieve satisfactory installation.

I experienced no problems using Raspbian Jessie with the Raspberry Pi B+ and the Optimized nRF24L01+ Libraries this time around. All worked without issue.