Skip navigation
1 2 Previous Next

Raspberry Pi Projects

18 Posts authored by: Cabe Atwell


#ShareTheScare this Halloween

Visit our Halloween space and find out how to win one of two Cel Robox 3D Printers. There are two ways to win:

Share your Project and Win
#ShareTheScare Competition
The Ben Heck Show Episodes


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

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





Why are dolls so scary to me? They watch you. Follow you. Walk around at night. Always evil. Always!


My fear must stem from a movie I saw as a child called “Dolls.” It frightened me so bad, I literally could not sleep, not even in the day! No other film did that to me. The Chucky series, Goosebumps episodes with the ventriloquist puppet, none of these scared me as a kid. It was something about that movie, Dolls… fuel for nightmares.


I’m not the only one. Dolls of various types always freak people out. Just take that movie “Annabelle,” the prequels to “The Conjuring” horror film series. All of which feature the doll, Annabelle.


To be honest, every single scary doll in anyone’s house I know… has been thrown out, burned or buried. Thank goodness!


However, for this project, there was a doll shortage. Who knew I would need one of those hideous things one day?


I tried many antique shops. But very freaky doll they had cost a fortune! Wouldn’t that be a double smack? I buy a 200 dollar doll, and it comes to life to get me! Luckily, some local resale stores had a few options. I found this one below… not as scary as I wanted it though.


I wanted to animate a doll to look like something left by a child on a porch. As someone approaches, it would slowly stand up. Guaranteed to freak everyone out. I had a few ways to do this in mind, but I thought the simple puppet on a string should do the trick.


In this project, we are going to talk about two important skills to learn: One – Raspberry Pi stepper motor control. Two – making a Scary Doll move. For an added bonus, we’ll add some scary sounds to go along with the doll moving.





The dolls movement is controlled by a stepper motor hidden behind it. The doll’s head is attached to a clear fishing line, going up to a pulley where it is attached to the motor on the ground behind it. Turning the motor in different directions controls the movement of the doll up and down from lying to standing to floating.


When it comes to motion control of any type, especially at low speeds, stepper motors are the way to go. I know the doll isn’t all that heavy, but a stepper motor has the highest holding force of any motor type. So, accidental unwinding will not be an issue.


Also, it will help with situations where the doll stands up slowly.


Another useful feature of a stepper motor is you can keep track of how it turns. The stepper motor used for this project is 200 steps per revolution. So, let’s say it take the motor 10 full rotations to raise the doll – that is 2000 steps. I can just send the stepper driver 2000 steps to stand up, then 2000 steps in the other direction to lay back down.


I know some of you are worried about missing steps. That is definitely and issue if the stepper is under a load. If you take a look at my drink-mixing robot, the Drinkmotizer, missing steps what a major problem. Drinkmotizer featured a leadscrew that is considered a load on the motor. Plus it would get sticky from the beverage fluid dripping on the leadscrew. I would experience binding and missing steps too frequently.


However, with the Scary Doll, there is almost a zero load on the motor. The doll is only a few ounces after all. Unless someone pulls on the string holding the doll, then missing steps would not be a problem.


What would stop the stepper motor from spinning? How do you control the motion?


To do this, I wanted to set virtual limits in the software. Typically, CNC or motion control devices have physical limits. When a carriage reaches a certain point, it presses a button, and the software interprets that as a limit – stopping all motion in that direction. However, with the doll, I thought that might be too hard to implement. So, I would set limits virtually.


The user moves the doll to one point, presses a button to set a limit. Then to another point and presses a button for the second limit point. Then, the software would not allow the motor to turn outside those parameters. This way, you can create canned cycles that stay within a certain distance envelope.




Scary Doll

Fishing Line

1x Low current Stepper motor

Gecko 210X Stepper Controller

Raspberry Pi 3

Speakers with Audio Input

4x Momentary Push buttons

1x Full-size breadboard


Schematic and design:



The actual build, setup away from the doll.


Gecko stepper settings



Code - How the code works:


In the main loop, button presses are checked. When a movement button is pressed, a direction is set based on the corresponding button. The direction is either Clockwise or counterclockwise of the stepper motor. This is set by the direction pin of the Gecko stepper motor controller. From our Raspberry Pi, we use the GPIO to write the pin 0 or 1 corresponding to the direction. When the button is pressed, we jump into a routine called rampUP() which incrementally increases the speed of the stepper motor to its full speed that the user sets based on the time between pulses. This is to ensure smooth operation of the motor. Steppers do not like to go from 0 rpm to a fast speed without gradually accelerating to its set speed. If this is how it's controlled it will most likely stall. Low speeds can be started up without the need for ramping up. Voltage applied to the motor windings is also a factor. The Gecko 210X has a voltage input range of 18VDC to 80VDC.


The higher the voltage, the better the ability of the motor to achieve a higher speed without stalling. One of the first things to do when entering the rampUP() routine is to enable the driver, so we change the enable pin to a 1. We only want this enabled when the stepper is going to move or else the stepper will heat up unnecessarily when not moving. Before the motor moves, The music starts playing with a call to mpg123 library using os which is playing a mp3 in the same folder as the .py file. This plays out of the audio jack of the Raspberry pi, which you can hook up to a speaker with an AUX cable. The motor ramps up from a starting low pulse that decreases with time, so there are faster transitions between high and low pulses making the motor turn faster. The high pulse is a very short time which is static and does not change in the pulse. Controlling the speed with the time of the low portion of the pulse.


The number of steps is hard coated to reel the fishing line into a certain limit and let the line back out at the end to the same point it started at. Driving the motor one way a certain number of steps and reversing the motor direction the same number of steps. Which results in the doll moving up from a starting laid down position to a raised position back to a laid down position. The Doll pauses for 3 seconds standing or crawling. Moving the Doll across the floor then standing up required more fishing line to be let out on the pulley and setting the doll farther away from the fulcrum.  

-control of stepper, theory, concept

-how limits were handled

-how the sound was played



- Keeping the Fishing line wrapped around the shaft coupler and taught to the doll. Something like a fishing rod spool would probably solve this issue.

- Keeping the doll from spinning too much. It would rotate on the fishing line. The only way around this would be a two line system to prevent that.


Other uses of the system:

- Moving a doll isn’t the only option. You could lift much larger objects, skeletons and ghosts come to mind. Or something smaller like fake bugs.

- This tutorial shows you how to turn a stepper motor. Anything CNC is possible. Linear stages, CNC router, etc.


If I had more money/time:

- I would love to animate more of the doll or puppet. Almost like a marionette with no puppeteer. The almost natural movement of arms and such, I imagine, would be very creepy.

- Find a better, scarier, doll for the project.

-Film in front of a porch with people walking up



See my wireless motion detection system after this link, it's pretty awesome! Or, carry on...


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

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



This project will retrofit an old washer or dryer to alert you via text message when the clothes are done.


With the IOT market hot right now, many appliances have applications in this realm. Recently we have seen internet connected cooking appliances and refrigerators. Of all the appliances in a house, the one that has remained mostly the same in its process is the washer and dryer. Most people dread using these machines because like baking, you have to wait and tend to the process when needed. With a washer, if you leave your clothes in there for too long without transferring all the clothes to the dryer, you risk having your clothes start to smell like mold or dry out, in which you have to rewash them. If you leave your clothes in the dryer for too long, they will wrinkle. In which you have to send them for another heated spin. Ideally, the clothes get transferred to the dryer as soon as the washer is done and the clothes are taken out of the dryer and folded or hung as soon as the dryer is done. People are either too busy or don’t hear the buzzer when it's done. These days, people are better at responding to their phone than when the dryer or washer is done. At this point, most washer and dryers only have the capability to remind you using a buzzer or chime which is short and sweet. Easy to forget or not hear at all. To make it life easier, why can’t that buzzer or chime reminder be a text message, something we are all now are very good at responding to.


I based this project on another I did some time ago using a Bealebone, but now it's ported to a Raspberry Pi since the Pi 3 has build in WiFi. I had to try it.


For this project we used a Raspberry Pi 3 to text your phone. Yes, that's all you need to send a text. Most people don’t realize that you can send a text (sms) via email. So by hooking up the Raspberry Pi 3 to wifi and using a email server we can send a text via email. The carriers for cell phone service have provided an easy way to do this.


This website popular mechanics list the ways to do this for most carriers:

It is the same way you address an email: provided in the list below:



Raspberry Pi 3

MMA8452Q 3-Axis Accelerometer

USB Battery Pack (Any external pack will work, here is an OK one.)

MicroUSB Cable

2 Industrial Magnets

1 Rocker switch

1 Panel Mount LED

Project Box



The Schematic:

Pi washer texter schematic.JPG

The schematic is simple. The accelerometer is attached to the Raspberry Pi 3 with four project wires.


The hardest part is OPTIONAL, adding an indicator LED and on/off switch. Technically, you can just plug in the Pi 3 to the USB battery very time you want to use it. But, if you want an easy fire-and-forget kind of device, place in that switch and LED!


The build:

How this is built doesn’t matter. At all.


All I did was slap the components inside a project box (enclosure). It can be inside any shape box it will all fit inside. However, with my build I wanted to mitigate any issue.

- I wanted to mount the accelerometer as ridged as possible inside the box. This is to make sure that most of the movement senses is from the machine it is attached to.

- I used two large rare-earth magnets to make sure it attaches to the washer/dryer as firmly as possible. Since the whole system works off of the idea the machine will have some vibration it can sense, it’s best to make sure it doesn’t get shaken off the machine!

- Portability and temporary use needed to be considered. I didn’t want to attach the sensor system to the machines permanently. I would only use it once a week or so anyway. Then I can turn it off and store it.


For those who want to see how I put it all together, see the following gallery:


{gallery} Raspberry Pi 3 washer dryer texter


The main components are attached to the lid of the enclosure, since it is easier to attach standoffs.


The battery and he magnets are hot-glues to the bottom of the main enclosure compartment.


Although project wires are long, they do not interfere with the battery.


The micro-USB connection that powers the Pi 3 is spliced inside the box for the on/off switch and the LED/resistor.





This is the complete system enclosed in the box and turned on.




We created a wireless box that attaches to your washer or dryer via magnets. There is a switch and LED on the top of the box that let you turn on and off the device and show you an indication whether the box is on or off. When the user is using their washer or dryer, they simply turn on the device before they start the washer or dryer and turn it off when they retrieve their clothes after the washer or dryer is finished with the load. The device works by detecting if the washer/dryer is on or off by reading its vibration. There are of course cycle changes in a washer and dryer that would fool the device into thinking that it is off when the motor stops for up to 30 seconds usually. A timer is implemented into the code to determine if the washer/dryer has stopped for 1 minute. Since a cycle change takes less than 1 minute, it only sends a text after 1 minute of no activity. Ensuring that the washer/dryer is done with that load. If the washer/dryer starts back up within that 1 minute then it continues to read the vibration until 1 minute of no activity to send a text. To measure whether the washer/dryer was on or off the accelerometer measures the X axis of the 3 axis provided. This is because the X axis is the horizontal plane of the surface of the dyer that moves the most.


The vibration of the washer/dryer is a side to side motion and less of an up and down. So we only need to use the X axis for measurement. There is a subroutine that measures out 50 readings in 10 seconds. So that is a reading every 200ms. After 10 seconds of readings, the subroutine returns the current state of the device. It returns whether or not the accelerometer X axis numbers are in range of the baseline which is taken when the device is first turned on and the washer/dryer is off. The 50 readings are compared, then calculated, and it is determined whether the values of X axis are in-range or out-of-range. The in-range values indicate that the device does not detect vibration therefore system mode is in standby mode and waiting for the appliance to start. Once the device detects vibration, the mode is then set to ON and the cycle and timing detection starts. When a cycle ends the device vibration readings will go “in-range” and the cycle check mode starts and the 1 minute timer will start. If no activity, the device will go into Finish mode and send a text. Then go back to standby to wait for another start.


The texting part works by sending an email via the Raspberry Pi 3. Since we are using email, we need an email handling service like gmail to send the email which gets translated into a text by the carrier. To set this up you need an email to login to, for example, in python:

#Assign sender and receiver, X represents the digits of the phone number
sender = ''

receiver = ''


#Next we create the message:
header = 'To: ' + receiver + '\n' + 'From: ' + sender

body = 'Laundry is DONE!'


signature = '- Sent From Rpi'


#Load the gmail server and port into the class “mail”

mail = smtplib.SMTP('',587)


#run a subroutine with your email login and password for your gmail.
          def sendText():      





     mail.login('', 'password’)

     mail.sendmail(sender, receiver, '\n\n' + body + '\n\n' + signature)


Running the sendText() function will send your text with the initialized variables loaded into it.

Wifi connection:  

The python code for this project was written in the Raspbian OS using the python 3.4.2 IDE. VNC Viewer was used to View the Raspberry Pi’s Desktop with VNC server installed on the Raspberry Pi. Once the box is connected to wifi using the Raspberry Pi’s wifi IP address, you can ssh into it using a terminal program like putty or VNC viewer to see the Raspbian Desktop. Typing in “ifconfig” into the terminal gives you the IP address of the Raspberry Pi connected via wifi.

-Screenshot of the Raspbian Desktop, showing python code in python 3.4.2 IDE and terminal

I2C Library:

Python has a couple different libraries to use for i2c communication. For this project we used smbus for python 3.4.2. This requires us to install the python3-smbus package by typing “sudo apt-get install python3-smbus” into the terminal. The project code uses the function calls, bus.write_byte_data(device address, register address, data to write) and bus.read_i2c_block_data(device address, start register, and number of bytes to read). The “bus.” is set = at the beginning of the program, bus=SMBus(1). Which sets the variable “bus” to SMBus(1) for easier writing in the code. The SMBus(1) tells the library we are using i2c bus number 1 to read and write on. The Raspberry Pi uses i2c bus 1 by default. We write to the MMA8452Q chip’s configuration registers to configure the chip for use via i2c bus. Especially the register that puts the accelerometer into active mode so we can read values from the digital output registers to retrieve the acceleration data on the Raspberry pi. “bus.read_i2c_block_data()” lets us read the first 7 registers into an array. We then take the X acceleration data from the X output register and parse out that data into variables.    

Accelerometer Connection:

The accelerometer is powered with 3.3V from the Raspberry Pi and communicates via I2C. The python program writes to the configuration registers setting up how the data should display and configuring the mode you want to use. For this project we used the XYZ mode where the device is pulled from the I2C where the X axis values are translated into g’s (acceleration). The python program reads the values from a register on the accelerometer and all mathematical translation from the pulled values to the units it uses to determine its state is done by the python program.

- Sparkfun MMA8452Q

- Alternative Accelerometer here


Program Running Terminal Screenshots:


The program is run via ssh and executed using “sudo python3”

-Running the Python script from the terminal, displays the hardware and variables being initiated

-Showing the readings, current state, and mode

-Showing the device reading the appliance vibration meaning its ON 

-Starting the 1 minute timer when the values are back in range.

-Checking if the stop of vibration was a cycle change or finished

-Checking timer to see if 1 minute has passed without activity.

-1 minute has passed without activity meaning the laundry load is finished, sending text

Text Received:


  • Screenshot of received text on phone

The Raspberry Pi 3 has ability to rapid fire pulses out of its GPIO. It's surprising how fast! In other words, it can handle a lot of tasks.


If the only thing the Pi is expected to do is spin a stepper or servo motor really fast, this is good news. Theoretically, the Pi can send pulses to the motor driver faster than most any drive could accept them. The problems start when the Pi is expected to control and monitor numerous devices, all while maintaining exact timing. There just isn’t time to do it all exactly when you want it done.


The Solution

The solution to the problem is to offload some tasks to another device. That is exactly what we did here with a Raspberry Pi 3 and two Arduino UNO’s (Figure 1 & 2). The Pi and the UNOs are connected via an i2c bus. The Pi functions as the bus master and the UNOs function as slave nodes. With an arrangement like this, each slave node is told what to do with a uniquely addressed packet of data. They handle control of the motors long after the Pi has sent them their instructions, leaving it free to do something else. If the Pi was handling everything itself, it would need to use clever algorithms and more advanced coding methods like timer interrupts to simultaneously control the two motors.


A logic level converter allows the 5-volt UNOs to safely communicate with the 3.3-volt Raspberry Pi 3. Also, notice the two pull-up resistors on the SCL and SCK lines of the i2c bus. There are several articles on the internet that investigate how the value of these resistors effect the rise time an i2c signal. 10KΩ is the value we had at hand and over the short distances involved and the relatively slow speed of 400Kbps, it worked perfectly. You may want to research this topic for your own projects.


schematic 1.JPG  

Figure 1: The wiring diagram.



Figure 2: Raspberry Pi 3 connected to Arduino UNOs via an I2c bus. Note the red logic level converter board on the breadboard. It is required for bidirectional communications between the 5v UNO and the 3.3v Raspberry Pi.



The code explained a bit.

(Code is attached to this post, link at the bottom)


A short length of Python code runs on the Raspberry Pi. This code relies on the smbus library to automates the transmission of data out onto the i2c bus. The function bus.write_i2c_block_data(address, cmd byte, array) takes three arguments. The address argument is the address of the slave node you want to transmit to. The cmd byte is a special reserved byte that always gets sent first. The array argument is where you put the main bulk of the data you want to send, up to 32 bytes. It will be tx’d immediately after the cmd byte is sent.


Each UNO slave uses the wire.h library for handling of the i2c interface. You will see a lot of print commands sending data to the serial-monitor. These can be removed without consequence. They are used for keeping an eye on what the code is doing.


Every few seconds the python code addresses each slave node in turn and gives it instructions. The first bit of the cmd byte to indicate the direction of motor rotation (Figure 3). The remaining bit are unused although, they can be used to communicate anything you want. The 4 bytes in each of the arrays communicate the number of steps for the motor to take and the time to wait between them.


unspecified bits

direction bit

bit #


















Figure 3: The first bit of the cmd byte indicates the whether the UNO should spin the motor clockwise or counter-clockwise. The other bits aren’t used for anything and are ignored by the code.


Data is stored in a byte array because the i2c bus transmits data a byte at a time. An unsigned byte can only store values from 0 – 255. To get around this bottleneck, we treat two concurrent array elements like they are the high and low byte of a 16-bit integer value (Figure 4). These bytes are sent out and then recombined into an integer variable at the slave node using this clever bit of code from the C51 compiler site. It allows the access and manipulation of the high and low bytes of an integer variable with a couple of macros. You can see the macro definitions and how it appears in the Arduino sketch in Figure 5. They perform this trick by creating pointers to the bytes within an integer value.


There are other ways to do this but this is a very quick way of accomplishing the task.


byte array.jpg

Figure 4: Integer values are split up into a byte array.



macros 1.JPG

Figure 5: These macros from the C51 site allow us to manipulate the high and low bytes within an integer variable.




You aren’t obligated at all to use any of the hardware or the libraries presented here. You don’t even have to use i2c, another serial protocol can be used. This is a concept that can be applied across systems and platforms. Also, our example uses Arduino UNOs, but there is no reason that a smaller board like an Adafruit Trinket or an Arduino Mini couldn’t be used in its place. A robot with an UNO at each motor might look a little silly.


For truly exact timing, a real-time clock could be added to the i2c bus. The master and slave nodes can then read the exact time and use that data to precisely time events.


The protocol we devised for this example of using the cmd byte in conjunction with 4 more bytes from an array to communicate step count, time between steps and direction of rotation can be modified to meet your requirements. Each of your slave nodes could be doing far more than spinning a motor and as such, may require 20 or more bytes to effectively communicate instructions. Whatever form that protocol takes is up to you. Do not feel obligated to do exactly as we did. This article is only meant to demonstrate a technique as simply as possible and to give the reader a solid starting point.


Finally, our example uses two slave nodes but there is no reason why more couldn’t be added. A lot more in fact. 127 nodes at the minimum and with some adjustment to the addressing scheme, there is no reason you couldn’t put 1000 devices on the bus. Not that you’d need that many. If you do, post a comment. We all are going to want to know what the heck you are up to.



Explanation of video:

What you see here are the two UNO i2c nodes controlling their respective motors after they have received instructions on how to do so from the Master node. Those instructions where sent, received and decoded before the motors even started to move. If the raspberry Pi was left to control these motors, it would be occupied with that task for the duration of each motor movement. By offloading the job of controlling the motors, the Pi has more resources to dedicated to something else, like running a GUI.



Have a story tip? Message me at: cabe(at)element14(dot)com

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!



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.



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.



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.



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



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.



    (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




(See attached to the post)






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


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.



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.



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.



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.



See more news at:


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



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



See more news at:

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



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





//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                ""

#define    EMAIL_TX_INPUT_2_RECIPIENT                ""

#define    EMAIL_TX_INPUT_3_RECIPIENT                ""

#define    EMAIL_TX_INPUT_4_RECIPIENT                ""

#define    EMAIL_TX_INPUT_5_RECIPIENT                ""

#define    EMAIL_TX_INPUT_6_RECIPIENT                ""


#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



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.



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

Block Diagram and Design

scary porch block.JPG





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.




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


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



See more news at:

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!



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)



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!



See more news at:

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!



See more news at:

Electronics & Design Projects

Enter Your Electronics & Design Project to earn a $100 Shopping Cart to any element14 transactional site!

Back to The Project14 homepage

Project14 Home
Wacky Automation Devices
Solar Powered Yard Gadgets


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


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.   




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



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





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



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.



Filter Blog

By date: By tag: