A couple months ago I finalized the design of my open-source “sip and puff” interface, openSip+Puff, and had a small run of boards fabricated through OSH Park. However, I immediately ran into problems with the first run of prototypes, and lost a fair bit of mental steam as a few small problems came up and the long, boring summer set in. Recently I was able to solve most of the remaining issues, produce another round of circuit boards and put together some working prototypes!
Setting up the instrumentation amp correctly
The main problem that I was having the entire summer long involved obtaining correct readings from the pressure transducer through the instrumentation amp. On breadboard, I was able to obtain very consistent readings from the sensor with no problems, so I was really stumped one what was different with on the PCB design. I used two different chips on the breadboard and the PCB design, but they had the same pinout and exactly the same function, so the drastically different results were confusing.
At first I thought the problem was with the value of the resistor I had chosen to set the gain of the instrumentation amplifier. I spent weeks poring over the datasheets for the two chips, recalculating the gain resistor value over and over and literally staring at the board design trying to figure out what was going wrong. My initial calculations weren’t right, but they weren’t so far off that they’d account for the errors.
After reviewing my initial breadboard circuit and discussing the problem on the Arduino forums, I realized that the amplifier’s “reference” pin needs to be tied to ground, which I had neglected to do in the PCB design. I manually soldered a small jumper wire to ground the correct pin and started getting good readings! Here’s what the corrected schematic looks like now:
Moving from SMD USB jack to through-hole
Another problem that was adding to my frustration all summer was my original choice of using an SMD USB jack to interface with the microcontroller. It made sense on paper, because SMD parts are easier for machines to assemble during production runs. However, they are not very easy to solder by hand, and I may have been getting faulty results due to bad soldering before realizing it.
I moved to a through-hole USB jack and had another small batch of circuit boards fabricated through OSH Park. Not only was assembly a little bit easier, but the jack itself feels much more mechanically solid than the SMD version. In production runs, SMD will be used, but for prototypes PTH is better in this case.
Hacking together some firmware for testing
Once the circuit boards were assembled, I used a USBtinyISP to flash the Arduino Leonardo bootloader via the on-board ICSP interface. As soon as the bootloader was flashed, I was able to connect to the boards using the USB jack and upload Arduino sketches directly from the Arduino IDE!
Finicky pressure transducer mounting
I ran a few tests to just replicate the results of my breadboard experiments, and soon found another small, annoying problem. The physical connection of the MX12GP pressure transducer in the 4-pin female header is pretty inconsistent, causing the data stream from the sensor to sometimes cut out entirely, even when you just touch the sensor on the board. One day, one of the legs of the sensor I had been using all summer just fell off, and I realized that I have been putting a lot of stress on it through various breadboard demos and transportation. I grabbed a spare sensor and plugged it, and wouldn’t you know, it worked perfectly fine!
Taking readings through Processing
For Maker Faire: Kansas City, I made a simple Processing sketch that graphed the data from the breadboard prototype and displayed whether a sip or puff has been detected in real-time. I wrote a very similar sketch and uploaded it to the new prototype board, and the same Processing sketch worked just as well. Eventually, a Processing interface will be developed that includes something like this for user’s to configure their own openSip+Puff board. Here’s a screenshot of what that looked like:
Testing the USB keyboard/mouse HID functionality
Once the little bugs had been stamped out, I could begin working on the main functionality of the board, which is to trigger native USB keyboard and mouse actions based on sipping and puffing on the pressure transducer. Since the ATMega32u4 is flashed with the Arduino Leonardo bootloader, all of the relevent documentation on the Arduino website should work perfectly. I wrote the following sketch to test out the functionality, which will be committed to the official Github repo soon:
The board design is pretty complete and should work well for most users, but I think I will add in a 4-pin I2C interface so sensor readings and events can be sent to other circuit boards (like an Arduino) for more complicated actions.
Now that I have a working prototype, I’d like to produce a small run (a dozen or less) and actually give them to people with disabilities and let them test it out. Before I can do that, however, I need to really flesh out the firmware and create a configuration sketch with Processing that will allow users to easily reconfigure their openSip+Puff to do various actions based on various triggers.
So far, I am thinking that I’d like to have the basic sip/puff activity trigger keyboard and mouse actions, then move onto having “soft” and “hard” sips and puffs doing different actions. Then I can create some kind of pattern-based trigger system, so you can use a combination of sips and puffs to do things, sort of like Morse code.
After the devices are tested with users and tweaked, I’d love to actually use this project as a way to get into the kit-biz and start selling kits! I am currently researching using Kickstarter or IndieGoGo to crowdfund the first production run, but I could definitely use the help of someone who has experience with this type of work! Feel free to contact me through my contact form if you’d like to get involved!