Hi everybody !
I'm working on building my own IR touch frame, for those who are wondering what is it, let's check for PeauProductions products :
I have been working for few days on some solutions and I would like to show you what I want to do... The main question is "Will this mess work ?" I am not an expert so feel free to tell me things that are going wrong. Instead of asking you a question without any context, I will try to show you my reflexion, maybe that could help...
(And I'm sure you've already guessed that english itsn't my first language :p)
So take a cup of tea or coffee and let's go !
An Infrared touch frame is based on an array of IR Leds and photodiodes (or phototransistors but I'm currently working with photodiodes) forming a grid, when a person touch the screen, he stops the IR flow horizontaly and verticaly, puting some diodes in the shadow, we can then compute the actual position of the finger on the screen.
My frame is a 64*64 points touch screen, that means 64 IR leds facing 64 photodiodes verticaly and another 64 IR leds facing 64 photodiodes horizontaly. The microcontroller is an arduino micro acting as a HID device.
This projet has many concerns, basically the IR leds draw 100mA EACH ! So the deal is to power them one by one and to check the facing photodiode(s).
=> - IR LED
)= - Photodiode
=> )=
=> )=
=> Only one powered on )=
=> =================================== )=
=> )=
=> )=
=> )=
(64 times)
This post isn't about powering the IR LED but about dealing with the photodiodes (and reading 128 values !!!)
Let's start with one photodiode, so easy, here is the basic usage schema of a photodiode (thank you the internet)
Yeah ! It is mount "reversed", basicaly, as light hits the photodiodes a reverse current flows into it. So the more light hits the photodiode, the more current can flows and the voltage of the photodiodes changes (and the resistor too).
The A0 wire is connected to the A0 pin of an arduino, I have already tested this design and it works
Oh and the photodiodes I am using are BPN10NF from Vishay.
As mentioned before, there is 128 photodiodes, 64 on the vertical side and 64 on the horizontal side. Lets focus on one side only, so 64 photodiodes, 64 times the previous schema...
Hum.... No !
It is pointless to measure the 64 values (and to power on the 64 photodiodes) "at the same time". Let's remember that there is only one IR Led ON, I could measure only the facing photodiode, I will actually measure the one facing and some adjacent photodiodes to increase precision. Let's say... 8 of them
Actually, I will power on 8 photodiodes and read their value using a demultiplexer like the CD4051BE.
So basicaly, a PNP transistor is controlled by the Digital Pin D5 of the arduino, by puting D5 to LOW the transistor will let the current flow and power on the 8 photodiodes (there might be one resistor missing between D5 and the base, true ?) The transistor hasn't be choosen yet, so don't considerate its name.
The DEMUX is controlled by the arduino through D2, D3, D4 and the value of each photodiode is read on A0 (obsviously not exactly at the same time but the DEMUX and the Arduino are fast enought to get something interesting).
The transistor seems to be useless... but it is not... Let's imagine I would like to measure 8 more photodiodes, I could duplicate this schema... or I can try something like this :
Lovely isn't it ? The deal is to wire up 8 others photodiodes in parrallel with the first ones and to "switch on" only one transistor to read the value from the photodiodes wired to it.
! AND HERE IS MY QUESTION !
???? DOES IT WORK ????
I have a massive concern about potential current leaks... For instance if I power on the second line of photodiodes (D9-D16), is there any risk of a current leak to D1-D8 photodiodes ? And how the other transistor will react, will I break it ?
If the answer is NO, IT WON'T WORK... it is useless to go any further...
If the answer is YES, IT WILL WORK ! The next step is to use 8 lines of transistors wired to 8 photodiodes each, and here we go ! 64 diodes on a single Analog In on the Arduino !
Of course I won't use 8 Digital Out pins to control each transistor. Instead I will use another CD4051BE (or maybe a stronger one) but this time as a MULTIPLEXER to ground the required transistor's base with only 3 Digital Out of my arduino.
Here we are ! It is such a long post, I know... But I hope you could help to make it real !
Thx a lot !
Sylvain