I finished up my last blog post by installing the relay board on my PermaProto board.
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.
Here's what it looks like with the connectors added.
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!
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).
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:
Then I ran the test program
> sudo ./test
and viola! It works!
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.
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).
I decided to use double sided tape to mount it inside the enclosure.
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.
Here's a schematic of what this circuit looks like (Don't try this yourself unless you have training in handling high voltages):
Next, I drilled a hole in the side of the enclosure to allow the PIR sensor to "see" the outside world.
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.
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.
I like the way things are looking.
However, when I went to add in the RPi/Sense-Hat/cable, there just wasn't enough room.
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...