LED sensing and communication

Mycroft2152

Senior Member
I just saw this about a very clever use of LEDs. The lEDs are used both as a light source and a light sensor.

There is also an article about using a visble LED for serial communication.

<A href='http:// http://www.hackaday.com/entry/1234000873073550
' Target=_Blank>External Web Link</a>

Here's the original paper

[a}http://www.merl.com/publications/TR2003-035/

This is a definite next project for the PICAXE.

TANSTAAFL!

Myc
 

BeanieBots

Moderator
The link didn't work for me either.

The subject of using LEDs as sensors came up a while back in relation to aligning solar arrays. I had a play and they do indeed produce a voltage when strongly illuminated. However, out of many types tested, none gave a signal strong enough to be read by a digital input. From memory, I think it was green that gave the best response but even then it required a very strong light source and was very directional.
Ideal for aligning a solar array but I doubt a &quot;standard&quot; LED would be any good for comms driven by another LED more than a few inches away. Perhaps if a good high gain buffer were used and/or an LED of a type I've not tried.
 

Mycroft2152

Senior Member
Try this link http://www.hackaday.com/entry/1234000873073550/

<A href='http://www.hackaday.com/entry/1234000873073550/
' Target=_Blank>External Web Link</a>

Myc
 

manuka

Senior Member
&quot;2 way&quot; LEDs were an old trick best suiting a disguised front panel, as an idle glance would not realise they also sensed- LDRs are pretty distinctive! Only a single mount hole was needed too, but the feeble ouput needed amplification. This could be via even a simple NPN transistor with the LED connected to the NPN base. A bonus was autofiltering as the response was best to light of the same colour as the LED.

Although LED detectors certainly are fast &amp; could probably handle Picaxe serial data (perhaps pulsed from a $2 laser pointer?),it's usually MUCH easier detecting basic light changes via a (slower) LDR, especially under Picaxe READADC.

When solar PVs were costly I recall stringing a stack of LEDs in series, but small (postage stamp sized) PV panels now abound for peanuts. A typical calculator amorphous PV will deliver 2V at 3mA, with solar garden lamp polyX types up to 4V at 30mA. These can even power the Picaxe itself!


Edited by - Stan. Swan on 2/23/2006 10:38:22 PM
 

Mycroft2152

Senior Member
That's all true Stan. My first PICAXE project was a BEAM robot powered by a solar cell.

The current values are correct, but only in full sunlight. The availible current drops significantly with less light. Thus the need for a &quot;Solar Engine&quot;

The LED sensor described in this link does not need an amplifier. The circuit uses the inherent capacitance of the LED to determine whether it is on or off. Follow the links, and you will find a simple PIC program to do this.

There is a very clever application using an 8 x 8 LED array as a touch sensor. The video of it in action is amazing.

Myc
 

hippy

Technical Support
Staff member
I looked at the MERL project before ( assuming its the iDropper - can't seem to get any of your links to work ) and I did start to design some code for it for a PICAXE.

The problem I had was in getting one LED to activate another into a PICAXE. I could use READADC, an 08/M allows two pins to do the toggling and switching input/output etc as desired but switching wasn't quick enough, and straight Digital In didn't pack enough voltage. Don't have a scope so I couldn't see what was happening.

Once you cut through their rather vague description of the protocol it's actually quite easy to use. A simple mod allows 16-bit shift registers to be used.
 

tarzan

Senior Member
http://www.merl.com/reports/docs/TR2003-35.pdf <A href='http://www.merl.com/reports/docs/TR2003-35.pdf' Target=_Blank>External Web Link</a>
 

mikek

Member
Regarding Hippy's post, I tried this with an 08M. I found it worked only with a really old (&gt;5 years, possibly &gt;20 years) green LED. Anything more recent (that is, new) didn't seem to change ADC readings between light and dark. Even when it did work the readings varied, and were sensitive to power supply issues, having the download circuit connected, and such. I read somewhere that even the capacitance introduced by a protoboard changes the behavior of the circuit.

Mike
 

hippy

Technical Support
Staff member
mikek : I recall having similar problems to start with. Try making the pin a LOW then an INPUT then doing a READADC ( but I may be making this up from a dream I had ).

Try the LED on a multimeter. I found you need quite bright light ( sunlight ) to really kick them in, indoors in evening very low erratic readings. IR LED's seemed to work best and give largest voltage.

Edited by - hippy on 2/24/2006 5:28:39 AM
 

Michael 2727

Senior Member
You can use an FLED (Flashing LED) as a low
HZ, 1 to 2 HZ clock signal if you really get stuck.

You don't even need to drive it with enough
voltage/current to light the LED the internal
flasher circuit still ticks away supplying
the pulses.

Edited by - Michael 2727 on 2/24/2006 5:58:02 AM
 
LED's make neat simple &quot;no parts&quot; light sensors. 08M's are sensitive enough to detect light levels from the photovoltaic effect on the tiny silicon junction in the LED. They can be used in projects in place of the conventional LDR resistor potential divider.

Use readadc to check the light level in ambient to sunny (NZ) conditions by just hooking one up direct to an input pin and measuring the voltage with readadc/10

For kids projects this is fun and economical as the 'eyes' on your virtual pet can be quite literally that &quot;Eyes&quot; that work and sense light level.

You can then turn around and light up the same LED's from the same input pin (if you use an 08/M) with an output command. Remember you will need to reverse the function of that pin back to an input before you do another readadc.

=================================
Optical serial data links... I have used the cheap &quot;$2 shop&quot; lasers to set up an IR data link as follows...

First confiscate a few laser pointers off your problem students...

<b>Tx </b>
An 08/M will sink sufficient current to drive the laser directly with a 4.5 volt 3 x alkaline AA battery. Though a BC337 would be kinder to the 08 there is a safety margin here; driving the laser of the PICAXE current limits things somewhat. A transistor switched laser pointer off a fat 4.5 volt 3 x AA alkaline supply would probably overrate the laser and any direct accidental eye that came in contact.

I just poked N2400 serial data from the 08 out of pin 4. Hooked the laser -ve terminal to pin 4 and the laser pointer +ve direct to +ve.

<b>Rx </b>
I decoded the laser beam data on the other side of the room with a photo diode / resistor potential divider. (or enabled internal 08M activated WPU)

A photo diode worked better than an LDR which seems to have a too sluggish response? to follow the serial data.

As an aside... As per the Melbourne PICAXE conference last year... You can wave the laser pointer across the ceiling and &quot;SEE&quot; the serial data 1's and 0's as the beam is flashed on and off at the baud rate of your choosing. The data is seen as a series of dashes and spaces.

- Andrew




Edited by - Andrew Bright Sparks NZ on 2/24/2006 8:51:20 AM
 

Dippy

Moderator
Andrew, where do you get 2 buck Infra-red lasers? I've been after some for ages.

And LDRs are phenomenally slow cw pds.

Post Script:
OH, I've just re-read.
&quot;I have used the cheap &quot;$2 shop&quot; lasers to set up an IR data link as follows... &quot;

Optical red rather than IR I take it? I though a &#163;1 infra-red laser was too good to be true.

(Hope you're taking safer eyesight precuations than the average student?)


Edited by - dippy on 2/24/2006 9:26:42 AM

Edited by - dippy on 2/24/2006 9:30:32 AM
 

Michael 2727

Senior Member
The $2.00 shops here sell stuff more than $2.00 worth, but most items are that or less.
I think you still pay $5 to $7 for a cheapie
laser keyring etc, and the quality can be very
poor. They probably get the seconds from the
diode manufacturers and trun them into cheapie toys.
 

rfs

Member
A couple of addresses that might be useful for both the
LED sensing AND IR LED threads?

Simple=
http://www.zen22142.zen.co.uk/Circuits/Misc/lcs.htm

More complex =
http://www.g0mrf.freeserve.co.uk/laser.htm

And for further research, look at the Spectran and Spectrogram links in site 2.
(Slow CW)
SEEING signals under noise. Amazing.

Be warned:- these two Spec. programs are addictive!

Apologies if I've broken protocol, re. addresses.

Rob S


 

Dippy

Moderator
Very interesting stuff.
And a link to a decent source of a huge range of laser diodes too.
Just what the eye-surgeon ordered!
 
Top