Open source touch screens to the rescue
"We should have called you earlier. We need a stand-alone electronics box that can connect to our data logging systems, drive the main mechanism motor and measure a few other sensors. We're very worried about the end customer damaging the hardware so we're going to need voltage limits, torque limits and other safety features that change over the mechanism travel…and we need it right away. Also, we haven't specified the motor or sensors yet."
This was one of my favorite clients talking so I want to give them everything they wanted, but already the project sounded like a mess. We didn't know anything, we needed safety features we couldn't even imagine yet, and they'd just started building the mechanism and we need it right away. On top of everything, they needed the devices to run stand-alone, so it needed a user interface.
With some digging I was able to identify most of the hardware interfaces without much trouble. Now I had are range of reasonable voltage levels, current levels, sensors types and the rest. However, the safeties were still a long way off. Voltage and current limits equate to feedback loops running somewhere, but without the hardware to measure them there was no place to start. The mechanism was complex enough that my rough analytical models weren't going to be good enough. I needed electronics that were flexible enough to run the system once it was built, measure the signals through the mechanism actuation, and implement the necessary safety features. That sounds like firmware to me and because the system is relatively low bandwidth and in a serious hurry: Hello Arduino.
I bought an Arduino Mega and started putting together the custom electronics in the form of a daughter board (Arduino calls them "shields"). However, it needed to be a standalone unit, so what could I do for user interfacing to the Mega that was flexible? Touch screens.
Adafruit, a hobbyist site like Sparkfun, offered a 2.8" TFT Touch Shield for Arduino for $59—a second-generation version is now available for $39.95. The libraries are quite easy to use and it gave me the flexibility I needed to make an early prototype of the full system and then refine the safeties once we had some actual test experience with the final hardware.
This open-source touchscreen unit from Adafuit
let us design an stand-alone measurement system inexpensively.
Ultimately the whole thing worked very well. We were able to run the mechanism the first day it was done using my electronics box (see my blogs on tools for rapid prototyping PCBs for some thoughts on making boards quickly and inexpensively). Then based on the data we took we began working out the details of our safeties. Ultimately, the safeties were quite complex including voltage limits and voltage feedback on current that change over time and mechanism deployment. We could not have come close to predicting the final safeties at the beginning, so building flexible hardware at the start was the right choice.
Once again, I thank the open-source community for providing a multitude of easily available, low-cost options for me that include lots of great libraries and examples to get things started. If you've used any of the touch screens listed above, or have any thoughts on flexible hardware systems for prototyping and test, I'd love to hear about it. Please comment below.