Skip navigation

Raspberry Pi Projects

15 Posts authored by: Cabe Atwell

See Part 1 of the project here.

See Part 2 of the project here.

See Part 3 of the project here.

 

 

 

The Wireless Charging and Portable Raspberry Pi for under $10 dollars – in all its glory.

It charges.

It’s portable.

It ain’t pretty…

 

The concept works. But, technically it was sorted out in 2009 when the first Palm Pre came out. I, in fact, had a Palm Pre back then. Since then, Palm and WebOS has ingrained itself into me like the love of a childhood cartoon show. For all its flaws, you love it like nothing else.

It isn’t surprising I immediately went to the old Palm phones immediately when I started this project. (Fun fact: I started this project 3 years ago! It’s been on the back burned for a long time.)

 

This was a short build, despite the 3 year gap in development. I originally was going to make a wireless and portable Pi B+. Then it was a 2. Now a 3.

Luckily, power demands and mounting footprints stayed the same.

 

Although wireless charging, inductive charging technology has advanced a bit more since the palm days, I found the prices of such “Qi” charger kits to be a little high for my taste. But, since Palm/webOS phones are nearly gone… I figured it was the perfect time to pick up a bunch of the accessories.

 

In the end, I have what I wanted. It can stay off the charger for around 1hr with the single Palm Pre/Pixi battery. It charges and stays on and useable at all times. Super-happy success!

 

Here is what I bought for this project:

1 Palm external battery charger with extra battery

1 Palm Pixi Inductive charging back cover

1 Palm Touchstone wireless charger base kit

I bought all 3, with more accessories, as a group on eBay for $5.00 with free shipping.

Sources I used were Amazon and eBay. I also bought a HP Pre 3, the last webOS phone, just for fun. I am currently using it on the service “Ting.”

 

1 surface mount relay (pulled from electronic surplus)

1 Voltage boost regulator (Bought in a pack of 10, so $2 each)

Bits of breadboard (surplus)

Project wire (surplus)

Raspberry Pi 3

Adafruit GPIO 2.8” Touchscreen

3D printed parts (Printed on my printer for cents in material)

 

So… to add wireless charging and portability to a Raspberry Pi with a touchscreen… was below $10.

I win! Yay! …

But no one is keeping score…. Hmm

 

Problems I experienced in the build:

  1. I didn’t quite realize the size of some of the components I used. The breadboard (pieces) in particular were very large and made fitting all together look terrible.
  2. Likewise, the project wire I used were not able to be tucked, neatly, into the housing. So, wires spill out everywhere.
  3. Ultimately, the screen I used was way too small to do anything with it. Using a 5” screen would be way nicer.
  4. Using a cellphone battery is a big issue. On a lot of batteries there are 3, 4 or more contacts. They aren’t simple +5V and GND. No, some are thermal sensor contacts, among other uses. In this case, I had 3 contacts. The 3rd contact is a for a thermistor for internal battery temperature sensing. To charge the battery, and use it for power, I had to “trick” the battery into working. When the system in placed on the Palm Touchstone charger base, the relay is powered… connecting the thermal sensor contact to the battery’s negative. This was the BRUTE FORCE way I chose to make the battery charge when it was on the base. When you take it off, the relay would turn off, it would disconnect the thermal contact. Which was the only way I could force the battery to supply power to the Pi when off the base. If I left the thermal and battery neg connected, the battery wouldn’t supply power to the Pi when off the charger base, in other words.
  5. The battery charger needed 5V to charge. But then, it would only output the typical Lithium 3.7V to the Pi. I added the voltage boost circuit to then bump up the 3.V back to 5V. I either need to boost or buck a voltage no matter what I did. I just found it annoying, to be honest. The Pi should have a voltage regulator onboard, in my opinion. Take any voltage and use it.

 

If I continue to refine this project:

  1. Taking all the additional components and make a small PCB for them.
  2. Use modern wireless charger components. Which would affect the first refinement. With this, a much larger battery. The Palm Pre was 1125mAh, I would make the new one close to 5000mAh.
  3. Use a bigger screen, and in turn, a larger 3D printed case.

 

 

Wireless Pi Schematic.PNG

Schematic, block, diagram.

 

wireless portable pi parts.jpg

All the parts used in the project's build. Note: I soldered the power pins to the bottom of the Raspberry Pi GPIO. Why? The screen was covering up the pins.

 

wireless portable pi working.jpg

One of the first tests. The Raspberry Pi is on and booted to the OS. The whole system is running off the battery.

 

wireless portable pi stacked up.jpg

The whole Wireless&Portable Raspberry Pi, charging, on the base. Yikes... that is one ugly mess. But it works!

 

 

See more of my project here:

Drinkmotizer, drink mixing robot

Project Goldie, my favorite - I animated the opening!

Pi Ball, a spherical and interactive Raspberry Pi case

Scary Door, Halloween #1

Scary Porch, Halloween #2

New Years’ Eve Countdown timer and Fireworks launcher

Raspberry Pi Arcade

See Part 1 of the project here.

See Part 2 of the project here.

 

I received the 3D printed parts. I used good'old Shapeways to handle that!.

 

However, I had to drill and tap the mount holes for the Pi. It all fit together perfectly.

 

pi top orange.jpg

 

In the effort of portability, I am using one of the Pi TFT touchscreens

 

I used 2.5mm caphead bolts for mounting all parts. They fit perfectly into the mount positions.

 

Next update should be the final product!

 

Cabe

See Part 1 of the project here.

 

I think I have narrowed down how I will achieve my goal of wireless charging, I will use old cell phone tech. But why you ask? Why with all the Qi standard devices. PRICE!

 

I am going to add to my requirements list:

My requirements:

- I want something small and with a screen.

- Wireless charging, while it's on or off.

- A case to mount it all in.

- MUST COST LESS THAN $10

 

My addition to the requirements list comes from obvious reasons, I have no budget. But, in adversity and strife, that is when engineers truly shine. We find answers to the toughest questions. At least, that is what I hope to find.

 

 

To adapt the Pi3 to whatever tech I use, I set out to design a mount for all the parts.

 

Here is what I came up with:

cabe atwell wireless pi3 mount.JPG

The top model is the Raspberry Pi. The second model is the where the Pi mounts. I designed it with stand-offs for both modern Pi mount holes and the original models of the Pi.

Though, I doubt I will ever use the original models for this project. Slots in the second plant are for passing wires through. I assume that will be enough.

And, the stand-offs will be threaded for standard M2.5mm bolts.

The third, or bottom, plate is where I plan to house all support and wireless charging components.

 

I drew the models in Solidworks, if anyone was wondering. Besides being the most engineery thing to do, I also wanted to export 3D models for... 3D printing.

 

What's next?

3D print some parts. Find cheapest solution for the support parts.

 

Cabe

http://twitter.com/Cabe_Atwell

I have a Raspberry Pi 3, doing nothing right now... (Well, to be honest, I have every edition Pi laying around, doing nothing.)

 

However, not all my Pi boards have been doing nothing... here are some of my previous projects:

Drinkmotizer, drink mixing robot

Project Goldie, my favorite - I animated the opening!

Pi Ball, a spherical and interactive Raspberry Pi case

Scary Door, Halloween #1

Scary Porch, Halloween #2

New Years’ Eve Countdown timer and Fireworks launcher

Raspberry Pi Arcade

 

For the Raspberry Pi 3, I want to start with one of my back burner projects. A portable and wireless Raspberry Pi.

 

My requirements:

- I want something small and with a screen.

- Wireless charging, while it's on or off.

- A case to mount it all in.

 

It occurred to me that for decades now, phones have done all this. So, why not a Raspberry Pi?

 

I took inventory of some of my components laying around and drew up a possible design for the Portable&Wireless Pi (PWP, from now on).

The PWP drawing is taken from one of my project notebooks. I will explain what everything means in the drawing... trust me, it (probably) works.

 

s20160719_230607.jpg

What does this scribble mean!?!? Find out in the next post...

 

Cabe

http://twitter.com/Cabe_Atwell

Disclaimer: I’m an engineer, not a pro film maker. Be advised.

Disclaimer: I’m an engineer, not a pro film maker. Be advised.


Raspberry Pi cases are all the rage. Everyone makes blocky cases, wood cases, cases shaped like computers or arcade cabinets. I wanted a case that could interact with the physical space around it-- why not put a Raspberry Pi 2 in a ball?

 

Here are just a few things I can do now--


  • bowl with it
  • wirelessly connect to the Internet
  • draw in 3D space with motion tracing
  • automated bounce counting


Meet the Pi Ball!

 

Here were my requirements

- Use a Pi (Raspberry Pi 2 in the case)

- Spherical case, that can be bounced, kicked, thrown

- Accelerometer onboard to monitor the motion of the ball

- Wireless everything! Wireless keyboard/mouse, networking, sound and video

 

   pi ball glow and running.png

   (Pi Ball in on! LEDs on! Wirelessly connected to the screen in the background - running the accelerometer tracking program.)

 

Project by sections

 

The Pi Ball enclosure:


The Pi Ball spherical enclosure consists of three pieces. Two hemisphere and the mounting plate attached in the middle.

   pi ball 3d model.JPG

   (The 3D model of my concept. I used Solidworks 2013.)

 

I wanted a smooth external appearance. No screws/bolts holding it together.


   pi and enclosure pi ball.png

   (Here is the freshly printed enclosure components. A Pi 2 place on the mount plate for scale.)


   pi ball parts layout.png

   (Pi Ball parts layout. Had to stuff all that inside the enclosure!)

 

When the hemisphere lock together, they wedge the mounting plate in the middle. The hemispheres are made of “elasto-plastic” from Shapeways, and the mount plate is regular ridged ABS. The Elasto-plastic shells were quite bouncy – when empty. However, with all the components inside, the high bounce was gone.


   mount plate and pi2.png

   (The mount plate, Pi 2 attached using four M2.5 cap head bolts)

 

The middle mount plate has slots for passing wires and such, and the Pi is attached to the plate via standoffs printed on the surface. Those standoffs were tapped for M2.5 bolts.


   pi ball cable routing.png

   (Pi Ball, early Raspberry Pi 2 mount and wire routing.)

 

 

 

Wireless devices:


Making everything wireless turned out to be very easy with today’s tech. Wireless keyboard and mouse adapter was a single low profile USB transceiver. The WIFI adapter was exactly the same. The wireless HDMI comes via a Nyrius AERIES 1080p transmitter. (The HDMI receiver is attached to the screen. The one I used had a 165 foot line-of-sight range. But, I found that I could get about 90-100 feet without issue.)


   pi2 inside.png


To stay wireless, the devices need power. I used two onboard battery packs – for two different, but critical reasons.


ONE – The HDMI adapter needed 5V@ 1.5A, so to take the strain off the main battery I found a small 2200mAh external battery. Tool the enclosure off of it, and placed it on top. The Pi and the LEDs shared a 8400mAh external battery supplying 5V@ 2A.


TWO – The two separate batteries created a better balance inside the sphere. So, it rolled more like a ball than an egg.


   pi ball stack of parts.png

   (Almost everything attached to the mount plate. Pi2 on top with the HDMI transmitter and 2200mAh battery (not shown). Bottom has the 8400mAh battery, USB hub, and accelerometer (not shown) )


   neo pixel pi ball test.png

   (NeoPixels on, via their own power source.)


The Adafruit NeoPixel LED strip needed to source more power than the Pi 2 could supply. So, I connected them to their own USB cable connected to the 8400mAh battery directly. Only the signal life from the NeoPixels connected to the Pi 2 (pin 12 to be exact)

 

   closing up the pi ball.png

   (About to close up the Pi Ball...)

 

   pi ball on deck running.png

   (Pi Ball is on... running the accelerometer sensor program - wirelessly connected to that LG TV.)

 

 

Battery life:


    pi ball 2200mah batt.png

   (The 2200mAh battery removed from its red case. This way it was much smaller to put on top of the HDMI adapter.)


The HDMI adapter on the 2200mAh battery was what gave out first. It lasted 3 hours of constant streaming. I could have easily doubled that with another 2200mAh battery, there was room.


   anker 8400 strapped to back pi ball.png
   (Anker 8400mAh battery strapped to the back on the mount plate. An early step in the build.)


For the Pi 2 itself. the 8400mAh battery lasted about 12 hours of intermittent use. But, after 3 hours I did not have video output. That may have extended the life.

 

 

Software (all in Python):

Aside from running the full OS, where one could do regular computer work, tinkering, etc.. I had two specific Pi Ball applications.


- An on screen representation of the Pi Ball’s location and movement in an isometric representation on 3D space. It looks like a fading comet trail. I also put in a mode to trace the movement. My idea was for someone to hold the ball and draw in 3D. However, it only partially worked. I need to change it to take more samples.


- I also had a mode to count the # of impacts detected, like bouncing.


- The second feature was turning on LEDs inside the ball. The main feature was to react to the accelerometer data, and turn on, flash or chaser effects on one of those Adafruit Neopixel LED strips. This worked spotty at best. But, when it worked, it did what I wanted.

(I have an always on, always off, a constantly flashing/chasing, and accelerometer effected modes.)



The difficulties


- All the USB cables used inside the Pi Ball had copious amounts of rubber/plastic on the connector ends. I used a knife and shaved off the excess to make them more flexible and smaller.


   shave.png

    (Here is an example of cutting off wire thickness. This is the shaved HDMI cable. I also took some of the rubber shielding on the length to make it more flexible.)


- Fitting everything into the Spherical case. Perhaps if I make a version 2, I will up the size from 6” diameter to something like 8 or 10”. That way I could pack in more sensors and effects.


- Getting the Neopixels to work. Sometimes they would flash random colors or effects. They are  dependent on the frequency output of the Pi. I stuck with a white only color to just get it to work.


 

Schematic and Design

The only true schematic, is the accelerometer connection. See below:

 

accel adxl335_wiring.png

 

Everything else is just standards. IE, plug in mouse/keyboard to the USB port, etc

 

 

Code

(See attached to the post)

 

 

BOM

 

   

QuantityPriceVendorPart #Description
1$35$35element1468X0156Raspberry Pi 2
1$37.00$37.00element1445P6651ADXL335 accelerometer and parts kits
1$2.19$2.19element1419C7200ANALOG TO DIGITAL CONVERTER ADC
1$0.12$0.12element1498K49951N4001 diode
1$220.00$220.00ShapewaysNA3D printed components
1$48.00$48.00AmazonNALogitech wireless keyboard and mouse
1$8.00$8.00AmazonNAWiFi adapter (generic)
1$200-400(new)$200.00AmazonNANyrius wireless HDMI adapter (Pro model)
1$25.00$25.00Adafruit1461NeoPixel 60 LED strip
1$4.49$4.49AmazonNAJgmax 2200mAh external battery
1$19.00$19.00AmazonNAAnker 8400mAh external battery
TOTAL$598.80

 

Other uses of the system


Aside from having a completly wireless Raspberry Pi 2 system, the Pi Ball could be used for any number of applications - Imagination is the limit.

 

- In its current form, it can be used for motion tracking.

- I have a mode that lets the user draw in 3D space, tracing the motion.

- Count the number of bounces.

- Any number of light based effects.

- Roll it in, let the fun begin! Use your imagination...

 

When I have more time, money, or people really like the Pi Ball

- Source cheaper components. For instance, the accelerometer. The Wireless HDMI adapter could be bought elsewhere. The 3D printing could happen in house.

- Make a new version with more internal hooks. I designed in only 4 attachment points between the two hemispheres. I would want to increase that to at least 6.

- Better battery design and mounting.

- Bouncier all around. I want to bounce it like a basketball, personally.

- More software and code to use the ball to the utmost.

3DRacers race in progress (via Marco D'Alia & indigogo)

 

If you’re a fan of video racing games, such as the all-time favorite Mario Kart, you may freak for 3DRacers. The company takes competitive racing from the screen to your living room floor through 3D printing, microcontrollers and your smartphone.

 

The new concept allows users to make their own 3D-printed cars that can be controlled via Bluetooth through their phones and then race with friends on carpet or an optional race track. The cars can be designed online by customizing one of 100,000-plus designs available online, including a Delorean, Monster Truck and Dune Buggy. Users familiar with 3D-printing software can also create their own car designs from scratch using the company’s open-source template.

 

toycar2.jpg

3DRacers’ Delorean car prototype (via Marco D'Alia & indigogo)

 

Once the design is printed (which can be done at home or through the company’s partner store, 3D Hubs), it’s time to build. The cars are powered by open-sourced Arduino-based circuit boards, ATMEGA3244 microcontroller and 3.3V regulator. It is also programmable via USB connectivity. The board equips the car with RGB LED lighting, two motors, three servomechanisms, infrared capability and a detector that knows when its at the starting and finish lines. It runs on a rechargeable lipo battery (rechargeable via USB) and can race for 30 minutes per charge.

 

toycar3.jpg

3DRacers PVC Mat (via Marco D'Alia & indigogo)

 

Once the car is built, the only thing left to do is race! 3DRacers claims the cars will drive on any surface, but a custom 4x8.5ft PVC racing mat can be purchased for an authentic racing feel. The track includes papercraft models, such as trees and oil barrels, to simulate 3D structures that would be found on an authentic racing arena. Users can control their cars with a 3D-printed remote or from their smartphones using the compatible iOS and Android app.

 

toycar4.jpg

3DRacers car prototypes and iOS app interface (via Marco D'Alia & indigogo)

 

As far as racing logistics go, 3DRacers says up to 1,000 players can race at once, and the app recognizes various racing games. The technology with automatically keep tabs on laps and the scoreboard, and also simulates professional racing, in that drivers can stop for pit stops and practice with warm-ups. If road rage is your thing, however, you can play in battle mode, when you gain points by destroying your opponent’s car (virtually). This mode also features a turbo option and power-ups that include virtual weapons. Move over Mario Kart.

 

3DRacers will be coming to a 3D printer near you, as it’s Indiegogo campaign was fully funded. There is still a full week left in its campaign, so if you’re looking to be one of the first to take your custom car for a test spin, or if you want a break on the price, order now. The bare bones kit, which gives you everything you need to design and print your car at home, is on early bird special for $39. If you want the racetrack mat, that’ll set you back another $129, not including the pilot board and other important parts. The first batch of Beta boards are set to ship by May.

 

C

See more news at:

http://twitter.com/Cabe_Atwell

Pi2ModB1GB_-comp-500x283.jpeg

This is the Raspberry Pi 2, which I used to calculate pi against other Pis. (Image via Raspberry Pi)


I received a Raspberry Pi 2, and immediately wanted to see how much of an improvement it was. Games seem smoother, especially first person shooters. Arcade emulation is buttery as well, however perceived speed wasn’t scientific enough for me so I decided it would be apt to calculate Pi, on the Pi.

 

To start with, I installed the Command Line Calculator, called BC

 

Easy to install… type at the command prompt:  sudo apt-get install bc

 

To calculate pi, I used the command line formula:  time echo "scale=2015; 4*a(1)" | bc -l

 

Scale is the number of decimal places to calculate. The a() portion is the Arc Tangent function. Obviously, the bc part is the bc utility.

 

The results for the three Pi models (original B, B+, and Pi 2), at stock clock frequency, were as follows (results in seconds):

 

Model B

Real  0m24.996s

User 0m24.660s

Sys 0m0.260s

 

Model B+

Real  0m24.940s

User 0m24.620s

Sys 0m0.250s

 

Pi 2

Real  0m15.575s

User 0m15.470s

Sys 0m0.090s

 

The model B and B+ results were the same, which isn’t surprising since the boards are almost identical. Unsurprisingly, added RAM has no influence on this simple calculation. Also, I ran the calculation several times and found the results varied, which was surprising.

 

The Pi2 had a 62% improvement in time over its predecessors. As it turns out, that the bc calculation was a single thread operation, and only one core is used, however the Pi2 beat it predecessors by 9.085 seconds with 3 cores tied behind its back.

 

I could extrapolate that if the load was shared across the cores, the Pi2 could calculate Pi in 3.8938 seconds. Which is about 155% improvement over the original Pi models. However, that is just a hypothesis.

 

To discover more about taxing all the cores in a benchmark, I discovered the following benchmark results.

 

Looking at the MP-MFLOPS

 

Using Roy Longbottom’s Android multithreading benchmark MP-MFLOPS, it’s clear that the Pi2 is noticeably faster, especially when it’s overclocked to the maximum @ 1,000MHz. Of course, this is with using all 4 cores of the ARM Cortex-A7 running 8 threads (2 Hyperthreads per-core) running 2 operations per-word and 32 respectively. The benchmark for the old RPi (single-core running @ 700MHz) achieved 43 MFLOPS @ 12.8 loops running 2 Ops/Word and 191 MFLOPS @ 12.8 loops running 32 Ops/Word respectively.

 

You will no doubt notice the difference in speed with the Pi2 and the use of all 4 of its cores utilizing 8 threads (higher numbers are better). The Pi2 clocked @ 900MHz came in with 494 MFLOPS @ 12.8 loops running 2 Ops/Word and 1581 @ 12.8 loops running 32 Ops/Word respectively. Crank the processor up to 1000MHz ups those numbers to 543 and 1588 @12.8 loops, making it considerably faster over the original Pi.

 

On 2 Ops/Word, the Pi2 (all 4 cores) is 1148% faster than the original. At 32 Ops/Word, the Pi2 (all cores) was approximately 83% faster and the original Pi B.

 

pi bench.JPGpi2 bench.JPG

Benchmarking the MFLOPS (via Roylongbottom)

 

MP-MFLOPS isn’t the only benchmarking tool that can be had for the Pi2 platform as Raspberry Pi blog user Dan Robinson benched the new board against the B+ using the SunSpider JavaScript tool to clock his speed. The app suite from Webkit runs JavaScript to measure real-world performance such as encryption and text manipulation, making it ideal for measuring the performance for web browsers as well as the Pi2. After benchmarking his board using SunSpider, Dan’s results were interesting to say the least with 4452.1ms for the Pi2 and a shocking 23692.7ms for the B+ (lower numbers are better). To put that into perspective, another blog user Martin O’Hanlon makes it easy to understand those differences sating ‘Minecraft server on a Pi1 = adequate, Minecraft server on a Pi2 = awesome’.

 

octane.png

Google’s Octane 2.0 is just one of the few tools that users can use to benchmark the Pi2.

 


Another benchmark I found was was about video transcoding, done by Andrew Oakley on Raspberrypi.org. His results:

Transcoding Skinny Puppy’s “Pro-Test”, 360×270 Quicktime .MOV, 256kbps MP3, to same resolution MP4 at CRF 26, 96kbps, using avconv:

Raspberry Pi 1 (1x 700MHz ARMv6, 512MB RAM, Raspbian Wheezy): Average 1 frame per second. 18 mins to complete.

Raspberry Pi 2 (4x 900MHz ARMv7, 1GB RAM, Raspbian Wheezy): 28 FPS, 4 min 9 secs to complete –

Intel Celeron dual-core (2x 2.5GHz 686, 2GB RAM, Ubuntu Precise): 114 FPS, 1 min 3 secs

 

You can see the Pi 2 is getting results close to desktop processors. There are plenty of other benchmark tools on the internet that can be used to measure the performance of the Pi2, including Nbench, Google Octane and Unixbench as well as a host of others. After looking at some of those it becomes quite clear that the Raspberry Pi 2 is more of a desktop PC than a mere development board, which is certainly the case when it comes to the performance of the original Pi and even the B+.

 

C

See more news at:

http://twitter.com/Cabe_Atwell

The Internet of Things (IoT) is an expected feature for any new product coming out. But, I’ve noticed that the IoT systems out there are all quite specific. Health monitoring, home control, kitchen appliance… each focusing on their little worlds. But, what if you want to monitor when a mouse trap snaps, the mailbox opens, or someone moved your lunch in the fridge at work? That is where my general purpose IoT system comes into play. Which I will call the PiioT (Pi + IoT) for the remainder of this post. (I do dislike tongue-in-cheek names though… but moving on. ) So, dust off that old Raspberry Pi Model B.

 

I made it simple… it looks for a logic signal trip, like a switch. When it receives the signal, it sends out an email. Maybe one day you hid a switch underneath your beverage in the fridge, the next day you are monitoring your file cabinet.

 

Of course, a circuit could be built to do any one function. Then it can be set to then send a logic signal to the PIoT. An example, a temperature sensor circuit is off monitoring a fish tank, let’s say, when a certain temp it reached, a logic signal is sent to the central server, the PiioT. All IoT related tasks are shuffled off to the Raspberry Pi, in other words.

 

I placed in one output pin as well. So, you can send an email to the system and it will set a pin high/low. This way you can daisy chain off of that with lights, a relay, a series of relays. Turning on a relay is the easiest way to turn on an AC powered device like lights, radio, sprinkler system, holiday decorations, coffee maker, etc.


 

Here were my requirements

- Use a Pi

- Several input pins. I used 6, but it could be set it up to use many more.

- Have an output pin

- Emails received and triggered by email.

 

Project by sections

Again, I made it simple. All you need is one Raspberry Pi.

- I used pins 19, 21, 22, 23, 24, 26 for inputs for switches or sensors.

I set the output on pin 7.


- The email address has to be configured for use. I made a gmail account for this project. I am only using it for the output pin, where I send it a command to turn on. Unfortunately, a recompile will be needed to set your own email.

 

- The system checks the email address set up for the output trigger. If there is a new one, it will trigger the output and then delete the email.


The difficulties

- Dealing with various ISPs was the biggest issue. Dynamic IPs didn’t quite work out. I had to use a static IP with an ISP that can handle ETRN. Which means Extended Turn, and extension of the SMTP mail delivery protocol. This allows one SMTP server to request from another SMTP server.


- Using one’s own email server system might be a better idea than with gmail.

 

Pics and system


Piiot B.jpg

Nothing in this picture is really necessary... just one Pi is all you need. I am just showing the system igniting a LED on the lower right after receiving an email trigger.


Schematic and Design

piot circuit B.JPG

Sticking with the general purpose angle of the project, I drafted this with generic inputs and outputs. Replace as seen fit...

 

Code

(Full code attached to this page)

//###########################

//##### OPERATION NOTES #####

//###########################

//

//

//----- PROGRAM SETTINGS -----

//    /settings.h has all of the programs settings in it.  To edit it from the command line:

//    Edit the file:

//        nano /home/pi/settings.h

//    Make the changes required then press CTRL+X to exit, pressing Y to confirm the save.

//    Build the application:

//        cd /home/pi/whatevername

//        make

//    Reboot the RPi to run the application again, or use this to run it from the command line:

//        sudo ./whatevername.a      (CTRL+C to forcibly close it again if needed after running in this way)

//

//

//----- SENDING EMAIL -----

//To change the mailbox email is received from edit this file:

//    nano /etc/ssmtp/ssmtp.conf

 

//Including these strings anywhere in an email (subject or body) sent to the RPi will cause the associated action

//STRINGS MUST BE LOWERCASE HERE but are not case sensitive when sending.

const char EMAIL_RX_SET_OUTPUT_HIGH_STRING[] =    {"set output high"};        //Sets the output high and enables monitoring of the input pins

const char EMAIL_RX_SET_OUTPUT_LOW_STRING[] =    {"set output low"};            //Sets the output low and enables monitoring of the input pins

 

//-------------------------------

//--------- Output pin ----------

//-------------------------------

#define OUR_OUTPUT_PIN(state)                    bcm2835_gpio_write(RPI_V2_GPIO_P1_07, state)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

const int output_pin_default_state =            1;            //0 = low, inputs not being monitored.  1 = high, inputs are being monitored.

 

//-------------------------------

//----- SEND EMAIL SETTINGS -----

//-------------------------------

//Note - these need to be C constant strings. You cannot include a quotation mark within these strings - use an html code instead.

 

#define    EMAIL_TX_INPUT_1_RECIPIENT                "fake@email.com"

#define    EMAIL_TX_INPUT_2_RECIPIENT                "fake@email.com"

#define    EMAIL_TX_INPUT_3_RECIPIENT                "fake@email.com"

#define    EMAIL_TX_INPUT_4_RECIPIENT                "fake@email.com"

#define    EMAIL_TX_INPUT_5_RECIPIENT                "fake@email.com"

#define    EMAIL_TX_INPUT_6_RECIPIENT                "fake@email.com"

 

#define    EMAIL_TX_INPUT_1_SUBJECT                "Email Alert for input 1"

#define    EMAIL_TX_INPUT_1_BODY                    "Input 1 was triggered"

 

#define    EMAIL_TX_INPUT_2_SUBJECT                "Email Alert for input 2"

#define    EMAIL_TX_INPUT_2_BODY                    "Input 2 was triggered"

 

#define    EMAIL_TX_INPUT_3_SUBJECT                "Email Alert for input 3"

#define    EMAIL_TX_INPUT_3_BODY                    "Input 3 was triggered"

 

#define    EMAIL_TX_INPUT_4_SUBJECT                "Email Alert for input 4"

#define    EMAIL_TX_INPUT_4_BODY                    "Input 4 was triggered"

 

#define    EMAIL_TX_INPUT_5_SUBJECT                "Email Alert for input 5"

#define    EMAIL_TX_INPUT_5_BODY                    "Input 5 was triggered"

 

#define    EMAIL_TX_INPUT_6_SUBJECT                "Email Alert for input 6"

#define    EMAIL_TX_INPUT_6_BODY                    "Input 6 was triggered"

 

//Input pins

//Pull any pin low to trigger the associated email being sent

#define SWITCH_1_INPUT                            bcm2835_gpio_lev(RPI_V2_GPIO_P1_19)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

#define SWITCH_2_INPUT                            bcm2835_gpio_lev(RPI_V2_GPIO_P1_21)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

#define SWITCH_3_INPUT                            bcm2835_gpio_lev(RPI_V2_GPIO_P1_22)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

#define SWITCH_4_INPUT                            bcm2835_gpio_lev(RPI_V2_GPIO_P1_23)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

#define SWITCH_5_INPUT                            bcm2835_gpio_lev(RPI_V2_GPIO_P1_24)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

#define SWITCH_6_INPUT                            bcm2835_gpio_lev(RPI_V2_GPIO_P1_26)        //If changing this ensure the initialise() port setup is also changed in ap-main.cpp

 

BOM

Just one Raspberry Pi B. Just $35 for a IoT controller is a decent price. This will work with every Pi version, even the A+.

What is connected to the inputs/output is up to the user.

 

 

Other uses of the system

- Imagination is the limit

 

Oddities and observations

- A Dynamic IP internet connection did not work. A static IP was the only way I could connect to the gmail server.

- The model B+ & A+ seem to have a different networking parameters.. so stick with the old model B or A for the time being.

Disclaimer: I’m an engineer, not a pro film maker. Be advised.

 

My goal... haunted house level effects for the front door, again! If you didn't see the "Scary Door" from 2013, go see it now!

 

I wanted to create the sense of stifling... to overwhelm the visitor with light and rumbling sound. I figured red light would give the most horror feel with the matched sounds.

 

I used a Raspberry Pi B+Raspberry Pi B+, not on purpose, but I am glad I did. The B+ has more IO, which I took advantage of. In fact, I used almost every single free IO on the board! I will admit, four of the pins I intended as additional outputs and effects, but never did use them. Technically, as many light as can be afforded could be used on those additional outputs with external relays.

 

Let's break it down...

 

Here were my requirements of the Scary Porch

  • Slowly brighten a series of red lights
  • Dim the porch light in opposite the red lights
  • Start a slow creepy sound at the start of the approach
  • When the visitor reaches the door, switch sounds to a more shocking track
  • When the visitor leaves, cut the sound, dim the lights as they leave
  • Have a big button for resetting the whole system at any point

 

 

Project by sections

 

- Lights

All the light I used are AC... So, if you build this yourself, be safe.

I bought an innocuous porch light from home depot... which still sells incandescent bulbs. I was shock, but happy I didn't have to amazon prime them to me. This is connected to a Sunrom 1298 AC dimmer circuit.

I did amazon prime some "sunlite" red flood lights. Six of them to be exact. the overwhelming effect of the light is really only present directly under the lights. These are connected to another Sunrom 1298 AC dimmer board. Don't worry, the dimmer board can handle 12A of 120VAC... so, no issue. But, touch the Sunrom boards and die...

Personally, I found that more scary than the entire project.

 

- Sensors for approach

Like in the Scary Door project last year, I used an Enforcer Retro-Reflective Sensor.. In fact, I used four. I figures like approximating a curve, I could approximate the visitors approach. Four sensor points I thought would be good enough.

 

- sound

The sound was probably the most difficult part. I had to mix two tracks that would accomplish ambient creepy and a total shock. So, I sampled a lot of different sources for this. I played everything on a stereo that I found in the garbage a long time ago. It seems to have worked out well.

 

- Relay output (Not used)

I actually put in four additional outputs for either more lights or effects, but I never used them. However, I was planning on creating a sense of people/things behind the visitor using cutouts in front of additional lights... perhaps for next year.

 

The difficulties

- Mounting the system and long camera cable

 

- Fire/Death

When working with AC and circuits that use AC, you never know what may happen.

 

Pics and system

Scaryporch pi bplus.jpg

Smack dab on a boardganizer, I placed the Pi B+ and the Sunrom dimmer circuits close to the edge. I had to drape the AC lines down the side. I took the GPIO on the Pi and spread the leads liberally around the breadboard. Most going to the 16 digital lines of the dimmer boards. See the four in the middle? They were meant for the four extra outputs I never used.

 

full setup.jpg

This is the full setup from a distance. The sensors would typically be placed out of sight on a porch. For me, I didn't have that luxury. See the black squares on the left side? Those are the reflectors for the sensors placed on the other side.

 

off.jpgon.jpg

The effect on, and the effect off. Could be redder... if you ask me.

Block Diagram and Design

scary porch block.JPG

pinout.JPG

 

Code

 

This portion was fairly straight forward. Count up and down a 256bit number for the Sunrom dimmer circuits. Play sound with OMXPlayer call outs. And constantly look for the reset/EStop button push.

 

BOM

 

QuantityPriceVendorPart #Description
1$40$40element1468X0156Raspberry Pi model B+
1$16.40$16.40element1488W3963BUD Boardganizer
1$7.35$7.35element1456T0249BREADBOARD, SOLDERLESS, 400 TIE POINTS
1$49.95$49.95element1444W3511BUDGET PACK, RASPBERRY PI (Mostly unused, only for parts)
1$5.45$5.45element1488W3962Bud Wire Kit
2$7.95$15.90Sunrom1289Sunrom 1289
2$4.95$9.90HomeDepotAC power strip
6$7.95$47.70HomeDepotWorklight
6$11.6970.14AmazonBR38 RED OUTDOOR FLOODLIGHT BULB 100 WATTS
TOTAL$262.79

 

Other uses of the system

- Lighting and sound displays.

- Parties... play fun songs with colorful lights.

 

If I had more time and money

- I wanted to add a vibrating mat that vistors would stand on in front of the door. The idea is to give them a jolt they would feel through their shoes matched with the sound.

- The sounds can get annoying after a while... randomizing the tracks would be a good idea.

- More lights, of course.

- Better sound.

 

Happy Halloween 2014!!!

 

C

See more news at:

http://twitter.com/Cabe_Atwell

Raspberry Pi Model B+Raspberry Pi Model B+ pops up, and I was surprised to see more USB ports. Adding more peripherals without a secondary USB hub is inspiring. So, I thought about what I could do with more USB ports.

 

External harddrive, CD drive, Floppy drive? Kind of boring.

 

How about a bunch of arcade controllers? Word!

 

Backgound

I remember my local arcade used to give free tokens to those who received A and Bs on their report cards. Most of the time it didn’t matter for me. I would go into the arcade with one or two quarters, and shut the place down in the various Street Fighter games. The arcade closed down, and I wanted the exact same experience at home.

 

With Street Fighter, I found that the Sega Saturn had the best and closest experience to the arcade. So, I built an arcade controller for the Saturn. I measured the placement of the buttons prior to the arcade shut down. So, I was able to lay out regulation controls. I sourced real arcade parts from a now defunct company. It was fun. You may not think this, but arcade controllers are loud. All the switches are super sound in a quiet room. Arcades are full of constant noise, so, you never hear it!

 

fight stick alone small.jpg

The Street Fighter controller, during the Pi test (via me)

 

My girlfriend was really into the Dance Dance Revolution, arcade dancing games. So, I built a “arcade quality” dance pad. I wanted something made of metal, heavy, and the exact size. All store bought dance pads were soft, moved around too much, or not the correct size. So, I built a dance pad for the Playstation 1 (aka PS1 or PSX).

 

dance pad alone small.jpg

 

About a year later, I was off to college, and these both went into storage, where they remained... until now!

 

Time for a Raspberry Pi Arcade!

 

full system test street fighter small.jpg

Dance Pad and Street Fighter arcade panel up and running with the Raspberry Pi model B+. Playing some Street Fighter 2! (via my big test)

 

Now... some game emulation on the Pi using my old Arcade controllers!

 

 

Here were my requirements of the Arcade setup:

I simply wanted to interface my game controllers, a regular keyboard and mouse all at the same time.

The arcade is an open place, so there was no way I wanted to just interface with a small screen. So, I wanted to try a projector and the biggest image I could make. A 120 inch (3 meters) diagonal!

 

Project by sections:

- The games

Stepmania for the Raspberry Pi is not ready yet. It would be a game found in the Raspberry Pi Store.

I instead used the free emulator in the Pi Store called PCSX_reARMed. Although it need a Playstation Bios to run properly, it was able to without one.

I grabbed some of the PS1 games I had and turn the disc into an image I could run on the Pi emulator. I did this and not MAME, mainly due to the availability of games. Bootlegging game ROMs is not an advisable activity.

I used the games Stepping Stage Party Edition and Street Fighter Collection 2.

 

- Controller connectivity

I striped the PS1 and Sega Saturn gamepad PCBs off their respective DIY arcade controller I built. Originally I had my arcade controllers literally connected to the buttons of gamepads, like an external button.

For the Pi B+, I thought about doing something similar but with a keyboard. I didn’t want a big keyboard base laying around with a bunch of wires delicately soldered to it. So, I went out and found a USB keyboard adapter from an arcade parts supplier. \

It was just a keyboard breakout board with A-Z and 0-9 represented with screw down terminals.

So, I bought one for each controller, the fight stick and dance pad.

 

fight stick and kb small.jpgdance pad and kb small.jpg

Fight Stick and Dance Pad wired to their keyboard breakout boards.


- Projector

I chose a Pico Projector P300 for this project. It could project a 120” image. I bought one used off Ebay. It worked! Lucky.

projector test small.jpg

Projector test on a wall... looks ok when all the text is huge. Small text, forget out it.

 

The difficulties

- First and foremost, the projector was quite lacking. It was a blurry image at any size. However, with games, it hardly matters.

projector roof small.jpg

While installing the OS, I projected the Pi on the ceiling. Blurry everywhere.

 

- Re-wiring the controllers was a pain. I needed a cable with 23 wires for the fight stick setup. I used a surplus parallel cable. So, A lot of wire striping, soldering, crimping, and continuity testing.

fight stick underside small.jpg

Underside of the dual fight stick controller... See all those wires?

 

- Being portable. I wanted everything to be like an arcade you can just drop and turn on. However, the external battery for the projector never came in. And I wanted a good sound system, and the projectors internal speakers were weak. I had to bring in an amplifier stereo.

 

 

Schematic and Design

b plus arcade setup.jpgschematic.JPG

Pi B+ Arcade connections and block diagram (via me)

 

Code

No code needed, this time! Though, getting the games into a format the Pi can use, is a process.

 

Other uses of the system

- As a gaming time vortex.

 

When I have more time and money

- I plan to make the system more into that “Drop Arcade” idea. Everything portable, everything housed in an enclosure.

- Replace the projector with either a better one, or just a plain old big screen LCD. Not as big. I would love to project the games on a side of a building!

 

C

See more news at:

http://twitter.com/Cabe_Atwell


See the original Drinkmotizer video - and how it was built! (follow this link)


Celebrate the winter holidays with your own drink mixing robot. Drinkmo never lets you down!


Margarita Screenshot.png

The Drinkmotizer interface.

 

 

But, Drinkmo is different too. I made a few changes to its operation. First, I changed out the sub 100oz/in stepper motor for a 280 oz/in alternative. I did this so that the drink platforms could blast through any obstacle. Whether it be debris, dry triple sec, or someone’s finger… right through!

 

Second, I swapped out the stepper driver for a Gecko G210X, single stepping motor. I was originally doing 1/10th micro-stepper, and hand a maximum speed. Now, I am able to step up the speed, so to speak. I set it to be a little faster. Future modifications will make it move nightmarishly fast, you have my word on that.

 

Third, the onboard air regulator was originally taking 800 psi air from a paintball gun tank to operate the chaser module. The problem here was frequent air line bursts. So, I made an adapter to go from a portable air compressor to the Drinkmo regulator system. With a maximum of 100 psi from the air compressor,  air line compromises were over. I also upped the chaser bottle pressure from 5 psi to 15 psi to force the chaser out faster.

 

I have big plans from Drinkmo in the coming months. Almost a complete overhaul. Cheaper kits to follow too!

 

C

See more news at:

http://twitter.com/Cabe_Atwell

Before you watch this project... see my others:

- The "Scary Door"

- "Project Goldie"

- "New Year’s Eve Countdown Timer With Fireworks Launching Ability"


 

I am building kits of all the parts used on the Drinkmotizer. Private message me here at element14 or Twitter if you are interested.

Thank you for the support and furthering development on the bot.

- C http://twitter.com/Cabe_Atwell

 

UPDATE: Drinkmo upgraded for the holidays! See video below:

 

 

 

 

“Make me a drink, Drinkmo.”

 

On every engineer’s senior design short list is/was a drink mixing robot. One of the few projects that’s fun at parties. You want the Drinkmotizer at your party… You need the Drinkmotizer at your party… At some point, dexterity for drink mixing is lost at a gathering. Drinkmo is your designated, sober, mixologist. Your enabler. Your friend.


I know what you are thinking, “hey, there are other drink mixing bots out there, what makes this one different?” This one doesn’t break the bank. It’s DIY, Open, expandable. Artistically speaking, It isn’t just a nozzle that sprays alcohol at objects, it uses the actual bottle, and gravity.


The concept is based on a CNC lathe I built. My goal was to make something a bit faster, slightly less precise, and upgradeable. Drinkmo is all that. In the video I show six bottle stations and one chaser spout. That particular setup, being four feet long, can have up to sixteen bottles and still have the chaser spot. Technically, I could build a Drinkmo that is twenty feet long having 80 bottles on it! I thought that would be cool to see at a bar somewhere.

 

Here were my requirements of

- Use the original drink bottles

- Be expandable

- Single button interface

- Be inexpensive (relatively to the other bot options)

 

Drinkmo full.jpg

 

Project by sections


- Motor control

There is a stepper motor driving the Drinkmotizer table via a drive belt. With CNC applications, directly coupling a stepper motor to the drive shaft is never a good idea. Most stepper motors are not designed to handle lateral forces. Although this is only driving a small platform and a cup, there still is resistance.


The Arduino receives the serial drink protocol (Recipe) from the Raspberry Pi and controls the motor routine based on the recipe. We are using the Centipede shield to expand the I/O of the Arduino Uno. The Centipede Shield uses the Wire I2C interface on analog pins 4 and 5 of the Uno to provide 64 general purpose I/O pins. The program starts off with importing the libraries. The Centipede shield comes with a library that is imported along with Wire.h library in order to communicate with I2C devices. The SoftwareSerial.h Library is imported to allow serial communication from the Pi. We then setup all the variables and subroutines.


The main program runs in a loop waiting to receive serial data from the Pi based on the protocol setup. The Arduino receives the values separated by commas. We use the Serial.parseInt() function to place each comma separated value into an array. We then parse out the array and assign individual variables. Once these variables are assigned, we check the values of these variables and move the motor accordingly to each drink module position. The positions are fixed and have a set number of steps in order to move the motor until the cup is directly under the pour spout. The program will check the number of shots in the recipe and dispense the first shot then wait about 4 seconds for the drink module chamber to refill and pour the second shot before moving on to the rest of the recipe. The program also checks whether or not there is any more drink modules left to pour when executing the recipe. When no more drinks are left to pour, the program considers the drink complete and returns to the first position (home). The number of steps are added when the platform passes under the drink dispensers. When the program considers the drink complete, it takes the total number of steps added at its current position and moves the motor, that many steps, in the opposite direction. The platform returns to the exact place when it started the drink.

The protocol includes pour durations for the chasers based on the recipe received. The chasers are poured last, after the liquor. The protocol value for the chaser is a time in milliseconds. This variable is passed directly into the delay for the solenoid that allows the chaser to flow. Once the drink has returned to home, the loop starts over waiting for drink data from the Pi.

 

The Motor has an acceleration and deceleration routine which is used to achieve top speed and come to a gradual rest instead of abruptly stopping the motor. Starting the motor at top speed will cause it to stutter when under the load of the lead screw. A gradual start makes for smooth operation and achieving top speed without problems.   


- GUI


Tkinter is a built in GUI library for python. Although not the prettiest themed GUI, It’s easy to use. Especially for our application using the raspberry pi for running the GUI which is as simple as running the python script in IDLE which comes with Raspbian OS. 

I decided to use a grid view for drink selections. Each drink would be displayed with a picture of the drink with the name then a short list of the ingredients following. Last would be a button to activate the machine to start making the drink. I decided to make the button big for the touch screen so it was easier for the user to click the button on the first try. I embedded the picture and Drink name into the button which flowed well with having a big button. The tkinter library only accepts .gif, .pgm, or .ppm picture formats. After finding the picture I wanted to use I resized the image and converted it to a .gif. I saved the picture into the project folder alongside the .py file. When running the script the code looks for the image file in the same folder as the .py file.

The script starts with importing the necessary libraries. The Tkinter Library is imported along with the Pyserial library for serial communication. The serial port is then set up telling the Pi to use the USB port as the serial port at 9600 baud. Next we set up the GUI’s attributes. We assign the GUI as dgui. i.e. dgui = Tk(). The GUI is displayed as fullscreen and the geometry is set to the 7” screen resolution. The text/label fonts are set to be used elsewhere in the program. The program has a cut out canvas frame placed inside the main window to display the grid of drink selection buttons.


The buttons are embedded with an image and text of the drink described. To achieve this we created a Tkinter button and assigned it a variable. We used Tkinter’s PhotoImage Class Function to import the .gif picture as a variable as well. Once the image is assigned as a variable we can configure the button to have the variable be the button’s image.  A text label of the drink name is then packed under the image inside of the button. The ingredients list text is then placed under the button.

When the button is pressed is calls the appropriate function to start the progress bar and open the serial port to the Arduino. Before sending the drink information to the Arduino, we set the serial port DTR to level 0 or False. This is to ensure proper serial communication with the Arduino via USB cable. Setting the DTR to 0 or False prevents the Arduino from resetting its communication on the USB port. Without setting the DTR we had intermittent connections.

The Raspberry Pi sends the Arduino the Recipe/Instructions to make the drink selected. It does this by sending our custom protocol. Which are just 9 values separated by commas. The Arduino parses out the values and assigns them variables.        

 

- Relays


For this iteration of the Drinkmotizer, I am using 10 relays off of a SainSmart relay board. Six for the drink module actuators and four for the chaser station.

Each bottle module uses a 12VDC car door lock actuator. When activated, the draw spikes to 12V @ 5A. So, depending if I want a full shot or a partial, I activate the relay time accordingly.

The chaser station operates differently. The chaser bottles are pressurized by a paintball gun tank. What stops the chaser fluids from spraying everywhere are four solenoid valves. Then one valve is actuated, it opens, allowing the pressure to push fluid through the solenoid. For the record, the solenoid is designed for fluids.

 

The difficulties


- The bottle modules started out quite differently. Originally, a cheaper metering bottle actuator was used, but they would easily break and were difficult to actuate. After several different types of bottle actuators were tested out, the ones used in the final Drinkmo were the clear winners.

- A lot of I/O was needed. The only expansion shield with enough pins was the Centipede board by Macetech. At the time of building the Drinkmotizer, the Centipede board was sold out. Honestly, nothing else was a viable option. Luckily, the people at Macetech were able to find a couple for me. Overnight shipping, and the day was saved.

- Some bottle spouts were too small for the bottle modules. Supreme force was the only solution.

- The whole system had to reset often. It turned out to be a faulty USB hub. Eventually, no hub was used at all, and there were no issues.

 

Schematic and Design

 

drink-mo wiring 2.jpg

(SEE THE PDF ATTACHED TO THIS POST FOR HIGHER RESOLUTION!)

 

What is not pictured is provisions for hall effect sensors... But, they would be on the Centipede board.

 

 

BOM

 

QuantityPriceVendorPart #Description
1$35$35element1443W5302Raspberry Pi Model B
1$26.82$26.82element1478T1601Arduino Uno
1$17.99$17.99element1497W1422PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI
1$49.95$49.95element1456T0249BREADBOARD, SOLDERLESS, 400 TIE POINTS
2$25.00$50.00MacetechMTCEN001Centepede Arduino IO breakout board http://macetech.com
1$48.60$48.60Amazon4x DC 12V 1/4 Inch Electric Solenoid Valve
1$67.50$67.50Amazon5 x 1PCS 12V DC 1/8" 2way 2position Electric Solenoid Valve Water Air Gas N/C Gas Water Air 2W025-06 BSP Normal Closed
1$45.12$45.12Amazon2x Oggi Professional 4-Bottle Revolving Liquor Dispenser
1$50.35$50.35Amazon5x  Install Essentials 524T 2 Wire Standard Door Lock Actuator Kit
1$11.00$11.00AmazonInstall Essentials 524T 2 Wire Standard Door Lock Actuator Kit
1$18.49$18.49AmazonNema 23 (57 series) stepping motor mount
1$174.00$174.00AmazonLilliput 7" 619AT 1080P Camera Touch Screen Monitor VGA/AV/HDMI/DVI Input
1$101.08$101.08Amazon7 of Wood Upside Down Dispenser - Lighted Dispenser Units - 30 ML
4$7.76$31.04Mcmaster47065T178Aluminum Inch T-Slotted Framing System, 90 Degree Plate, Single, 5-Hole, for 1-1/2" Extrusion
4$4.06$16.24Mcmaster47065T224Aluminum Inch T-Slotted Framing System, 90 Degree Bracket, Single, 2-Hole, for 1-1/2" Extrusion
1$5.00$5.00Mcmaster5905K21Steel Needle-Roller Bearing, Open for 1/4" Shaft Diameter, 7/16" OD, 5/16" Width
2$2.76$5.52Mcmaster6655K33Steel Thrust Ball Bearing, Stainless Steel Washers, for 1/4" Shaft Diameter, 9/16" OD
1$4.00$4.00Mcmaster1257K113Miniature 303 Stainless Steel Drive Shaft, 1/4" OD, 3" Length
2$7.48$14.96Mcmaster57105K13Acetal Pulley for XL-Series Timing-Belt, for 1/4" & 3/8" Belt Width, 1.00" OD, 12 Teeth
1$2.95$2.95Mcmaster1679K27Trapezoidal Tooth Urethane Timing Belt, .200" Pitch, Trade Size 160XL, 16" Outer Circle, 1/4" W
tax$43.30
shipping$5.25
3$30.33$90.99Mcmaster47065T103Aluminum Inch T-Slotted Framing System, Four-Slot Single, 1-1/2" Solid Extrusion, 4' Length
4$4.06$16.24Mcmaster47065T224Aluminum Inch T-Slotted Framing System, 90 Degree Bracket, Single, 2-Hole, for 1-1/2" Extrusion
1$56.56$56.56Mcmaster99030A7161018 Carbon Steel Precision Acme Threaded Rod, 1/2"-8 Size, 1/4" Travel/Turn, 6' L, Right-Hand Thread, 2 Starts
2$4.51$9.02Mcmaster47065T145Standard Type 302 Stainless Steel End-Feed Fastener for 1-1/2", Aluminum Inch T-Slotted Framing System, Packs of 4
tax$13.82
shipping$20.78
1$5.89$5.89Mcmaster8947A137118 Degree Point High-Speed-Steel Short-Length Drill Bit, Bright Finish, 7/16", 3-7/16" L Overall
4$7.90$31.60Mcmaster8702K487Impact-Resistant UHMW Polyethylene Rectangle Bar, 3/8" Thick, 3" Width, Black
1$13.33$13.33Mcmaster98089A336Metric 18-8 Stainless Steel Shim, 0.5MM Thick, 8MM ID, 14MM OD, Packs of 50
tax$5.17
shipping$9.84
1$4.76$4.76Mcmaster91292A202Type 18-8 Stainless Steel Socket Head Cap Screw, M6 Thread, 70MM Length, 1MM Pitch, packs of 10
1$11.23$11.23Mcmaster3846K1Multipurpose Gauge, Steel Case, 1-1/2" Dial, 1/8 NPT Bottom, 0-15 PSI
1$8.73$8.73Mcmaster91828A251Metric 18-8 Stainless Steel Hex Nut, M6 Size, 1MM Pitch, 10MM Width, 5MM Height, packs of 100
8$2.23$17.84Mcmaster5779K104Push-to-Connect Tube Fitting for Air, Straight Adapter for 5/32" Tube OD X 1/8 NPT Male
tax$3.84
shipping$5.10
1$18.00$18.00ebay2pcs SK20 Size 20mm CNC Linear Rail Shaft Guide Support
1$34.95$34.95ebayPBB20MM x 4 (four) 20mm Linear Bearings Pillow Block Bearing CNC Bushing SC20UU
1$133.15$133.15ebayStandard Type 302 Stainless Steel End-Feed Fastener for 1-1/2", Aluminum Inch T-Slotted Framing System, Packs of 4
1$11.50$11.50ebayClippard MAR-1 regulator
TOTAL$1,346.50

 

 

Other uses of the system

- I suppose any sort of liquids could be dispensed. Soup-motizer, juice-motizer, paint-motizer… fill in the blank –motizer.

 

When I have more time and money

- Going to attach the stepper motor without using a drive belt. I only used the belt to avoid having too much sticking out the side. But, I think shaft coupling would be safer. No place to catch your hand.

- Getting the touchscreen working properly. Raspian does not work with the screen, despite the vendor stating otherwise. Works great with XBMC.

- I plan on designing and manufacturing my own bottle modules. I want to meter smaller amounts of liquid. I want the modules to be “hot-swappable.” Of course, more compact and cheaper.

- Another option I am considering is changing out the leadscrew for a magnetic drive system. No visible spinning leadscrews is what I want to avoid. You know, the ones that crush fingers? With a magnetic system, we should habe quicker movement and easier adjustments.

- Originally, I wanted sensors along the line to detect bottle stations. I did not have to add them. However, it absolutely necessary. Especially when more bottles are added or removed on a whim.

- Bottle detectors. I want to detect if a bottle is in a station. Also reading the label/barcode could detect what it is too. That should take any thinking out of the mix. Keep in mind, those who use this are probably drunk.

- I want the cup platform/table to also shake/stir the beverage too. I have a few ideas on this one…


Oddities and observations

- Drinkmo made some powerful beverages. With the ease of beverage creation, one could easily develop a problem.


C

http://twitter.com/Cabe_Atwell

Before you watch this project... see my others:

- The "Scary Door"

- "Project Goldie"

 

 

C

http://twitter.com/Cabe_Atwell

 

New Year’s Eve (NYE) is always fun, especially when something fun happens at the zero time. Launching fireworks seems to be the default response to the calendar change. Having it do off exactly as the year comes to a close is key. The person that is often required to light those wicks loses out to enjoying that moment. (They have to be on the ready to do whatever task is needed…)

This project is for those lonely and wayward souls 

 

This setup and forget countdown timer that activates 10 relays for the last 10 seconds of the year. Like a switch, a relays can turn on/off anything that can be turned on/off. So, this project could just turn off all the lights in a house for a dark and private NYE, to blaring ten electric boat horns for the annoying party.

Do anything you want with the relays… I chose to launch a single firework at the zero second. I chose this mainly to give a simple way of handling launching of fireworks remotely. (I would like to add, much safer too. No more light the wick and run like crazy…)

 

Here were my requirements of the “CANYECT WFLA”:

  1. Grab the time from the Raspberry Pi clock.
  2. Countdown from any time showing DAYS:HOURS:MINUTES:SECONDS
  3. As the timer get closer to zero… it will truncate what is not necessary anymore, starting with days. Then hours, and finally minutes. On the last 15 seconds… the last numbers will fill the screen.
  4. On the last 10 seconds of the countdown, the RPi will activate (or deactivate) 10 relays.
  5. (For my example) Launch fireworks on the last second, wirelessly.

 

Project by sections

 

Hardware:


At the core of the project is the Raspberry Pi Model B Rev 2. Between it and the Sainsmart 8-relay board is a set of Adafruit Logic Level Converters. The Raspberry Pi GPIO pins only output 3.3V data signals… and the relay board is looking for a 5V potential to indicate a switch. The logic level converter handles that boost. You could build your own level converters with a 2N222 transistor as some resistors, but who has time for that?

From the relays board, I have bypassed one of the buttons on the JM70A Wireless Remote Control 4 Channel Kit. Why such a crude hack of the remote? I wanted to put together a simple wireless setup. I had a few wireless relays in my junk electronics, finally wanted to put them to use. For this project, I only needed one wireless relay.


I simple soldered wires to the either end of the JM70A button “A.” From there is connected to the last relay on the SainSmart 8-relays board on the “Normally Open” terminals. When the relay board is switched, the remote will think its button “A” is being pressed. That simple.

At the business end of the project is the 4-relay board, part of the JM70A kit. This board has four relays that could be used. I only needed one. To the Normally Open (NO) terminals of the relay I will activate, I attaches wires that connected to two CR123 (3V) batter holders in series (6V total), then to one lead of an Estes Model Rocket Igniter. The other lead connected back to the other NO connection on the relay.


When the relay is witched, 6V will dump through the Estes Rocket Igniter, which starts to burn. The Igniter is taped to the fuse/wick of the Fireworks I want to launch… the igniter burns.. so does the fuse.


Fun is launched.

 

You do not need to go wireless. Just use wires directly from the SainSmart relay board to your Igniters or whatever you are activating. Keep in mind, the longer the wire, the more resistance. You could attenuate your data signal. Test ahead of time.

I just wanted to not lay wires down like a WWII communications soldier. And.. I wanted to keep the Pi and parts safe from the burning materials.

 


Schematic and Design


Click to zoom in! (Build at your own risk...be advised!)

CANYECT WFLA LE1.jpg

Click to zoom in! (Build at your own risk...be advised!)



The difficulties

 

- The Estes Model Rocket Igniters, the ones you find in model rocket kits, are extremely delicate. Move it around too much, and the part that burns will break. There are plenty of sites that talk about building your own igniters.. However, I wanted something that is manufactured to work… but more importantly, available on Amazon.

Be careful with handling these. Also, keep in mind, they get “burn to the bone” hot, handle with caution.


- For some of us, NYE is a cold day. Although cold electronics often work better, batteries do not. I had trouble with some fireworks launch tests not working. I used a hardware store heat gun to warm them up before tests. Worked like a charm.

Alternatively, insulating the batteries is a good idea.


- The JM70A, both the control fob and the relay board needed 12V. The key fob had a battery holder, the relay did not. I bought a battery holder for a small 12V battery (N type). The relay board would be good for a few tests before the battery wore out. To about battery issues, I connected a 12V wall power supply to the key fob. Also, it saves a lot of batteries that way!


- Remember that the fuse on fireworks give some time for people to light and run away. So, if you set it at the zero mark, it will then take X amount of time to burn down. To account for this, I cut the fuse down quite a bit. Since I did not need to be near it to light the fireworks, I made it as short as I could. Also, placing the output at an earlier time could time it all better. IE: If is takes 3 seconds to burn a fuse, move the output to the relay for “3 seconds to go.)

 

 

Code (Build at your own risk...be advised!)


Everything you need to compile is attached to this post. Download, compile, and set up the relays.

 

To do a test of the countdown, press “Ctrl-T.” Each time you do, it will get closer to the last 15 seconds.

 

 

 

BOM

 

CANYECTWFLA BOM
DESCRIPTIONQUANTITYUnit PriceVENDORVendor Part#PRICE
Fireworks (Roman Candles, etc)3$7.00FW StoreNA$21.00
Estes Model Rocket Igniters (6 Igniters per pack)3$8.00Local Hobby Store2301/2302$24.00
Zitrades (SaneSmart) 5V 8 Channel Relay Module for Arduino DSP AVR PIC ARM1$14.25AmazonNA$14.25
Palm Touchpad 5V 2A microUSB power supply1$5.00AmazonNA$5.00
4-channel I2C-safe Bi-directional Logic Level Converter3$3.95Adafruit757$11.85
Raspberry Pi Model B2$35.00element1443W5302$70.00
PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI1$17.99element1497W1422$17.99
BREADBOARD, SOLDERLESS, 400 TIE POINTS1$7.35element1456T0249$7.35
BUDGET PACK, RASPBERRY PI (Mostly unused, only for parts)1$49.95element1444W3511$49.95
BUD Boardganizer2$16.32element1488W3963$32.64
Total$254.03
Items found or for free
HDMI and HDMI to DVI cables
Keyboards and mice
Power strip
ASUS 24" LCD1$100.00EbayNA$100.00
Magnets, wire, wire nuts, solder,



 

Other uses of the system

Anything that can be turned on with or like a switch.

10 Creepy talking dolls

10 Old TVs on "no signal" fuzz

10 Appliances in someone’s house

10 Fibonacci sequenced CANYECT WFLA projects (advanced… and sounds insane)

 

C

See more news at:

http://twitter.com/Cabe_Atwell

Want to build this project?
View Parts


Update (7/15/14):  Check out my new Goldie skateboard! Part of my new line of Goldie Fishwater products?

Goldie bottom .jpgGoldie top.jpg


Disclaimer: I’m an engineer, not a pro film maker. Be advised.

Disclaimer: I’m an engineer, not a pro film maker. Be advised.


"pro-tip" - I recommend watching all the times in bold below...

Video time map.. see what you want:

00:00 The story of Goldie, opening animation

03:25 Video start, my opening thoughts

05:47 Boardganizer overview

10:56 I show the components of the system

12:24 The fishfeeder

13:05 The limit switches

14:00 AC power

14:10 The moving platform

14:40 Powering the system accidentally...

15:05 Goldie gets stuck in the circuit!

15:30 Showing the moving platform and fishfeeder working, relay too

16:37 The web interface, how this system is controlled. Early test of all components.

20:09 Alienspec Pi Camera cable extension, 2 meters long!

21:00 Setup of the moving platform

22:06 Horizontal test of the system on the actual tank!

24:22 Change from horizontal to vertical

24:48 Vertical real world test!

27:14 Feeding Goldie!!! The reason for the system!!!

28:00 Temp sensor, moot point.

28:21 Fishfeeder and AC portion working.

30:30 Thoughts on the system, more Goldie shots.

31:35 My final thought.

33:00 Goodbye Goldie, closing animation

:

 

happy Right.jpg


I never thought I could love a fish.

 

But I do. Goldie Fishwater is a survivor – she’s so strong. Truly, she is an inspiration to me… to us all…


I went on a trip recently, and found myself worrying about Goldie’s well being more often than I ever imagined I would. I had a friend stop by my place to check on her. Unfortunately, my friend didn’t know what to look for, and my automatic fish feeder broke during my trip!

The tank was action packed with food. To no surprise, Goldie ended up getting over fed. In fact, she doubled in size! I returned to another traumatic, near death event for Goldie. I hopped to save her. While changing the filters and tank water twice, I thought I could not let this happen again. I want to see Goldie in real time, and feed her myself. There is no love in an automatic fish feeder.


Here were my requirements of

  1. I want to see Goldie in real time, at all times.
  2. Move the camera stream around the tank to where Goldie might be
  3. Cut the power to the tank’s filters and air bubbler
  4. Feed Goldie at manually
  5. Sense the tank temperature
  6. Above all, do all this through a network - and ultimately via the Internet

 

I knew The Raspberry Pi and Pi camera would be perfect for #1 and #6. An Arduino Uno would be a good choice for #2 through #5. I came up with this block diagram.

block2.jpg

 

Curious about all of Goldie’s hardships?

- Attacked twice by other fish. All fins and tail ripped off

- Ammonia burns on her wounds

- Swim bladder damage from being attacked, then infection. She couldn’t swim!

- Fungal infection

- Overfeeding and contaminated water

 

 

Project by sections

- Motor control

I chose two small Nema 17 mount stepper motors from Adafruit for my driver components. Of course, I used the Arduino Motor Shield to make short work of the motor controls. This was fairly straight forward type of connection. Coils A & B go to their designated spots on the motor shield, see the datasheet. Each motor had a different task. One needs to rotate 360 degree to dump fish food from the container. However, the other needs to allow for movement in both directions.

Limit switches also had to be incorporated to keep the motor from traveling too far in either direction. I used some Omron plunger micro-switches. I attached rare-earth magnets to each, so I can adjust the movement range as needed.

 

- The moving platform

I originally wanted the create a leadscrew driven platform for the camera movement. However, I opted for a surplus belt driven motion platform, mainly for price. The difference being $60 versus $15. This platform also gave me more travel that I had originally planned. This is great for viewing the entire length of the tank.


- Temp sensor

I used a waterproof DS18B20 Digital temperature sensor, for obvious reasons. Although Goldie, and her former roommate, are fresh water fish where room temperatures are ok, too cold or hot could be an issue. My building has a tendency to lose the air conditioning/heat exactly when inconvenient. This would alert me to any particular issue. IE: Direct sunlight overheating the water.


- Video

I needed a video stream to watch Goldie, I had a choice between VLC and Gstreamer. Although Gstreamer is a common choice for Raspberry Pi, I went with VLC for the ease of use. Mostly due to the out of the gate support Windows. Gstreamer may have needed some further development on my part. However, going with VLC was not a perfect solution. VLC suffered from a buffered delay that seemed to build over time. I wanted the highest resolution stream of course, but VLC seemed to really bog down over 640x480 pixels at 15 frames per second. So, I stuck with those settings.

Though, I will admit, I would like to do better in this area.


- Relay (AC power)

I wanted to use an off the shelf relay actuated AC outlet, the Powerswitch tail 2. However, it was out of stock. I took an off the shelf AC power strip and cut the black wire (the hot), internally, and sent two leads to the relay board. Easy, but, not as safe as I would have liked.


- Goldie the Diva

‘Nuff said.

 

The difficulties

- Mounting the system and long camera cable

I had intended to mount the entire system on the moving platform, since the Pi Camera ribbon cable was so short (6 inches or 15.54 centimeters). But, as I added features and cabling, it became too bulky and heavy. So, lengthening the camera cable was the only way. I could have adapted an old IDE cable from a derelict desktop in the mountain of surplus I have. However, I found several companies making solutions for my problem already, and a bit more elegant. The one I chose was from AlienSpec, a 1 meter long ribbon cable, just like the oem one… but longer. They were nice enough to rush ship me one right away. They even sent a 2 meter long one! This was a more logical solution.

- Motor control, switch from another dev board

There is no documentation say which wires on the stepper motors are part of what coil. So, measuring the resistance across the wires was the only way. Wires that are part of the same coil will show some sort of small resistance, while the others look like open circuits.

When I started out on my endeavor, I used a Chipkit Pi. However, I found it easier to adapt the motor shield to the Arduino Uno.

- Fish feeder

I wanted a better solution, but I used the original feeder drum from the malfunctioning feeder that made Goldie huge. It is a simple trap door that opens briefly when rotated completely around. I machined a sleeve to fir over the motor shaft and into the feeder’s mount hole. Simple enough, but it isn’t perfect. The drum need to be indexed a certain way, but the stepper motor might slip. Moving the motor back induces back current… not good for the stepper driver shield!

 

- Internet connectivity

I did not work on port forwarding, and access to the public Internet. That was my intention, but a few things turned me away. Opening up my home network, not that big of a deal, but more importantly… home safety. I was worried that my system, especially the AC portion, would start a fire. More trials will be needed before I go this route.

- Fire

An ever present worry…

 

Pics and system

 

Schematic and Design

schematic.JPG

 

Code

 

 

Product Name*DescriptionSupplier
Raspberry Pi Model BA credit card-sized board with a Broadcom BCM2835 System-On Chip running Linux.Raspberry-Pi
Buy NowBuy Now
Arduino UnoThe Arduino Uno is a microcontroller board based on the ATmega328.Arduino
Buy NowBuy Now
Pre Programmed, MicroSD, 8GB, Raspberry PiRaspberry Pi 8GB SD Card pre-loaded with NOOBS—a collection of 6 operating systems.Raspberry-Pi
Buy NowBuy Now
Breadboard, Solderless, 400 Tie PointsBreadboard, Solderless, 400 Tie PointsTwin Industries
Buy NowBuy Now
Budget Pack, Raspberry PiBudget Pack for Raspberry Pi (Mostly unused, only for parts)Adafruit Industries
Buy NowBuy Now
BUD BoardganizerMulti-development Board Enclosure KitBUD Industries
Buy NowBuy Now
Raspberry Pi Camera ModuleThe Raspberry Pi Camera Module is a custom designed add-on for Raspberry Pi.Raspberry-Pi
Buy NowBuy Now
Omron Electronic Components - D2HW-BL201M - Micro SwitchSnap-action switch for reliable ON/OFF actionOmron Electronic Components
Buy NowBuy Now

*Products and resources listed are listed to help members build their own Pi Projects. They are suggestions and listed for educational purposes. For substitutions of any parts, please post a question asking the original author.

 

 


Project Goldie - breakdownQUANTITYUnit PriceVENDORVendor Part#PRICE
Raspberry Pi Model B1$35.00element1443W5302$35.00
Arduino Uno1$29.95element1478T1601$29.95
PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI1$17.99element1497W1422$17.99
BREADBOARD, SOLDERLESS, 400 TIE POINTS1$7.35element1456T0249$7.35
BUDGET PACK, RASPBERRY PI (Mostly unused, only for parts)1$49.95element1444W3511$49.95
BUD Boardganizer2$16.32element1488W3963$32.64
Raspberry Pi Camera Module1$25element1469W0689$25.00
OMRON ELECTRONIC COMPONENTS - D2HW-BL201M - MICRO SWITCH2$6.55element1425C4430$13.10
Raspberry Pi Camera Cable 1 meter1$20.86Alienspec313-100$20.86
Fish Tank feeding wheel1$16.00AmazonNA$16.00
Small Reduction Stepper Motor - 5VDC 512 Step2$14.00Adafruit324$16.00
Waterproof DS18B20 Digital temperature sensor + extras1$9.95Adafruit381$9.95
4-channel I2C-safe Bi-directional Logic Level Converter1$3.95Adafruit757$3.95
12V 5A switching power supply1$24.95Adafruit352$24.95
Zitrades (SaneSmart) 5V 8 Channel Relay Module for Arduino DSP AVR PIC ARM1$14.25AmazonNA$14.25
Palm Touchpad 5V 2A microUSB power supply1$5.00AmazonNA$5.00
Linear Motion Slide Actuator Nema 17 mount1$15.00EbayNA$15.00
Power strip1$3.95Home DepotNA$3.95
3M Dual-Lock strips1$14.95TargetNA$14.95
Rare earth magnets, wire, wire nuts, solder,
Total$355.84


 

Other uses of the system

- Any pet control, watch the dog/cat/hamster/spider/ whatever. Feed them too.

- Any system observation and control. Watch your front porch for packages with VLC.

 

If I had more time and money

- Full internet control. This is going to happen, but not yet.

- Better AC control. I want to try the Powerswitch Tail device. I was also considering actuating a wireless control system too.

- More sensors. PH level, ammonia, Nitrate levels are a concern too.

- Better feeding system. This is going to happen too, but need to come up with a better way. I am considering a paddle wheel option.

- Full observation of tank. I want to create a 3D style observation arm. Think a robotic arm with a camera at the end.

 

Oddities and observations

- Powering the dev boards by turning the stepper motors. Turning the stepper motors would create a current that would flood every board with power. When adjusting the stepper motors I would end up activating the relays. What is a generator? An electric motor driven externally.


Cabe

http://twitter.com/Cabe_Atwell


(all cartoons, by Cabe Atwell)

Want to build this project?
View Parts

 

Also: Check out my other Halloween project the "Scary Porch" : How to Startle Halloween Trick-or-Treaters with the Raspberry Pi B+

 

 

Disclaimer: I’m an engineer, not a pro film maker. Be advised.

Disclaimer: I’m an engineer, not a pro film maker. Be advised.

 

scary door2.JPG

The Raspberry Pi Powered Halloween Effects Door. This is a video capture during one of the routines. (via Cabe)

 

Backyard haunted houses, carving pumpkins, elaborate decorations, jumping out to scare trick-or-treaters; Halloween is packed with the DIY spirit. People’s desire to be scared or scare others is primal. It’s the “fight or flight” response, the deep psychological need to survive. Halloween give many the chance to feel the fear, since back in our minds we know there is no real danger. Perhaps it is just the excitement that drives us to walk through that haunted house. Either way, it’s fun for both the builder and the viewer.

I am a big Halloween fan, visited countless haunted houses (multiple times), trick-or-treated at inappropriate ages (to see decorations), helped build some themed attractions, and of course dressed up. I think a lot of the passion comes from my brother building a haunted house back in the 80s. What would be considered a “backyard haunted house” today. My brother’s haunted house was  burned a few days after it was built, but the one time I saw it made a lasting impression.

 

I had a talk with my brother, the following is paraphrasing the story:

 

-----

Haunted-House-bats.png

Haunted house fair-use image.

 

The world looked a whole lot different when you were a kid living in the ‘80s, more so when the fall sets in and Halloween was just around the corner. This meant that the haunted house attractions were being set-up to fleece a modest price from neighborhood kids. Sure, back then there were haunted attractions at most giant amusement parks, such as Six Flags, but for us, that was a few hour drive and being 12 at the time we didn’t have a driver’s license, much less a vehicle. Still, in our eyes, the local haunted attractions looked great on the outside even though most of them were setup in a shopping center parking lot on the same lines as a carnival at local parks. After paying anywhere from $2 to $7, we would walk a maze of corridors that featured plastic and rubber body parts drenched in red food coloring, trap-doors that would spring open to reveal a shouting employee or plastic skeleton (also drenched in red dye) and of course strobe lighting complete with fog machines to give the place atmosphere. It didn’t take long for that vision of terror, while waiting outside to subside once we went through the place, which left us feeling a little disappointed. The fog (literally) was removed from our eyes and we could see those attractions for what they were: moneymaking machines using as little technology and effort as possible. After being continuously let down by most of those haunted houses and our money seemingly turning into ghosts from our pockets, we decided to do what any industrious kids would do. We built our own.


With our budget being extremely limited (most of it allotted for candy and soda), we needed a location where property wouldn’t be a factor and our friends parent’s backyard shed looked to be prime. We already used it as our clubhouse, so all we needed to do was transform it into the most terrifying experience people could have for the price of a buck. To make the place into a haunted house took some finesse along with some fishing line, Woolite, a few black lights, strobe light, faux spider webs (along with the real ones already in place), white sheets and hand tools. The clubhouse wasn’t very big but it did have two floors and several key escape hatches that could be utilized for a myriad of options. After several minutes of planning, we went to work by first cleaning out all the clutter to get more square footage (more like inches), after which we installed the lighting systems in key areas. Starting with the lighting first gave us more options on how things could be seen or rather unseen. Unlike most animatronic setups at the time (ShowTime pizza), we relied on a system of pulleys and fishing line to make most of our contraptions move. These were mostly positioned on the ceiling of the bottom floor and moved things like giant rubber spiders and snakes as well as for opening and closing hatches built into the walls.

 

One of my friends would stand behind one of the walls with his head positioned inside of a wall-mounted box, which looked like a severed head that would bleed and scream when the hatch was popped as patrons walked by. We positioned a homemade coffin at the entrance where my friend’s sister would hide in. When people were close enough, she would pop out (bleeding of course) as a vampire, scream and pop back into the coffin. As people went to open it, she would ‘vanish’ behind the coffin’s false bottom (we used spring-loaded hinges that would snap it back into place). We used Woolite fabric softener to paint scary images onto the clubhouse’s walls, which would glow when subjected to the black lights. This also allowed us to ‘mask’ some of the fishing line anchored to the walls with small eye screws. Over all, we completed the ‘house of horrors’ in about 4 hours and actually made about $5 on the opening night, which was subsequently the closing night as well. Our Goonies-styled contraptions didn’t frighten too many guests (all five of them) but it was fun to build, cheap to outfit (we took what we needed from our parents) and resulted in more candy and sodas that we could have while going to the next haunted attraction.

-----


An older sibling of my brother’s friends burned the haunted house down. As was the practice of older brothers in the ‘80s. It’s a shame that no pictures were taken of it.

 

Things have changed dramatically since then, and haunted attractions have increasingly gone high-tech since the 80s. It is a striking contrast that the revenue generated this year is set to rake in over $500 million from ticket sales over haunted attractions from a few decades ago. This is mostly due the technology they incorporate. Fog machines, animatronics and strobe lights are still around but they have been enhanced using state of the art laser lighting systems, customizable rooms using sophisticated software to manipulate objects and surroundings and even 3D-based high-definition sound systems to create intense sound-scapes. Some of the more high-profile vendors are now using RFID bracelets to keep track of the visitors going through the attractions, for not only safety reasons (getting lost) but also to garner information on what frightens people. The bracelets are outfitted with sensors that monitor body heat and heart rate to gauge the level of horror experienced.

 

For those who do not visit haunted houses, here is sad fact – the same effects and props are used year after year, even the high tech ones. They just tend to get in more disrepair. In fact, you will see the same “scares” happen the same exact way every time. Even with live-actors, they tend to be rather repetitive; saying the same thing, rattling the same chains, it is monotonous for the actor as well as the repeat visitor. It seems once the program is set for the advanced effects, they are rarely changed. I maintain that with technology the possibilities in a haunted house should have an endless variation.

 

My goal was to create pro-haunted house level effects on the cheap. I wanted something that would be different every time you see it. Planning to combine visuals and sound, I created the monster behind the door effect. Through the window of the door, the viewer can see what might be happening behind the door. On time the viewer goes through might have a monster in the window trying to get through the door. The next time it would be a normal scene inside a house followed by the “monster pop-up” scare. Variety is my goal. It can turn a stale effect into one of constant apprehension.

The door’s window is, in fact, a LCD screen, making for an infinite number of possibilities. Also behind the door is an array of air-pistons to hit the door in various places to simulate commotion or direct hits. This door can be placed anywhere. Even at a distance, it has a frightening effect. This system could be adapted to work on any front door, as long as you don’t mind that door getting destroyed by pistons.


 

Disclaimer: I’m an engineer, not a pro film maker. Be advised.

Disclaimer: I’m an engineer, not a pro film maker. Be advised.

 

 

 

The project by sections and the project video


I wanted to create reproducible “scary” effects powered by the Raspberry Pi. Being a big haunted house fan, I wanted to mimic some of the classic gimmicks. This one, being the “thing” crashing behind a door or wall. As many probably know, this effect can get repetitive, even with a live person. So, I wanted to create a system that would cycle through different sequences for the surprise factor. Since a wall is not exactly frightening, I added a window to simulate that of a front door. The window gives the viewer the sensation that whatever it is, it is right behind a thin storm door.

 

Window and LCD behind the door:

100_0012.JPG

24” screen used in the project. (via Cabe)

 

I added the LCD screen to the window to play the various video. In this case, I used a 24” 1080p TFT panel. It was adequate for the small window effect. I found the door had a butcher shop, creepy basement door feel, great for this example. I simply lined up the LCD with the door’s portal, and build a shelf to hold it. I set the LCD back a few inches so that the viewer would see a mesh-screen first before the video. “Hey, this is just a normal screen door.”

 

Pistons behind the door:

100_0020.JPG

Pistons, solenoid vales, and air fittings for the set up. Also, The Enforcer photoelectric sensor on the bottom left. (via Cabe)

 

I wanted to hit the door in several places from top to bottom. To do this I used six BIMBA two-way air pistons, the kind found in factory assembly lines. I mounted them three inches from the edge of the door at the bottom, middle, and top. After some early tests that dented the front of the door, I layered sheet metal in the strike area of each piston - they were more powerful than I imagined. To actuate the pistons properly, I needed a five-way solenoid air-valve for each. The valves would let me control a piston in both directions. Driving the valves is an eight-relay board from SaneSmart. To split the air from the air compressor to each piston system, I constructed a six way air manifold. All that is needed is connecting the quick release hose from the air-compressor to the block. Push-to-fit air hoses run from the manifold to the valves and then to the pistons. No pun intended, but they hit with monster like force, which is terrifying in its self. The solenoid valves all run off of 110VAC.

 

Trigger for the event:

 

To trip an event on the door I originally planned a “door bell” like button. “Ring the doorbell, get a monster.” A friend suggested I trigger the door before the viewer even approaches. “oh, hey.. there is someone in the window… oh no, monster!” I liked that idea better, so I figured I would go with some sort of break-beam solution. After considering building my own, I found a break-beam device that have relay output… in other words, perfect. I bought a Seco-Larm “Enforcer”  from amazon for a hefty price, but I found it was worth it. It has build in relay functionality. I am able to take either the NC or NO outputs of the relay and trigger anything I want. I could even trigger a piston directly.

 

Raspberry Pi’s driving force:

pi on deck.jpg

(Left) Piface and the Relay controlling Pi. (Middle) SaneSmart 8 relay board (Right) Video Pi. The black wiring is the AC (Hot) power line for the pistons. (via Cabe)

 

The Raspberry Pi portion is cut up into two sections; the video output and the relay output. To avoid any issues with bogging down a single Pi, I cut up the tasks onto two boards. A single Raspberry Pi will play the video content. It waits for a trigger/button input, once hit, it plays the first video in a series. With each additional button push, it plays the next and so on. The other half is controlled by a Raspberry Pi and a Piface Digital. I chose the Piface for the fact it already has two onboard relays capable of handling AC and DC. The Piface also has 8 open collectors ports. This makes for easy triggering of the Solonoid valves. I tied the Piface directly to the eight-relay board, mentioned earlier, with an old IDE cable. Worked great, however, I am sure the IDE cable is not a proper cable for supplying 5V to the eight –relay board. When the Enforcer sensor detects a break, it triggers both Raspberry Pi boards at the same time, producing the timed effects I wanted.

 

Content - the scary material:

scarydoor1.JPG

Another creepy screencap. Why is the TV so close to the door? (via Cabe)

 

The content was a different story. It seems more thought went into this part than I needed elsewhere, it was surprising. I downloaded some video from youtube I found scary. Almost all of it needed some editing. I used Sony Vegas Movie Studio HD to chop up and change some of the video. I needed all of them rendered at 1080P, despite their original resolution, easily done with the Vegas. In the case of the “Rubber Johnny” video by Aphex Twin, I cut up the scenes I thought would create the best effect. I wanted it to look like someone was further in from the window, looking creepy, then slamming their face in the window, like what is in the video. I think it worked out quite well. Then came the relay programming, the biggest time consumer.

 

Code on the Raspberry Pi:

 

Despite what I thought was a great way to trigger the relays, with a single line of code, I needed to also shut them off. So, to perform a single on then off sequence required two lines (one to start, one to end), not the end of the world. To program the sequence, I just needed the time, from the beginning of the video, when each relay was supposed to hit. Watching the video in Vegas made that easy, I could see exactly on the timeline when I wanted the relay event. I then just hard programmed in the sequence I want. Each line of code contains the time at which to fire the piston. For example, fire piston one at three seconds into the video, etc.

 

The difficulties


The initial tests of hitting the door ended up with the door dented in all six piston locations. They were far too powerful, even at 40 PSI. I layered a few sheets of sheet metal in the strike areas where the pistons hit. I also machined six plastic piston tips to spread out the force.

 

Early versions was a single push button. I dropped this for the Enforcer sensor.

 

Video editing was probably the most time consuming. Picking the video, editing sections, adding sound, etc was all done through Sony Movie Studio HD. I learned the basics in an hour. However, with more experience, I think this wouldn’t be an issue at all.

 

Coding in debounce routines was the only major code issue. After working out a different scheme, I was able to stop the program from triggering the next video/relay series before the first finishes.

Making the screen black while the program is running was an issue. I didn’t think the Linux desktop or command line was all that frightening.

 

Schematics and design

Schematic final small.JPG

To see it in full detail, download the PDF. (See files attached to this post)

 

Code

video code.JPG

The important part of the video code. (via Cabe)

 

I wrote the video output program in regular old C, since it was good enough to call up OMXPlayer for playing the video/audio. I just place the videos number “1,” “2,” … “#” into the video directory. I wrote this part some time ago.

 

Relay code.JPG

The relay code, where the sequences get defined. It is a simple relay on/relay off scenario. (via Cabe)

 

I used C++ on the relay/Piface code. The file “ap-gen.h” header file is the most important part of the system. It contains the relay sequences. It is a bit brute force, turn on then turn off, but it does the job. Geany was used to compile. http://www.geany.org/

 


Bill of material (BOM)

 

Product Name*DescriptionSupplier
Raspberry Pi Model B (2X)A credit card-sized board with a Broadcom BCM2835 System-On Chip running Linux.Raspberry-Pi
Buy NowBuy Now
Piface DigitalPiFace™ Digital plugs onto the top of your Raspberry Pi, and allows you to sense and control the real world.PiFace
Buy NowBuy Now
Pre-Programed-8GB-SD Card (2X)Raspberry Pi 8GB SD Card pre-loaded with NOOBS—a collection of 6 operating systems.Raspberry-Pi
Buy NowBuy Now
Breadboard, Solderless, 400 Tie PointsBreadboard, Solderless, 400 Tie PointsTwin Industries
Buy NowBuy Now
Budget Pack for Raspberry PiBudget Pack for Raspberry Pi (Mostly unused, only for parts)Adafruit Industries
Buy NowBuy Now

 

Raspberry Pi Halloween Effect Door v1.0 Bill of Material by Cabe Atwell 10/1/2013
DESCRIPTIONQUANTITYUnit PriceVENDORVendor Part#PRICE
Blue Wire Nuts,  pack of 351$1.97Home DepotNA$1.97
Storm Door1$50.00Home DepotNA$50.00
2x4 x 8'7$2.57Home DepotNA$17.99
1x2 x 8'2$0.90Home DepotNA$0.90
2'x2' Sheet metal2$8.00Home DepotNA$16.00
Drywall Screws 2 1/2", 1 LB1$11.96Home DepotNA$11.96
Extra-Flexible Nylon Tubing .180" ID, 1/4" OD, .035" Wall Thickness, Semi-Clear White, (50 ft. roll)1$21.00McMaster Carr5112K43$21.00
Medium-Pressure Brass Threaded Pipe Fitting, 1/4 Female X 1/8 Male Pipe Size, Adapter24$1.58McMaster Carr50785K26$37.92
Steel Two-Hole Clamp, for 13/16" OD, 1/2" Pipe/Rigid Conduit Size, (pack of 50)1$7.76McMaster Carr9439T43$7.76
BIMBA 040.5-D-B PNEUMATIC CYLINDER 1/2" STROKE 3/4" BORE, (LOT OF 7)1$70.59EbayNA$70.59
4 Way Pneumatic Directional Solenoid Valve 120VAC Coil 1/4" NPT work ports6$19.85EbayNA$119.10
1/4" Tube x 1/4" NPT push to connect fitting,  (pack of 10)4$7.37EbayNA$29.48
ASUS 24" LCD1$100.00EbayNA$100.00
Zitrades (SaneSmart) 5V 8 Channel Relay Module for Arduino DSP AVR PIC ARM2$14.25AmazonNA$28.50
Palm Touchpad 5V 2A microUSB power supply1$5.00AmazonNA$5.00
Seco-Larm E-931-S35RRQ Enforcer Indoor/Outdoor Wall Mounted Photoelectric Beam Sensor1$49.00AmazonNA$49.00
Raspberry Pi Model B2$35.00element1443W5302$70.00
Piface Digital1$32.99element1448W3976$32.99
PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI2$17.99element1497W1422$35.98
BREADBOARD, SOLDERLESS, 400 TIE POINTS1$7.35element1456T0249$7.35
BUDGET PACK, RASPBERRY PI (Mostly unused, only for parts)1$49.95element1444W3511$49.95
Total$763.44
Items found or for free
Air Compressor (Harbor Freight model)
Quick fit air compressor lines/fittings
AC wiring
AC plug/cable
Nails
Door brackets for handing, made from scrap aluminum
HDMI and HDMI to DVI cables
Keyboards and mice
CNC Mill, Manual Mill & Lathe, Power Drills, Sheet metal cutter, various hand tools

 

SEE BOM PDF

 

Other uses of the system

The system being cut up into two sections can give the DIY Halloween fanatic some freedom of choice.

- Placing the pistons around, underneath some boxes let’s say, could create the ghostly moving objects effect. Set the sensor so that everything jumps when the visitor is surrounded by the objects. Only need a relay program.

- Using the video program and a projector, a large image can be displayed when visitors walk through the sensor. Like a giant screaming face covering a whole room or even a field.

- Using the relay program and board, have the relays turn on pairs of LED lights to simulate eyes in the forest. The user walks up, a pair of eyes light up… then twenty more. Feeling ambitious, make it a hundred pairs.

- Using the relay program and the pistons again, make it so it looks like hands are trying to push through the wall. A large white rubber sheet to simulate a wall and some mannequin hands behind it would do the trick. This would require a second set of valves to slow the pistons down. Alternatively, you can use motors and leadscrew to actuate the hands.

- Use the relay program to turn on electronic toys suddenly, as if the toys are possessed. This is similar to the ghostly objects.

- Relay program again, have it fire pistons against some wood. As the visitor walks through a path, the pistons make a startling effect.

- I could go on and on… here is the final thought… make the system do all of the above at the same time! It is possible, and it is cheap.

 

If I had more time/money

- I would have liked to use one of those cheap 40” LCD TVs in portrait mode – giving a much more intimidating feel.

- A change from TFT to and IPS monitor would be a good idea. IPS has better colors and wider viewing angles.

- More pistons in other door locations, and even around the door would have been useful. Like, popping a piston behind the viewer.

- More scary videos and relay routines.

- Streamlines code onto one system. Perhaps one Raspberry Pi and the ChipKit Pi expansion board. Even with the existing code, I believe I could simplify it quite a bit, especially in the relay section.

- I would have liked to setup the pistons to move slower. This would have required a secondary valve that would restrict the airflow when each piston is triggered.

- I would have made a wireless trigger or even a series of triggers for different effects.

 

Oddities and observations

- When I would turn on compact florescent lights, or when the pistons would fire at the end of programs, had a tendency to trip the next video cycle. I attribute this to a few issues.

- The wire lengths connecting all the Raspberry Pi and relay board. This will act like an antenna, tripping the system falsely. Making the lines shorted did help. See my cartoon about this effect.

- With every solenoid valve, there is back-EMF when discharging. Being so close the Raspberry Pi boards would have tripped the system.

- The lights also seemed to have an effect Photoelectric Beam Sensor (the Enforcer).

With a little more time, I would have made a tight and shielded Raspberry Pi setup, placed transient suppression diodes on the solenoid valves, and made sure no compact florescent lights were around the system (just to be sure).

 

Cabe

http://twitter.com/Cabe_Atwell

Filter Blog

By date: By tag: