When life gives you moderately non-linear 4-wire resistive touchscreens you make lemonade. Then you spike that lemonade with something tasty and toxic, and go make cool projects.
Recently a fairly sizable number of resistive touchscreens fell off the back of the e-waste truck and into my lap so it’s time to hit the shop and make something fun. My good friend Jill of blinky light love has recently started doing all manner of awesome things with RGB lights and, well… it looked like a lot of fun. Around the same time, Donut was putting in an order for some ShiftBrites so I jumped on that reduced-shipping bandwagon and got 10 of these things. They’re exactly what you would want if you have an arduino (or other microcontroller) and like pretty things that are fairly robust, well designed, and pretty easy to control.

Shiftbrite v2
First up was seeing if the touch sensors were even operational – I meant it when I said they fell off the back of the e-waste truck. If you’re wondering how to hook these up or how they work, you should check out the excellent writeup over at Sparkfun or the PDF put together by HanTouchUSA. In general, you power one line, ground one line, and read the resulting voltage out of a third to get the output from one axis. Swap everything around you get the other axis. Busted out a scope, a power supply, and made a little breakout board for the flex cables after a brief evaluation of my soldering skills and the flex terminals (conclusion: I don’t want to solder every one of these things if there’s a possibility that I’m going to have to search dozens to find one that works)

Touchscreen attached to an oscilloscope
Some quick experimenting later I had the lines out of the touch sensor identified and hooked up to an oscilloscope. Brilliant! Wiggling a finger over one axis and then three taps. Sensor away! Not 100% linear, and a bit wibbly wobbly around the edges, but I’m not doing surgery so I think it’ll be just fine.

- Testing a touchscreen with an oscilloscope
Arduino time! I found a simple and extremely useful library written by Jonathan Oxer that flips around the inputs/outputs as necessary and allowed me to read from my little four-wire touchscreen. After a bit of code modification to dump out some more information to the serial terminal I had my controller!
Next up: blinkies. External power seems to be the way to go with these things, so out came an old 6V wall wart to save the day. Remember to hook your grounds together! A quick Jack-‘n-Hack, this time with Digger 450’s code, to get the ShiftBrite control on lock. Originally my plan had been to make the touchscreen some part of an HSV color picker. We only have two axes, so without more hardware we’re only getting HS or HV. My first implementation was for HS but, as it turns out, HV is much more useful and allows you to play with the intensity and not blind yourself during development. More Jack-and-Hack on Stewart Russell’s code got me a suitable HSV to RGB transformation method. Sure, it only goes to 255 on each channel and the ShiftBrites can do better, but I’m ok downgrading to 16 million colors from a billion+.
So how did it turn out? Here’s the video proof. Would like for the code to differentiate between dragging finger and tapping states but that isn’t critical and… well, we’ll see if I end up needing it. The code is up on gitHub should you want to make your own blinkie light selection.
The video cannot be shown at the moment. Please try again later.
If you’re really interested in the touchscreens hit me up on twitter and we’ll work something out. There’s no way I’m going to use all of these.
Filed under: Burning Man, Engineering, Projects on July 22nd, 2011 | Comments Off