I finished up my last blog post by installing the relay board on my PermaProto board.

2015-11-07 14.11.58.jpg

 

Next, I needed to assemble the level shifter board.  I say assemble, but all that's required is to solder the single row headers to the board.

 

2015-11-03 21.39.04.jpg

 

Here's what it looks like with the connectors added.

 

2015-11-03 21.49.55.jpg

 

I went ahead and soldered the level shifter board on to the PermaProto.  If I were thinking ahead I wouldn't have placed it so close to the connector.  I would later find that my cable no longer fit on the board and I would need to order a different cable.  Planning in a hobby project is just as important as it is in a work project!

 

2015-11-07 15.14.51.jpg

 

I really wanted to get the neo-pixels working with the RPi 2.  It didn't seem like it should be that hard.  So, I wired up the neo-pixel ring with wires to connect to my Raspberry Pi (through the level shifter). 

 

2015-11-03 22.07.21.jpg

 

I downloaded the Raspberry Pi 2 branch of Jeremy Garff's rpi_ws2811 library. 


>git clone https://github.com/jgarff/rpi_ws281x.git

>git pull https://github.com/jgarff/rpi_ws281x.git rpi2


I compiled the code:


>sudo scons


Then I ran the test program


> sudo ./test


and viola!  It works!

 

2015-11-07 16.37.30.jpg

 

Next, I began to prepare the enclosure I purchased for this project.  The provided enclosure was too small because I wanted the RPi to be inside the box.  I cut a notch in one end of the enclosure to fit the over-molded cable that was originally in the fog machine remote.  I crimped solder-less lugs on the cable's wires in order to connect up to an AC relay coil.  Then I soldered on an extra wire to go to the relay board's contacts for switching the fog machine on and off.

 

2015-11-07 19.07.53.jpg

 

I purchased a relay with an AC coil that I could use with my fog machine (since it uses AC to light the indicator lamp). 

 

2015-11-07 19.12.47.jpg

 

I decided to use double sided tape to mount it inside the enclosure. 


2015-11-07 19.13.06.jpg

 

Then I added a 10k Ohm pull-up resistor to 3.3V on the PermaProto board.  This will allow me to use the relay to switch a GPIO input on the RPi.

 

2015-11-07 20.09.12.jpg

 

Here's a schematic of what this circuit looks like (Don't try this yourself unless you have training in handling high voltages):


relay-to-GPIO.png

 

Next, I drilled a hole in the side of the enclosure to allow the PIR sensor to "see" the outside world.

 

2015-11-07 20.41.16.jpg

 

I thought it would be cool if the neo-pixel ring surrounded the opening for the PIR sensor.  So, I drilled holes on each side of the opening to run the wires.

 

2015-11-07 20.50.00.jpg

 

I tested the fit of the PermaProto in the enclosure.  Everything was looking good at this point.  You'll notice here that I added wires with solder-less lugs to connect to the AC relay contacts.

 

2015-11-07 20.51.32.jpg

 

I like the way things are looking.

 

2015-11-07 20.51.46.jpg

 

However, when I went to add in the RPi/Sense-Hat/cable, there just wasn't enough room. 

 

2015-11-07 21.25.56.jpg

 

At this point I've decided to go back to the idea of using the header with extra long pins to connect the sense-hat to the raspberry pi.  I ordered the connector plus a cable which "down-grades" the 40 pin RPi 2 connector to the original 26 pins.  Hopefully, I will be able to connect this cable on top of the sense-hat to run over to the PermaProto.  So, now I'm waiting for parts, again...