Skip navigation

Raspberry Pi Projects

5 Posts authored by: pettitda

Last time I had determined that the long ribbon cable was too long to fit into the box.  So, I ordered a GPIO header with longer pins for the sense hat and a smaller ribbon cable with a 40 pin connector on one end and a 26 pin header on the other to plug into the PermaProto board.


In order to make more room for the board and the connector stack, I removed the three screw terminal connector where I had planned to connect the wires from the Fog machine remote. 

 

2015-11-14 10.38.02.jpg

 

Using double sided tape, I secured the PermaProto to the bottom of the enclosure.  Then I secured the AC relay to the side wall near where the Fog machine cable will enter the box.

 

2015-11-14 10.49.08.jpg

 

Next, I installed the fog machine cable and wired up the relay board to it.  I secured the relay board to the opposite side wall of the enclosure from the AC relay with more double sided tape.

 

2015-11-15 07.47.19.jpg

 

I installed the neopixel ring on the outside of the box and used hot glue to secure the ring in place.

 

2015-11-15 08.12.28.jpg

 

Then I wired the neopixel wires to the three screw terminal connector.

 

2015-11-15 08.16.13.jpg

 

Next, I drilled holes in the enclosure top and secured the Raspberry Pi to it using 4-40 machine screws and nuts.

 

2015-11-15 08.37.15.jpg

 

You'll notice that one screw hole was a little off, so I was only able to install three of the screws.

 

2015-11-15 08.40.14.jpg

 

I installed the new GPIO header on the sense-hat and plugged it into the Raspberry Pi, then plugged the new ribbon cable onto the pins which extended through the sense-hat board.

 

2015-11-15 08.43.58.jpg

 

I closed everything up and tried to connect to the Pi from my laptop.  Then I realized the WiPi was not installed.  So, I had to cut a hole in the side wall of the enclosure for the WiPi to stick through. 

 

2015-11-15 10.10.04.jpg

 

I made the hole where the fog machine cable enters the box slightly larger so that I could run the Pi power cable and the speaker cable through the same hole.

 

2015-11-15 10.32.49.jpg

 

Now, the Foginator 2000 is assembled and ready to test.  At this point I know all of the parts work because I've tested them individually.  Since the audio amplifier board that I built is dead (the main IC is dead), I decided to use an old amplified speaker from a PC.  All in all, it looks pretty good. 

 

2015-11-15 10.39.25.jpg

 

However when I tested it, I found that when the PWM is running there is a bunch of noise on the audio line.  I thought this might be due to the neo-pixel supply voltage being fed from the Raspberry Pi.  So, I disconnected it and ran the neo-pixel ring and the voltage translator chip off of a separate power supply.  Unfortunately, that had no effect.  Looking at the PWM signal on a oscilloscope, I noticed that there's lots of ringing on the edges.  Even with the Raspberry Pi disconnected from the rest of the box, the noise still rides on the audio when the PWM is active.  I did a little research and it looks like there's a strength setting on the GPIO outputs on the Raspberry Pi.  So, maybe if I lower the strength, that will reduce the ringing.  I will write more once I figure out how to do that.

 

Other than, that everything appears to work.  The fog machine switches on when the relay closes and puts out three seconds worth of fog.  When the PWM is not running the audio is crisp and clear and plenty loud.  The PIR sensor senses motion through the hole in the side wall just fine and when the speaker is turned off, the neo-pixel displays a rotating rainbow when the PWM is turned on.  So, I am really close to having a working system.  All I need to do is merge all of the code together and I'll be set for next Halloween ;-). 

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...


 

As I went about thinking on how to assemble the circuitry together to make a presentable project, I wasn't too happy with the idea of using the extended pin header for attaching the sensor board.  However, I found that the GPIO connector on the Pi will happily take an old computer disk cable.  Luckily, I had one of these hanging around. 

 

2015-10-30 11.34.52.jpg

The only gotcha with this technique is that the connector rows end up swapped around if you connect the sensor board with the connector mounted as it comes originally.  However, apparently the creators thought of this.  The connector that comes with the sensor board can be turned around and installed on the top side of the board without any soldering!  In this case, the pins make the right connections with a simple male-male pin header like the one seen off to the right in the picture above.

2015-10-30 15.23.40.jpg

To make things organized and presentable, I decided to use an Adafruit PermaProto board for the original Raspberry Pi that I had laying around.  It doesn't allow for connecting any of the higher numbered pins, but luckily all I need are included.

2015-10-30 12.21.39.jpg

Working with what I had at hand, I installed the left over single row male pin header to cover the needed pins.  To make things foolproof, I soldered the PIR sensor onto the proto board with the idea of drilling a hole in the side of the enclosure to allow the PIR to peak through.  To make things fit in the desired enclosure, I cut a few rows off one end of the proto board.

image1.jpg

I installed a screw-down type connector on the proto board to handle the connections with the fog machine remote control and added wire to connect the PIR sensor to the Raspberry Pi header.

image2.jpg

Finally, I soldered on the relay board that I built before.  At this point I'm wishing I had just waited and installed the relay directly on the main proto board.  However, I might as well go with what I have already. 

2015-10-30 15.08.38.jpg

In the next installment, I will finish up the build of the Foginator 2000. 

As I read through Charles Gantt's blogs on the Foginator 2000, I saw that he used an off the shelf relay board to switch the fogger on and off.  However, I didn't want to spend the money when I could just as easily create my own relay board.  So, I sketched up the following schematic.  The inputs on the left go to the Raspberry Pi board and the outputs at the top go to the fog machine's remote control.

schemeit-project-2.png

I pulled the following parts from Seeed Studio's Arduino Starter Kit to build the board.  The perf-board was purchased separately.

 

 

Part
Manufacturer
Manufacturer's Part Number
R1VariousVarious
Q1On SemiP2N2222A
D1Diodes Inc1N4001
RY1Tianbo

HJR-4102E-L-05V

Perf-boardRadio ShackN/A

 

I assembled the circuit on the perf-board, using the extra component lead lengths to connect the parts together.  Then I added wires to connect up to the Raspberry Pi.  Using Charles' python code and a PIR sensor from Radio Shack, I was able to successfully switch the relay upon motion.  Here's a close-up of the completed board and a picture of the test setup. 

 

2015-10-24 17.54.20.jpg2015-10-24 17.53.53.jpg

Now, I have a relay board of my own creation that I can re-use in future projects when needed!

While I'm waiting for some parts to arrive, I decided to build the amplifier board that was supplied with the parts kit.  Here's what came in the kit:

 

2015-10-22 20.01.18.jpg

Step 1 of the build was to install the resistor:

 

2015-10-22 20.05.45.jpg

Step 2 was to install the diode:

 

2015-10-22 20.08.32.jpg

Step 3 was to install the slider switch:

 

2015-10-22 20.10.01.jpg

Step 4 was to install the ceramic capacitors:

 

2015-10-22 20.16.38.jpg

Step 5 was to install the speaker and power connectors:

 

2015-10-22 20.21.11.jpg

Step 6 was to install the audio connector:

 

2015-10-22 20.22.53.jpg

Step 7 was to install the 100uF electrolytic cap:

 

2015-10-22 20.25.12.jpg

Step 8 was to install the LED:

 

2015-10-22 20.31.32.jpg

Step 9 was to install the integrated circuit:

 

2015-10-22 20.36.25.jpg

Step 10 was to install the 1000uF electrolytic caps:

 

2015-10-22 20.41.12.jpg

Step 11 was to install the potentiometer:

 

2015-10-22 20.43.25.jpg

Here's the finished board:

 

2015-10-22 20.43.59.jpg

And here's the tools that I used to build the board:

 

2015-10-22 20.45.44.jpg

 

Thanks to Element 14 for the chance to participate in this build-a-long!

Filter Blog

By date: By tag: