Touch Control Panel

Nintendo DS Touch ScreenSmall 4-wire resistive touchscreens are now amazingly cheap: they are produced in such enormous quantities for mobile phones, PDAs, and particularly handheld games such as the Nintendo DS that they can be bought brand new for under US$10.

Larger touchscreens are also rapidly falling in price. The popularity of netbooks with screens between 7" and 10" in size has resulted in a healthy market for touchscreens that can be retrofitted to them and plugged into an internal USB port. Despite the fact that they come with control electronics and a USB interface those screens are also predominantly 4-wire resistive devices, so if you dump the control module that comes with them and interface to the screen directly you can have a 10" touchscreen on your Arduino! And if you want to go even bigger there are often 15", 17", and 19" touchscreen kits available on eBay for under US$150.

Note however that what is advertised as a "touchscreen" is not actually a complete screen including an LCD. It's just the transparent glass and plastic panel that fits onto the front of an appropriately sized LCD so the CPU can detect the point at which it is being touched. If you want your Arduino to display information on a screen and let you select or control it by touch you'll have to do a bit more work to set up the LCD that goes behind the touchscreen overlay.

Even on its own though a touchscreen is a very handy device. They're incredibly thin and can be mounted over the top of any flat surface, not just an LCD, so they're great for creating little custom control panels with the "buttons" printed on a sheet that goes behind the touchscreen. All you have to do is map the buttons to X/Y coordinates and your Arduino can figure out which button is being pressed by matching the coordinates. Of course your control panel could represent anything, not just buttons. You could have a slider on it to select volume or temperature level by touching somewhere along a scale, or it could be a plan of a house so you can control lights in different rooms by touching the correct part of the floorplan.

In this project we mount a Nintendo DS touch screen on a blank electrical wall plate to create a touch-sensitive light switch that can link to a home automation system.

Parts Required

Qty Description
1 Arduino Duemilanove, Arduino Pro, Seeeduino, or equivalent
1 Nintendo DS touch screen
1 Nintendo DS touch screen breakout board
1 Blank electrical wall plate
1 4-pin male breakaway header

Touch Control Panel Schematic

Source Code

TouchScreen library for Arduino: github.com/practicalarduino/TouchScreen

TouchscreenCoordinates minimal example sketch: github.com/practicalarduino/TouchscreenCoordinates

TouchCube visualization for Processing: github.com/practicalarduino/

TouchControlPanel sketch to map virtual buttons to actions: github.com/practicalarduino/TouchControlPanel

TouchControlPanel display for Processing: github.com/practicalarduino/TouchControlPanelDisplay

Resources

"Processing" visual programming environment: Processing

Errata

If you would like to submit a correction for this project please let us know.

Page 124: Figure 8-3, touch screen layers

The labels for the two front layers (plastic layer and resistive material) are transposed, and the front resistive layer should be in contact with the microdot spacers. The correct diagram appears below.

Resistive touch screen layers

Gallery

Have you built this project or something inspired by it? Please let us know and we'll put a picture of it here!