Archive for August, 2015

Pneumatic Controller: Part 8

So here we are at Part 8. The second to last post (unless something goes wrong).

Let’s get right to it.

The keypad had a hole for an LED but I wanted another so I could have both a red and a green one. This turned out to cause some problems, but more on that in a moment. I mounted both LEDs in a small piece of wood and soldered them to ribbon cable.

DSCN2191DSCN2192 (1)



The problem arose when I needed to take the keypad off the metal plate it was glued to. I didn’t know where in the keypad the circuitry was, so I didn’t know where I could safely cut through without damaging it. Also, cutting through the metal would be much easier if I could just cut all the way through and not have to stop at the plastic. So I got a flat head screwdriver and pried it off.

Unfortunately, this caused several buttons to stop working. See, the keypad is able to be so thin because the circuitry is on super thin layers of copper and the buttons are slightly bent pieces of metal, like this:


The copper are the yellowish lines on the greenish background

When I was using the screwdriver, some of these pieces of metal got bent a little, so they didn’t pop back up after being pressed.

This wasn’t too bad because I could just take off the top layer of the keypad, take them out, and rebend them. This worked, but led to some of the thin layers of copper getting scratched. I tried fixing this with wire and conductive tape, but it didn’t work, leaving me with a broken keypad.

I decided it was simplest to just build one myself. Surprisingly, keypad diagrams are really simple, basically just being a matrix of buttons. With the Arduino keypad library, there aren’t even any power or resistors to deal with.

I decided to base mine off of the Festo one the Box came with. Since I don’t have any kind of circuit printing capabilities, I decided to use conductive tape as the circuit and plastic tape as an insulator, keeping my version nice and thin. The metal pieces would be reused.

First I marked where all the buttons would go so they would line up with the cover, which had the numbers printed on it.


Also shown: the little button that started this great adventure

Then I put down layers of conductive tape to act as the rows. This would be what the metal pieces touched when they were pressed.


Then, after some strategic plastic tape, came the columns, which would always be touching the metal.


After some thought, I decided to just tape the wires to the metal. They would be pressed down by the tape and the keypad as a whole, so I didn’t feel that a more complicated approach was necessary.

DSCN2226 DSCN2227

After making sure each connection worked, I taped all the buttons in place.


The red markings are on the ones that needed rebending

The different layers are more clearly shown here:

keypad layers

Finally, I added some double-sided tape and put back the face.

DSCN2231 DSCN2232

In a surprising turn of events, this worked really well and has been what I’ve been using for a while now. Not quite as elegant but looks pretty much the same and it works.

In between that whole mess, I drilled a new hole in the metal and scraped off a circle from the face, then mounted the LEDs.

DSCN2186 (1) DSCN2190 DSCN2195

However, the wire I was using made the system a little too thick for the LCD, so I needed to change how it was mounted. Holding the LCD in place was a hassle, since it had to line up with the window in the face, but I could only tell if it was lined up if it was on. I decided on a more secure method.

After some very careful measuring/sanding, I got a piece of thin wood that held the LCD in the perfect position.

Pictured: One of my most satisfying accomplishments

Pictured: One of my most satisfying accomplishments

From there it was pretty easy to build around everything and add thick layers of hot glue to hold everything securely. The wood would hold the LCD straight, and everything else would add pressure to hold it down. Even though I originally did this out of necessity, it actually worked a lot better.

DSCN2235 (1) DSCN2236

The other layers are the same as before.

While I had not been planning on using the big buttons on the face of the Box, I decided that they would actually be super helpful, so I wired them up for lighting (through the high power supply) and actual use (through the Arduino). 
DSCN2330 DSCN2298


Now, the more complicated pause/unpause routine could be replaced with the simple START and STOP buttons. Also, I printed out a new label for the POWER ON button to make it RESET COMPUTER. It now resets the Arduino, which means it is no longer necessary to open up the entire thing each time.

This being done, it was time for more testing. This is where I ran into trouble. While everything worked fine for the most part, the sensors weren’t stopping the pistons. After some experimenting, I found that the function to check the sensors (sensorGrab) was only running every 200 ms, while the smaller, faster piston passed through the sensor’s range in about 5 ms. This was a problem.

The first thing I tried was putting more instances of sensorGrab in the code so it would run more frequently, but it wasn’t fast enough. Next I tried a timer interrupt. Remember those? Well it was simpler this time because there was no issue with the LCD, which wouldn’t be used inside the interrupt. However, this didn’t work either because having the interrupt run that quickly slowed the rest of the program down to a crawl.

So I thought about using an external interrupt common to all the sensors (6 individual ones would be too complicated). After all, I only needed to check the sensors when something actually happened to them anyway. So I wired a sensor to an interrupt pin as well as the normal pin in the Arduino and tried it.

It worked! The piston still couldn’t stop halfway, which was unfortunate, but at least it stopped no matter where the sensor was. However, when I tried it with more than one sensor, it stopped working. The problem was that the sensors were normally high and only became low when they were hit, so the interrupt waited for the signal to go low. But, if any of them were high, the interrupt wouldn’t recognize the signal of the one that wasn’t.

Fear not, readers! A solution presented itself in time. I realized I could change the transistor circuit so that the transistor ran on the lower Arduino power and would become high when the sensor was activated. This way, a common interrupt would work. Also, since I had to rewire it anyway, I changed the sensors from the stupid wire to ribbon cable.


Unfortunately it was around this time that the Arduino stopped being recognized by either computer I was working with. I have recently determined that the problem is the comparator (which decides where the Arduino’s power comes from) and the USB-to-serial connection (which lets the computer talk to the Arduino).

The board still works, but I can’t program it. There is the possibility that I could program with the serial pins directly, but I have been advised that the Arduino is probably living on borrowed time and might stop working in the future, so I will most likely have to get a new one. More on this next time.

Until then, here are some pictures of the thing as a whole.

New circuit diagram

New circuit diagram

DSCN2237 DSCN2238

Until next time,



Pneumatic Controller: Part 7

Some people, like myself, really like when things fit really nicely together and everything’s all organized. This post will be good for those people, especially after the makeshift stuff I’ve been using until now. We begin!

I needed to find some way of attaching the pistons’ ribbon cable to the Arduino. For the sensors, I used the wire itself (their wire was thicker/stiff enough) but the ribbon cable can’t do that. Also, it’s a lot weaker/uglier.

Ugly and weak

Weak and ugly

Last time I tried attaching ribbon cable to headers, I wrapped each wire around the header and soldered it into place. While this worked, it was time consuming and messy. This time I decided to use some leftover female header, having found that I could put the wire into it, then press everything together using male headers, securing it with glue.


DSCN2130 DSCN2137

DSCN2138This worked much better/neater, although still rather annoying. Eventually I figured out how to do it correctly, but that’s for later.

Next up was mounting the Arduino in place. I wanted something sturdy that would be secure in the long term, but could also be quickly removed in case I needed to change something. Conveniently, there was a metal rail near where I wanted to be, which meant I could use those plastic clippy things (so helpful!).

The Arduino needed to be mounted to something first so I cut a scrap piece of wood and drilled holes to line up with ones I made in the clippy thing.

DSCN2144 DSCN2143

Then I drilled holes to line up with the ones are are pre-made in the Arduino for mounting purposes. The Arduino also came with little plastic pieces to help with mounting, so I put a little hot glue into the holes and pressed the female ends in.

 DSCN2145 (1) DSCN2146Then I used the pins to hold it together. Everything fit nice and snug.

DSCN2147DSCN2142 DSCN2148 DSCN2149

To power the Arduino, I had an AC cable. I didn’t want the Box to have two separate plugs, so I planned on using the same power the Box was using. The Box took in the AC power and connected it to a transformer that would give the 24V output the solenoids/sensors needed. My plan was to connect the Arduino adapter to the same input the transformer had.

First up was to attach wires to the Arduino adapter in a safe way. I could have opened it up, but I figured that someone may want to change it in the future so not cracking open the plastic was better. I found some thick wires and wrapped them around the tongs of the plug with some heat shrink tubing. Heat shrink tubing is rubber tubing that will shrink when heat is applied (surprise). It’s very helpful for keeping wires covered and safe, since it’s held in place by the pressure of trying to be smaller than the wire inside of it is.


After adding some hot glue for structure and applying heat, I had a strong safe connection that also looked very nice.

DSCN2152 DSCN2153

To attach to the transformer, I lucked out. All wires in and out were screwed in, so all I had to do was screw the existing wires in with my additions.





Then I wired up everything and did some test runs. Unfortunately, for one of these tests I confused the power sources and accidentally connected the higher 24V source to the LCD, which promptly shorted out.

As annoying as this was, it did show me how confusing things were becoming with wires, not to mention that the wires I had been using were stiff and unwieldy. I decided to upgrade.

First was to switch to ribbon cable, which is much more flexible. I figured there must be a better way of attaching it, so I did what I should have started with and googled the problem. What I found is that the best way is to tin the wire and the header, then heat them both and let them melt into each other, finishing with a layer of glue for structure. It worked beautifully.

At least compared to what it was before

At least compared to what it was before

To help keep the wires coming from the lid tidy, I mounted a piece of thin board on the edge and drilled some holes for zip ties.

DSCN2178 DSCN2179

To wrap things up, here are some pictures of what things are looking like now.


Sensor circuitry

DSCN2181 DSCN2182

Everything’s going smoothly, plus or minus a few hiccups. Tests have been mostly successful and Part 8 should be done decently soon. It will probably be the second to last one.

Until next time,


Pneumatic Controller: Part 6

Okay so a lot has happened since the last update. In fact, at some point I realized that I wouldn’t be able to fit it all in update #6 and so I split it. Good stuff coming.

For the LCD shield, only 4 pins on the shield are used: V+, Ground, and two signal pins. This was good because I didn’t have a great way to connect to them without permanently soldering something to the shield, which I didn’t want to do in case I/someone wanted to change something later on. However, I did have 5 longer pins available, so I was able to make Franken-headers, with only the pins I wanted to use being longer.





LCD assembly fully built


LCD assembly installed

I also finished the sensor circuitry.

DSCN2114 DSCN2112These may not seem very important, but the specifics of how these things would be mounted/attached to the main box required some finagling. The problem was that although there was plenty of room, I didn’t want the wires to crisscross too much and become a rat’s nest. There was also a metal plate bolted to the bottom of the box (toward the middle of the picture below) that I couldn’t remove and was preventing me from attaching the breadboards to the bottom. Eventually I decided on this arrangement. I was even able to use that metal thing to hold the leads for the solenoid transistors (and other things, as will be explained next update).DSCN2128Next update will have most of what remains of the project.

Talk to you soon!


Hand-Finger Typing: Part 3

Past parts Part 0/1, Part 2

Part 3: Programming

This will be the final part, at least for now. I will be starting a newer and more interesting project (details soon, hopefully) and I am tabling this one. I just wanted to get it to the point where it worked and stop before learning the typing/getting good at it.

Here goes!

I actually finished the programming a while ago but didn’t finish debugging because of other things going on. Then I started focusing on the Pneumatic Controller project and this fell by the wayside. However, before starting a new project I wanted to have this one be at least somewhat functional, so I decided to finish the debugging.

Okay, everyone*? It works. Sort of. It does enough that I can move on now.

Possible Future:

Beforehand, I had also made a helpful chart to make learning the new typing easier.

letter matrix

Since then, I have also learned Python and how to make GUIs in it, so if I move forward with this, I plan to make a program to help. It would have the fingers and the letters you can make by starting with them (so Dominant Middle would have T, E, P, R, Q) and then when you press that, it will highlight the new letters you can make for each finger (so Dominant Middle would be ‘E’ since two Dominant Middles in a row give that letter. Dominant Index would have ‘I’). It’s all very exciting.

So that’s it. It sort o works. Now I’m moving on to bigger and better things (and of course continuing the Pneumatic Controller project).

Until next time,


*Really just me