kalshagar - arduino and a nintendo ds touch screen.pdf

5
Wiki Home Recent Changes Pages and Files Members Search Quick NavigaƟon All projects Hardware Links Top projects Game boy projects Alan numitron clock Clapclap 2313/1386 Smokey amp Laser cuƩer WordClock ardReveil v3 SNES Arcade cabinet cameleon Home Presence Detector Contact me Who's Alan? Favorites Hackaday ATmel blog Akizukidenshi 秋月電子 Elec‐lab EEVblog Switch‐science Sparkfun Suzusho 鈴商 Datasheet Lib Ermicro Skyduino (fr) Marutsu マルツ Tag cloud atmega328 Arduino and a Nintendo DS touch screen (/Arduino+and+a+Nintendo+DS+touch+screen) Put 470 ohm : the read values are [0..200] and you don't read a square but a triangle : one angle is in the middle of the hypothenus of the others, you have to do calibra Ɵon/transformaƟon matrix or barycenters ... it's high school maths for the later, but not fun. Small resistor value = bad idea Put 10k Ohm : you get a nice, square reading, values [0 .. 800]. No calibraƟon or post calculaƟon needed. 10k+ resistor value = good idea With thin scisors, cut the screen connector to separate the 4 liƩle tracks to connect Drop a liƩle solder on each. Beware of short cuts and don't burn it (even if it's kapton ) : be swiŌ. Prepare a 4 wire map (flat cable) by presoldering each wire The real hard part: wire per wire, make the contact between the connector track and the wire, heat up to have the solder to melt and make contact, and don't move (makes bad solder) If you're at that point, you're not too bad, kind of cold‐handed guy ^^ So insert a piece of paper between the soldered wires (very close, might short‐cut) and maybe hot glue it or wrap it with tape. TADA! It's done. Goo news is that the wire order is the same as with the connector. oto=https%3A%2F%2Fkalshagar.wikispaces.com%2FArduino%2Band%2Ba%2BNintendo%2BDS%2Btouch%2Bscreen%3FresponseToken%3Dfe8098b7c2709582bda95292239c7612) 2 (/Arduino+and+a+Nintendo+DS+touch+screen#discussion) 26 (/page/history/Arduino+and+a+Nintendo+DS+touch+screen) … (/page/menu/Arduino+and+a+Nintendo+DS+touch+screen) See my other Gameboy related pages See my clocks projects : with voltmeter, with RGB dot matrix, with VFD tubes, ... RealisaƟon Quite easy to do, with inexpensive components (Touch screen is 10$, break board connector 4$ and just buy it, don't be a hero), but with one or two caveats. Sample, wiring and code here under. Everything is basically an applicaƟon of Elm‐chan's very good tutorial hƩp://kousaku‐ kousaku.blogspot.com/2008/08/arduino_24.html (but not in Japanese). You might be interrested in a project I did that uses it, it's the ardReveil. I divided the touchpad in 4 zones in/out/+/‐ and used it as an input and it was quite successful. Project had other problems but at least this was really ok. Caveats and what you should know Buy the breakboard it make your life easier. You can solder directly to the connector, I did it (see below), but I don't recommend it seeing the raƟon complexity/benefit. Just spend 4 bucks. Touchscreen has 2 sides and only one is sensiƟve. Can seem obvious when you know, but I didn't at first... Don't forget the pulldown resistors. Otherwise you have floaƟng results and can't get anything meaningful as a result. Depending on the resistors you will put, you will have different results: There's no limit on how fast you can read as per my tests, knock yourself out! Answering some people quesƟons : it takes 5v at least in the present implementaƟon (arduino runs on 5v). With the big pull‐down (10kOhm), the pull‐down intensity is very low, like 0.5 mA, a triffle. Use the breakboard for the connector if possible. Indeed, my first touch screen fit perfectly and was well bound to it, but ... the 2 recent ones I bought (obviously different models, with greenish border) even though look exactly the same, they didn't fit in the connector ! It looked like ok, but contact was not done and it was loose, the screen going out of the connector as if it was not blocked at all... then comes the Ɵme for real solder‐ soldier: Pictures kalshagar - Arduino and a Nintendo DS touch screen https://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch... 1 of 5 02-Apr-15 3:25 PM

Upload: todd-ward

Post on 30-Sep-2015

219 views

Category:

Documents


4 download

TRANSCRIPT

  • Wiki Home Recent Changes Pages and Files Members

    Search

    Quick Navigaon

    All projects

    Hardware

    Links

    Top projects

    Game boy projects

    Alan numitron clock

    Clapclap 2313/1386

    Smokey amp

    Laser cuer

    WordClock

    ardReveil v3

    SNES Arcade cabinet

    cameleon

    Home Presence Detector

    Contact me

    Who's Alan?

    Favorites

    Hackaday

    ATmel blogAkizukidenshi Eleclab

    EEVblog

    Switchscience

    Sparkfun

    Suzusho Datasheet LibErmicroSkyduino (fr)Marutsu

    Tag cloud

    atmega328

    Arduino and a Nintendo DS touch screen(/Arduino+and+a+Nintendo+DS+touch+screen)

    Put 470 ohm : the read values are [0..200] and you don't read a square but a triangle : one angle is in

    the middle of the hypothenus of the others, you have to do calibraon/transformaon matrix or

    barycenters ... it's high school maths for the later, but not fun. Small resistor value = bad idea

    Put 10k Ohm : you get a nice, square reading, values [0 .. 800]. No calibraon or post calculaon

    needed. 10k+ resistor value = good idea

    With thin scisors, cut the screen connector to separate the 4 lile tracks to connect

    Drop a lile solder on each. Beware of short cuts and don't burn it (even if it's kapton ) : be swi.

    Prepare a 4 wire map (at cable) by presoldering each wire

    The real hard part: wire per wire, make the contact between the connector track and the wire, heat up

    to have the solder to melt and make contact, and don't move (makes bad solder)

    If you're at that point, you're not too bad, kind of coldhanded guy ^^ So insert a piece of paper

    between the soldered wires (very close, might shortcut) and maybe hot glue it or wrap it with tape.

    TADA! It's done. Goo news is that the wire order is the same as with the connector.

    ces.com/site/signin?goto=https%3A%2F%2Fkalshagar.wikispaces.com%2FArduino%2Band%2Ba%2BNintendo%2BDS%2Btouch%2Bscreen%3FresponseToken%3Dfe8098b7c2709582bda95292239c7612)

    2 (/Arduino+and+a+Nintendo+DS+touch+screen#discussion)

    26 (/page/history/Arduino+and+a+Nintendo+DS+touch+screen)

    (/page/menu/Arduino+and+a+Nintendo+DS+touch+screen)

    See my other Gameboy related pagesSee my clocks projects : with

    voltmeter, with RGB dot matrix, with

    VFD tubes, ...

    Realisaon

    Quite easy to do, with inexpensive components (Touch screen

    is 10$, break board connector 4$ and just buy it, don't be a

    hero), but with one or two caveats.

    Sample, wiring and code here under. Everything is basically an

    applicaon of Elmchan's very good tutorial hp://kousaku

    kousaku.blogspot.com/2008/08/arduino_24.html (but not in

    Japanese).

    You might be interrested in a project I did that uses it, it's

    the ardReveil. I divided the touchpad in 4 zones in/out/+/

    and used it as an input and it was quite successful. Project

    had other problems but at least this was really ok.

    Caveats and what you should know

    Buy the breakboard it make your life easier. You can solder directly to the connector, I did it (see below), but I

    don't recommend it seeing the raon complexity/benet. Just spend 4 bucks.

    Touchscreen has 2 sides and only one is sensive. Can seem obvious when you know, but I didn't at rst...

    Don't forget the pulldown resistors. Otherwise you have oang results and can't get anything meaningful as a

    result. Depending on the resistors you will put, you will have dierent results:

    There's no limit on how fast you can read as per my tests, knock yourself out!

    Answering some people quesons : it takes 5v at least in the present implementaon (arduino runs on 5v).

    With the big pulldown (10kOhm), the pulldown intensity is very low, like 0.5 mA, a trie.

    Use the breakboard for the connector if possible. Indeed, my rst touch screen t perfectly and was well bound

    to it, but ... the 2 recent ones I bought (obviously dierent models, with greenish border) even though look

    exactly the same, they didn't t in the connector ! It looked like ok, but contact was not done and it was loose,

    the screen going out of the connector as if it was not blocked at all... then comes the me for real solder

    soldier:

    Pictures

    kalshagar - Arduino and a Nintendo DS touch screen https://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch...

    1 of 5 02-Apr-15 3:25 PM

  • Too many people use this, too few put a diagram. I suck a electronic, so I put a graph.

    One important word : 4x 10kOhm can't be replaced with just one, don't waste me trying.

    With the 10 kOhm resistors, nice reading, no recalibraon : raw results drawn on a 800x800 picture. Life is great.

    BEWARE: this pin assignement is according the code here under. If you have other assignement, just change the

    constants in the header of the Arduino code.

    ces.com/site/signin?goto=https%3A%2F%2Fkalshagar.wikispaces.com%2FArduino%2Band%2Ba%2BNintendo%2BDS%2Btouch%2Bscreen%3FresponseToken%3Dfe8098b7c2709582bda95292239c7612)

    kalshagar - Arduino and a Nintendo DS touch screen https://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch...

    2 of 5 02-Apr-15 3:25 PM

  • Arduino 2009 + 4x 10 kOhm + Connector + DS touch screen. You can do that within 1 hour for sure...

    Links

    Shopping

    Screen (Sparkfun for US, SwitchScience for the japanese) hp://www.sparkfun.com/commerce

    /product_info.php?products_id=8977 hp://www.switchscience.com/products

    /detail.php?product_id=105

    Connector (don't be a hero, spend 4$) hps://www.sparkfun.com/commerce

    /product_info.php?products_id=9170 hp://www.switchscience.com/products

    /detail.php?product_id=178

    Documentaon and tutorials

    Sparkfun's tutorial hp://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=139

    Reading values

    WORKING Same as the link here under BUT in Japanese BUT with a schema ! hp://kousaku

    kousaku.blogspot.com/2008/08/arduino_24.html

    Not working a RGB mixer with a DS touchscreen ... wait a minute, that's EXACLTY what I planned !

    hp://www.arduino.cc/cgibin/yabb2/YaBB.pl?num=1243499684

    Calibraon (no need with 10kOhm pull down)

    hp://www.embedded.com/story/OEG20020529S0046

    EEIOL_2002JUN02_EMS_OPTO_TA.pdfDetails Download 154 KB

    taken from hp://www.eendia.co.in

    /ART_8800503899_1800010_TA_1f833eab.HTM

    Code

    Download code here

    DSTouchScreen_Test2.pdeDetails Download 1 KB

    // Taken from http://kousaku-kousaku.blogspot.com/2008/08/arduino_24.html/*#define xLow 14#define xHigh 15#define yLow 16#define yHigh 17*///modified to match my sparkfun connector#define xLow 17#define xHigh 15#define yLow 16#define yHigh 14

    ces.com/site/signin?goto=https%3A%2F%2Fkalshagar.wikispaces.com%2FArduino%2Band%2Ba%2BNintendo%2BDS%2Btouch%2Bscreen%3FresponseToken%3Dfe8098b7c2709582bda95292239c7612)

    kalshagar - Arduino and a Nintendo DS touch screen https://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch...

    3 of 5 02-Apr-15 3:25 PM

  • (https://www.wikispaces.com/user/view/grokCore)

    You have to go check out for touchscreens!dealextreme[dor]com/details.dx/sku.32592.60!!Seriously.I'll be using this for sure. Just got myArduino 2009 for XMass and my brain isoozing with ideas.

    Hey, this is awesome!grokCore (https://www.wikispaces.com/user/view/grokCore) Dec 30, 2010

    (https://www.wikispaces.com/user/view/shatterz)

    void setup(){ Serial.begin(9600);} void loop(){ pinMode(xLow,OUTPUT); pinMode(xHigh,OUTPUT); digitalWrite(xLow,LOW); digitalWrite(xHigh,HIGH); digitalWrite(yLow,LOW); digitalWrite(yHigh,LOW); pinMode(yLow,INPUT); pinMode(yHigh,INPUT); delay(10); //xLow has analog port -14 !! int x=analogRead(yLow -14); pinMode(yLow,OUTPUT); pinMode(yHigh,OUTPUT); digitalWrite(yLow,LOW); digitalWrite(yHigh,HIGH); digitalWrite(xLow,LOW); digitalWrite(xHigh,LOW); pinMode(xLow,INPUT); pinMode(xHigh,INPUT); delay(10); //xLow has analog port -14 !! int y=analogRead(xLow - 14); Serial.print(x,DEC); Serial.print(","); Serial.println(y,DEC); delay(200);}

    ces.com/site/signin?goto=https%3A%2F%2Fkalshagar.wikispaces.com%2FArduino%2Band%2Ba%2BNintendo%2BDS%2Btouch%2Bscreen%3FresponseToken%3Dfe8098b7c2709582bda95292239c7612)

    kalshagar - Arduino and a Nintendo DS touch screen https://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch...

    4 of 5 02-Apr-15 3:25 PM

  • Help About Blog Pricing Privacy Terms Support UpgradeContributions to https://kalshagar.wikispaces.com/ are licensed under a GNU Free Documentation License.

    Portions not contributed by visitors are Copyright 2015 Tangient LLC

    Built something awesome thanks to this starting me off. Maybe you can link it :)ces.com/site/signin?goto=https%3A%2F%2Fkalshagar.wikispaces.com%2FArduino%2Band%2Ba%2BNintendo%2BDS%2Btouch%2Bscreen%3FresponseToken%3Dfe8098b7c2709582bda95292239c7612)

    kalshagar - Arduino and a Nintendo DS touch screen https://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch...

    5 of 5 02-Apr-15 3:25 PM