loading

UPDATE 04/04/2016 : Multipoint software + Emulating NES video/pictures + OPTION_7 Point and Click + speed test + OPTION video

UPDATE 03/24/2016 : CCD sensor reverse Engineering + Using 2 CCD sensors + Laser engraving vector files + Retropie playing

Hi and welcome to my third Instructable !


I have been reading about DIY touch screen table projects for a while now, and I find most of them very complicated. Often They imply using a videoprojector, reflection mirror and IR camera. The result gives you a complete multi touch screen solution, but you need some depth for the videoprojector to have a big screen. Not the best solution for a coffee table...

I made this tutorial to help people to build their own touch screen solution based on any flat screen TV. It uses light triangulation technology to read the coordinates. This method is quite cheap ( the priciest part is the TV), with a good quality image and you can make the table almost as small and as thin as your TV is.

Of course, nothing is perfect and with this solution it's not possible to build a 100% multi-touch screen and it's hard to cover the entire screen area. But depending on the way you make it you can have some interesting results. Plus, I am sure there are a lot of possibilities I haven't thought about to improve this.

Step 1: How does it work ?

This solution implies the use of light triangulation to read a very precise coordinate. Basically, it's like having a huge number of IR receptors with some IR LED. You turn on every LED one by one and read the sensors. When one receptor can't see any light, it means that an object is blocking the light. With enough LED and sensors you can get a much more precise solution.

But for this project, I was looking for something more suited for the reading. A CCD sensor, is in every scanner. In those devices, it's basically a black and white camera which reads only one line of pixels. To scan a color document, a RGB LED blink in the three colors and the CCD reads all of them for every line of the document. Then it can calculate the exact colors depending of the Red Green and Blue reaction.

Using a CCD sensor gives you access to 2700 light sensors on a 20cm line. Most people who take sensors and actuators from an old printer/scanners only take the RGB LED and the light conductor from this part, as we can see here. If you like recycling, you could examine the possibilities of CCD. Not having found many DIY projects on the internet using them, there are probably a lot of different ways with which you could use these sensors! In this tutorial I will also explain how to hack your own scanner.

For this touch table, I used one CCD sensor with 24 IR LEDs. The object is detected on a 740x380mm surface by a Teensy board (which works under Arduino environnement). This board turns the IR LED ON, reads the CCD and calculates the exact position of an object. Then it sends the coordinates as a mouse, a keyboard, a Python program or just as Serial on a Raspberry Pi which shows the interface through the HDMI on a 32" TV screen.

<p>You might be able to do something with a laser and a rotating mirror. The laser spot would be projected as a red dot on the edge which would have to be a kind of frosted glass or plastic. The timing would be done relative to first and last illumination of sensors positioned so they couldn't be occluded.</p><p>You could do a two dimensional version with laser shining onto the W and N sides and sensors on the E and S sides.</p><p>Of course this system would be better with the laser bean not hitting the sides at too oblique an angle which would require the rotating mirrors to be well away from the side of the screen. Alternatively the laser could pass under the volume interceptable by fingers, a bit like this!</p>
<p>Hi, </p><p>This could be a nice implementation!! Do you mean adding one motor to rotate every mirror simultaneously? </p>
<p>jeanot, yes..ish. Not a very clear explanation. My sketch is with a motor rotating three mirrors in a triangle so that as soon as the reflected beam has exited at one extreme a new beam starts at the beginning again. The beam would then be reflected up using the prism and show as a red dot on the inside of the edge. Rather than get some feedback or control of the motor; one or two of the sensors could be used to signal 'beam starting' and 'beam ending'. Obviously there would be trigonometry to figure out exactly where on the perimeter the dot should be at an intermediate time!</p><p>It's rather complicated to implement - just a brain-storming type idea.</p><p>PS I've not figured out the issue with the pi3d events multiple key presses at the same time! </p>
<p>Hi, if you don't mind can I have more details about this project. This is my email danielalex3600@gmail.com . I have you can share with me and we can upgrade something about this project. Thank You.</p>
<p>Hi, </p><p>This Instructable already have all the information I think... I am not sure of what else I could give you. In which part do you need information? (code, schematics, how it works...). </p>
the code &amp; schematic please.<br>im sorry, but i can't open any documents/files from instructable.<br>i dont know why.<br>so if its not trouble you, can you please help me to sent you coding &amp; schematic, also how its work. thank you
<p>just a quick drawing 3lasers on 1 side + 2ccd, and on the opposite site 1laser and 2 ccd. It is only an idea. I dont know if it wont be too slow. If there is any chance to reduce ccds when using mirrors.. would be fine. but have no clue how to program all of it. :-( . thanks</p>
<p>The challenge isn't really the programing part, if you use a bit Arduino, you will see that the code isn't that complicated. It's more trying to find and hack several identical CCD sensors... </p><p>I don't really like the idea on buying scanners just to destroy them and get my sensor, so i am a bit dependant on what I can find on the pit next to my place. </p><p>We could, of course, use 4 different CCD, but I am a bit worried that it would make the project way more complicated to use as each of them would react probably a bit differently. That's why I used only one or two in my project, and tried to multiply the number of LEDs. </p><p>I found some CCDs on ebay recently, I am trying to finish quickly another project, and I will probably have time in January to test it. If it work good, I could probably try your design (after another ebay command for the three others!) </p>
<p>hi guys. did anybody try to use line lasers instead of diods? line laser's got 120 degrees. I am able to cover 100% with 4 lasers and 4 ccds at least on paper. I am not a programmer.... </p>
<p>Hi! </p><p>It should work as well with line lasers, so it could be a good option. Some wider angle LEDs could be use too.</p><p>The more CCD you have, the more you will be able to cover the area of course.. but a 100%, I can&quot;t see any scenario for the 4 corners :p</p>
THANK! but I can't understand how to calculate X Y position. Can you show EX?
<p>hi, </p><p>This part is a bit tricky... </p><p>You can see on the step 6 and 7 how it works. </p><p>Basicaly every time an object is between an LED and the sensor, I calculate a line betwwen them. Several LEDs mean I can have several lines, and the crossing of those is the position. </p><p>Soory, I am not sure I am more clear :s</p>
<p>thank</p>
<p>hi my friend this is actually very interesting usiing ccd as a sensor, but I need your help because I want to hack some scanners to do this instructable and I dont find enough info in this tutorial, could you help me with some datasheets or other diagrams that maybe you have!</p>
<p>Hi, </p><p>That's the complicated part of this project, there isn't much documentation about it. I spent a lot of time on internet, but I couldn't find any datasheet of any scanner brand... That's the reason I had to &quot;reverse engineer&quot; the scanners I use. </p><p>The communication protocol is probably the same on many scanner, but the pinout seems most of the time different. That's why we don't have much choice as using an oscilloscope to read the CCD activity and figure out how to wire it. </p><p>If you have any question, I can help you. But I already posted all the data I have :( . </p><p>Good luck</p>
<p>COuld this be used to say connect to a computer and run windows 10? just curious as my group has a tv we currently use for a digital game mat and we are looking at converting it into a touch screen cheaply.</p>
<p>Yes, the teensy board can be connected to any computer over USB. It just acted like an Arduino board!</p>
<p>I Loveeeeeeeeeeee Arcade Stuff And Just Made A Cardboard Skeeball Machine</p>
<p>haha, I think I would love to add plenty of sensors in this ;-) </p>
<p>So, two ideas, have you looked into these?<br><br>1: since a normal page is twice as wide as the CCD sensor, that means the flatbed scanner had to have a way to warp 8.5 inches of image into a 4 inch strip and then warp it back out afterward. It would seem then that you could use some sort of lenses or something to focus the image of the entire line of LEDs into the 4 inch sensor bar to get a full view of the LED bar.<br><br>2: Seems like putting one of these on each axis (so like sensors on the bottom and right of the TV, LEDs on the top and left) would allow complete multitouch, because the worst case scenario is that you have a right triangle of points, so each axis is missing one point, but the other axis catches it. You'd probably have to halve your speed this way, but maybe not, you might be able to judge the strength of the shadows in each area to do both axes at the same time.</p>
<p>Hi, </p><p style="margin-left: 20.0px;">1. I am not sure I understand what you mean. The CCD sensor I used is 22cm (8.5inch) wide. Which is the size of a standard A4 page. So I don't have any lens here. I could use a A3 scanner to have a larger CCD sensor. But I didn't find any affordable for now :( </p><p style="margin-left: 20.0px;">2. The more I add sensors and LEDs, the more the screen is gonna get close to a good multipoint. But I think if I want to keep the speed, I ll probably need to add several Teensy, one for each CCD. I can probably also move to a faster uC (I think the digitalWriteFast of the Teensy isn't fully functional on high speed transition, that's why it didn't worked with my CCDs), maybe a STM32. </p><p style="margin-left: 20.0px;">I made several test on what would be the best positions with several CCD, maybe it would be the best on two sides,</p><p style="margin-left: 20.0px;">Thanks for your help </p><p style="margin-left: 20.0px;">Jean</p>
<p>awesome this got you victory to 3 contests</p>
<p>Thanks, I wasn't expected to win in the three, so very happy right now :)</p>
<p>But i can bet this project worth winning 5. Really liked your project</p>
<p>Haha, this project already made a lot. Now I have to focus on new ideas for new Instructables :-) </p>
Congrats you've won $4,909.00 worth of prizes...
<p>Thanks!! </p><p>That's gonna be a lot of new materials to play with :-) Can't wait to start new projects!! </p>
<p>gotta say awesome project. i tear apart a lot of electronics always wondered what those CCD sensors might be good for. very clever solution. i might have to dig one out of the junk boxes and play around with one now :D</p>
<p>I am still thinking on building a database of how each of those sensors works. Lets keep in touch of you discover new protocols or hack new brand, so I can add them to the list ;-) </p><p>I have to start thinking of new projects based on those now :p </p>
<p>awesome this got you victory to 3 contests</p>
<p>Great project, well done on winning, good work!</p>
<p>Thanks a lot!! I am really happy and already wondering what to make with this 3D printer :-)</p>
<p>I bet, some serious 3d printer envy going on here! I'll look forward to seeing what you do with it :)</p>
<p>haha, ;-)</p>
<p>What happens if you spill your coffee?</p>
<p>Then having a fitted carpet could be risky :p</p>
<p>Hi, </p><p>The panel of plexyglass has some small border sealed to it. So it shouldn't be a problem :) </p>
<p>thats awesome, so origional (and useful)!</p><p>thanks for sharing!:)</p>
<p>Thanks, a bit struggling right now on improving the multi-point :p </p>
<p><strong><u>THIS IS AN AWSOME PROJECT. EASY TO MAKE</u></strong></p>
<p>This is a fabulous project! A very worthy winner of the Pi contest, so well done for that!</p><p>With regard to speed, I wonder whether you could increase that with a more intelligent scanning algorithm. I haven't given it much though yet but what about a more tree-like scan rather than a linear one. What I mean is, say, turn on LEDS 1-8, followed by 9-16, followed by 17-24. If you see a shadow for one set and not the others then the point is near the left and you only need scan the LEDs from that one group. If you see for all then the point is near the right, so you only need to use a few LEDs to get enough overlap to triangulate the point. </p><p>I reckon you could get equal accuracy with a fraction of the scanning, at least in single-point mode. In multi-point mode it will be more difficult but I still think there are advantages to be had. Processing is fast compared to scanning, so use some analysis to get more value from your scanning time!</p><p>My other thought is that it would be great to do this <em>within</em> the glass . You might need to use visible light (glass does not transmit IR very well), but you could arrange LEDs shining within the glass and the total internal reflection will stop the light escaping except where the surface is touched. You might be able to achieve the same result and actually respond to touch rather than simply breaking a beam in the vicinity of the surface. The CCD is probably more sensitive to visible light anyway and I would bet that it would be less sensitive to ambient conditions.</p><p>Anyway, a fab project and one that I would love to try if I ever get the time.</p><p>Ugi</p>
<p>I was thinking about the scanning algorithm, but as I was developing the multi-point, it was not the good time to implement it. I made an update yesterday using a second CCD sensor to cover the entire screen with less LED. It helped increasing a bit the speed. </p><p>Then I thought about the needs of the application : </p><p>If I want to use a Mouse, I need a precise position, but not much speed. </p><p>If I use a keyboard for an arcade game I need a lot of speed but not much precision to emulate few buttons. </p><p>So I started to adapt like this : Only 8 LEDs with 2 sensors (25 pixels each) seems enough for the Arcade, and 16 with 2 sensors (100 pixels each) for the mouse give me a great precision!! </p><p>About the glass, it is a really good idea. I need to run few test to see if I can &quot;block&quot; the lights this way and about how the glass transmit. I am using IR filter to protect my CCD sensor from perturbation, do you think it's not gonna be possible to use this system with IR LED and filter? don't know much about that :) </p><p>Thanks a lot for your advices, if you need any help for CCD hacking, let me know ;-) </p>
U could use pymouse and then use it as a full time interface rather than just using it for games. I used it once but with a joystick and it shows great promise. And you can use spi or i2c instead of usb
<p>I never used Pymouse, I need to check that! Thanks :) </p>
<p>Its great. And since its the raspberry the possibility are endless. U can even use pykeyboard too. If u want help with it just lemme know. I got a CCD yesterday. Am going to try out your project and see.</p>
<p>I have just updated some CCD sensor hacking if you want to play with those ;-)</p>
<p style="margin-left: 20.0px;">Great, I spent my weekend hacking some new CCD. I will write an update in this Instructable in a day or two to show the results.</p>
<p>Or maybe next weekend, I have to finish the multi-point as well :p</p>
this is why I like instructables.. amazing projects like this.. Kudos! well built , and great instructable!
<p>Thanks, glad you like it :) </p>

About This Instructable

103,921views

1,203favorites

License:

Bio: Born in the Alps, I love travelling, paragliding, trekking and, of course, designing projects. :) I learned a lot from open source project on the last ... More »
More by jeanotP1314:Virtual Reality on Raspberry Pi with BeYourHero! Healthy, Smart & Natural Air Cleaner with Arduino, WIFI and Blynk Touch Screen coffee table DIY with 32" TV and low cost CCD sensor 
Add instructable to: