Led Touch-Sense "Case Re-opened"
Lab Rat
Posts: 289
I am reopening a completed project that i tried and failed. LED Touch-Sensing.
I am using the Basic Stamp Homework Board with an imbedded BS2.
I wrapped my LED's with black electrical tape except for the very tip.
I am using the LED's provided in the Whats a microcontroller kit.
I am attaching the code that i used for my attemp. could anyone tell me what going wrong. it doesnt work like it is supposed to but it works if i touch a lead from the led instead of the tip. HELP!!!
Thanks
I am using the Basic Stamp Homework Board with an imbedded BS2.
I wrapped my LED's with black electrical tape except for the very tip.
I am using the LED's provided in the Whats a microcontroller kit.
I am attaching the code that i used for my attemp. could anyone tell me what going wrong. it doesnt work like it is supposed to but it works if i touch a lead from the led instead of the tip. HELP!!!
Thanks
bs2
694B
Comments
I have a few 10mm LED's i know i have blue but i might have white. i know i have white 5mm. do you think that the larger LED might solve it.
PJ i am gonna have to agree with you the DEBUG "off" it takes up alot of space in the debug window. i put the PAUSE 100 at the end because i wanted to slow down the poll cycle.
A moderator moved the "project" that you'd replied to out of Completed Projects and into The Sandbox. Short of The Dustbin, or the Propeller Forum, I guess that's the best one can expect.
Some links: here and here
If it's sound, then why isn't it all around us? Why isn't this on everything coming out of PLA_Mart?
Claims aside, this is what engineering is all about. LEDs are not designed for this use and the junction capacitance is not at all controlled since it's irrelevant to the normal use of an LED (as a light source). Similarly, the amount of charge injected into the junction capacitance is not controlled. Based on existing demonstrations, this technique is usable, but may require a level of part selection and circuit and algorithm tuning that's prohibitive for mass production. If it's important enough for mass produced products, someone will eventually produce LEDs designed (or selected) for this use. Like a lot of similar things (like plasma displays), this sort of thing will appear first in premium, low volume products and eventually may make it to mass production.
also im gonna start tapeing over my power indicators just incase they really can talk lol
i actually have a homework board in the scrap pile i fried it last year. i just dug it out and im gonna use morts parts from it again lol
To Heck with revelation already, I'm still waiting for documentation.
How about looking at the links I posted? They're to one person's experience with small arrays of sensors ... hardware, software, and documentation. One of the last postings in the list off one link has some musings about what this technology is good for and what it's not good for (like sensing in sunlight).
im starting to get this funny feeling that the bs2 isnt gonna cut the mustard.
i was hoping that i would be able to figure it out on the homework board then transfer it to its own circuit and run it independant of the stamp
In it's simplest form an LED is nothing more than a P-N junction on silicon. ALL P-N junctions exhibit photon emission properties as well as photon absorption properties. Depending on how you dope this junction you can exaggerate one feature over another to form an LED, Photo-diode, or several other options that exist in between.
A P-N junction acts as a conductor (diode) when it is forward biased.
A P-N junction acts like an insulator (forming a capacitor) when it is reverse biased.
A P-N junction exposed to light will conduct proportionally to the amount of light at the junction, thus making a P-N junction configured as an insulator act like a capacitor with a resistor in parallel. (discharging the capacitor)
So the whole idea of using an LED (P-N junction diode) as a switch requires you to use it in a reverse biased mode. This mode charges the 'capacitor' formed across the P-N junction. Once this capacitor is charged, you monitor the discharge until the voltage falls below the threshold of the I/O. Less light equals a longer time before the threshold is met, while More light equals a shorter time before the threshold is met.
It's also possible to use multiple LED's in parallel to increase the overall effect, or to place an external (small) capacitor to slow the effects. Remember though, each P-N junction with multiple parallel LEDs have it's own P-N junction capacitor to deal with, where an external cap only has the one P-N junction to deal with. In other words if the capacitor is too large, the effects by the time the I/O threshold is reached may not be easily distinguished.
Enough talk, already, let's see the work - the proponents'/advocates' work.
Here is some of the work that Tracy Allen did on it using the Propeller Demo Board.
I just put this together using a RED led, and omitting the 220pF capacitor and it worked just fine on the Propeller Demo board. Actually it started sensing the shadow of my hand about 1ft away from the LED!!
http://forums.parallax.com/showpost.php?p=574644&postcount=8
The [code] formatting is messed up on that page, so refer to the lightmeter2.spin program that he has attached to the link.
Binning of leds is done with Luxeon leds, this makes standardization of leds for qualitites like uniform capacitance possible.
I made a project that uses 32 leds as sensors in a musical device.
http://forums.parallaxinc.com/forums/default.aspx?f=21&m=376422
The bs2 might be too slow for led sense, if someone has a scope they could run a test with a few scope shots to show the RCtime of the typical led junction capacitor.
http://forums.parallaxinc.com/forums/default.aspx?f=21&m=128677
LEDsensor_TDW_001.spin by Timothy D. Swieter about half way down the first page. A few quick changes to some of the constants and it works great.
I generally use LEDs in this way with an SX which is fast enough to monitor the discharge. I also usually limit the "longest" discharge (when it's dark rather than bright) as "dark enough" otherwise the system must wait too long between readings.
See this thread -- http://forums.parallax.com/showthread.php?t=121817
The LED emitter/light sensor is the single LED that has both anode and cathode hooked up to I/O pins (RC.6 and RC.7).
How ever I play around with the timeing and found that if you made the PAUSE to short or to long it did not work right at all
Also I found that GREEN LEDs work the best for this
[PHP]
dly1 = 1
dly2 = 50 'Changing This Value Will Change The Light Level Respone
dly3 = 100
[/PHP]
If you make the pause to short then It will not work right
[PHP]
DO
HIGH led
LOW chg
PAUSE dly1
'charge
LOW led
HIGH chg
PAUSE dly1
'input
LOW led
INPUT chg
PAUSE dly2 'Changing This Value Will Change The Light Level Respone
DEBUG CR, DEC ? chg
IF chg = 0 THEN ' what ever you want to do next
LOOP
[/PHP]
I'm sure I posted the attached program in some other thread, but here is a BS2 demo LEDphotometer. It makes a fine photometer over a wide range of light levels, and the choice of a green LED does seem to be optimal.
It is an interesting idea you have, to try it with a bar or circle type display. I recall that difficulties with the circuit have to do with picking up extraneous electric fields, so short wiring and shielding are in order to achieve best results.