Shop OBEX P1 Docs P2 Docs Learn Events
LED Input device — Parallax Forums

LED Input device

johnnyairplanejohnnyairplane Posts: 25
edited 2006-08-14 04:51 in Propeller 1
Hello!
I came across an idea (on the Internet!)
LED's as input devices! mrl.nyu.edu/~jhan/ledtouch/index.html
So, I did some research, came up with this terrific paper!
www.merl.com/reports/docs/TR2003-35.pdf

I quickly got it running on an SX chip, anybody want to try making it a SPIN object?
I'm working on it right now, am new to SPINning, this LED idea is an interesting input device!
freaked.gif This Prop Chip is freaking me out (in a good way!), haven't had this much
fun programming in a long, long time!

post -edit:
Yeah, it's an amazing article! - I'm ready to start playing with the idea....
I still can't get even the lightmeter1.spin program to work the way the article says,
still a spinning newbie!, did you try the .sxb program?
I knew that green led's could be used as photovoltaic 'cells' and are used in some
solar panel 'pointers', quite ingenious also....



Thanks!
John McPhail
"I put the fun in dysfunctional!"

Post Edited (johnnyairplane) : 8/12/2006 5:31:52 AM GMT

Comments

  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-12 03:50
    I came across this nifty bit of code, somewhere amongst the hundreds of threads, thought it was in the propeller object exchange on the main propeller page or the object examples thread, but couldn't find it speed scrolling through it, someone elses work, probably came across the same paper. Maybe this'll help....

    With a 10pF cap across an led & 220 ohm res connected to A0 & A1 this bit-o-code is friggin neat!!!

    Post edit-
    After reading throught the whole 19pg pdf, i found the article quite informative and creative. I wonder if Chip and Beau saw this article? Or if they remember that LED's have the photodiode property when rev biased? As they mentioned in the article encryption/encrypted keyes & the easy ability to copy/hack such data may be a big factor when considering implementing the LEDcomm as a secure key. roll.gif

    Certainly thought the properties of an led in reverse bias would proove beneficial to many projects, especially backlit remotes! I'm surprized i never saw this application on any remote newer than '04 I would imagine some members actually reading the article you posted, the link that's not active, and comming up with some chatterbox boe-bots! LOL lol.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"


    Post Edited (RinksCustoms) : 8/12/2006 5:17:46 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,548
    edited 2006-08-12 04:28
    johnnyairplane,

    Tracey Allen already did this...In fact, I saw him do it in February during an early preview of the Propeller.

    Check this thread about halfway down on the first page...
    http://forums.parallax.com/showthread.php?p=574524

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • johnnyairplanejohnnyairplane Posts: 25
    edited 2006-08-12 04:43
    Beau,
    Thanks for the Assist!, guess I should have done a better search through the forums!?

    Any idea why 'we' need the small capacitor across the LED, I've got it working on BS2 and SX boards without the cap...

    It's a really neat input device, finger reflects light back to led, so an output device (light emitter) becomes
    an input device - that Forrest Mimms was one smart cookie!

    John
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-12 05:19
    yeah, the forum search isn't all that great, could use alittle categorization n stuff

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • johnnyairplanejohnnyairplane Posts: 25
    edited 2006-08-12 05:35
    RinksCustoms,
    Partly perhaps the forums aren't 'sorted', but I honestly just cruised right over that portion of that post,
    maybe my mouse wheel needs some weights to dampen it's 'spinning' motion (pun - he, he....blek!)

    Can you get this lightmeter1.spin program to work correctly?
    I've only been successful at modifying exsisting programs (reverse engineering)....

    I'm feeling like a RPN guy in a algebraic world (again).....
    John
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-12 05:38
    For those having trouble with the Forum Search Engine please see the following thread.

    http://forums.parallax.com/showthread.php?p=562370

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-12 06:29
    johnny,
    yeah first run, i think there's a schematic in the code if you click on documentation view. This prog should work for you as it uses the internal oscillator i think.
    I'm running a "homebrew" dev board, ok it's a DIP40 on a couple of breadboards with a MAX232 (5V ver), video & VGA DAC and 10 element bargraph w/a 10MHz crystal. Ironically the lightmeter.spin works beautifully, but my mini video monitor shows nothing but garbled junk!

    And thank you Chris for the link! You have just shaved hrs if not days off my searching! hop.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"


    Post Edited (RinksCustoms) : 8/12/2006 6:36:14 AM GMT
  • johnnyairplanejohnnyairplane Posts: 25
    edited 2006-08-12 06:34
    Hey! (oh, we're not having that much difficulty 'using' the search engine! just the inability to READ!

    Anyway, I never got the lightmeter1.spin program to work, nor the lightmeter2.spin!

    I started reverse engineering (hacking - which means programming until you can't stay up anymore!)

    Attached is a simple program that takes a LED on p0 and p1, lights it and uses reflected light
    to it in photodiode mode to detect the presence of even a poorly reflective object.
    output LED is on p4

    Simply put,
    Both LEDs light
    Put your finger near the one on P0&P1
    and the LED on P4'll go off!

    Touch sensor with an LED!

    John,
    I put the fun in dysfunctional!
    (and I want to meet a woman who puts the sexy in dyslexic!)

    freaked.gifyeah.gif
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-12 06:43
    I believe the intentions of the lightmeter2.spin was to use the discharge rate of the cap to make a sort of light VU meter by generating a bargraph on pins 16..23 and flash the led on A0 & A1 at a speed determined by how much light it "saw" or didn't "see" I like your theory as well! A lit push button that doesn't really wear out? I wonder if you could use a laser pointer from 10+ft away to trigger the "switch"? hmmm

    now where did i put that damn thing!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • johnnyairplanejohnnyairplane Posts: 25
    edited 2006-08-12 07:15
    A 'Lit' switch that'll never wear out! - that was the idea!

    RinksCustoms,

    The 'switch' (LED) does respond to it's own reflected light, a finger anywhere near it and it activates
    I'm using the clear lens RED LED's (best operation so far!) and it is quite sensitive,
    black pens bodys also activate it (black plastic is reflective to some red).
    a small mirror is quite effective (because of lens on LED)

    Laser Pointers - WORK! - use the same color though, been experimenting with other color LED's in proximity
    to the LED Switch, different color=no work!

    Increase/Decrease the delay after switching to input mode for different sensitivities....
    the BS2 and SX versions seem to be less sensitive to background light, have no idea why,
    perhaps it's my newbieness to the SPIN language!?

    John
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2006-08-12 11:05
    It could be a "lit'l lit switch"

    You could do some really neat things where you have a row of SMT leds and as you stroke your finger across them they light up then go out. You could make a very cool input device with a line of them or a ring of them, just needs a few too many pins. Also doesn't work so well in the dark [noparse]:)[/noparse]

    Graham
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-12 16:39
    Maybe that's why it didn't work for me, the diffused lens must be retaining some light not allowing your code to work properly.
    the idea of a line of leds for something as simple as a dimmer switch/fader control, a great idea!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • El PaisaEl Paisa Posts: 375
    edited 2006-08-12 18:11
    The program ledinout.sin does nothing for me.

    both LEDS stays·ON and nothing happens when I touch the·RED LED.

    I am using the Propeller Demo Board.
  • El PaisaEl Paisa Posts: 375
    edited 2006-08-12 18:19
    The problem seems to be the delay.

    I increased both delays and now the Output LED turns OFF when I touch the Red LED.
  • LawsonLawson Posts: 870
    edited 2006-08-14 04:51
    Graham Stabler said...
    It could be a "lit'l lit switch"

    You could do some really neat things where you have a row of SMT leds and as you stroke your finger across them they light up then go out. You could make a very cool input device with a line of them or a ring of them, just needs a few too many pins. Also doesn't work so well in the dark [noparse]:)[/noparse]

    Graham
    true that!· From the looks of the circuit multiple sensing LED arrays should be able to share a common "drive" pin.· (with an appropriate driver to handle the current)· so an 8 LED array should only take 9 pins.· furthermore inverting the LED on·half the LED circuits·would allow a single pin to switch half the LEDs alternatly between sensing and display modes.· This'd allow a compact 8 LED array that would also self-iluminate giving the programmer controll over the sensed lighting.· (aka it'd work just fine in the dark 'cause half the LEDs are on solid while the other half are sensing light)

    Coooooool stuff
    Marty

    P.S. i have a hunch the capacitor was added to increase the time that it takes the photo-current of the LED to discharge the capacitance of the circuit so that SPIN code can keep up.·(aka assembly code shouldn't need the cap, just the resistor and the LED)

    Post Edited (Lawson) : 8/14/2006 4:55:17 AM GMT
Sign In or Register to comment.