Go Back   PICAXE Forum > Archives > PICAXE Archive 21
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Links: PICAXE Website PICAXE Manual Datasheets Online Store Software & Drivers

 
 
Thread Tools Display Modes
Old 17-01-2007, 05:57   #1
wilf_nv
Senior Member
 
Join Date: Jan 1970
Posts: 204
Default Simplest dark sensing LED flasher

Simple is as simple does and it doesn't get any simpler than this.

<A href='http://www.user.dccnet.com/wrigter/picaxe/darksensingLEDflasher.gif' Target=_Blank>External Web Link</a>

Flashes LED when very dark. Easily detects the presence of a RED LED emitter across a dark room. Several of these dark flashers in a dark room interact quite nicely in complex ways. Tested with an 08M but should work fine with an PicAxe 08. Standby current when light is 80uA and in the dark, while the LED flashes with 10% dutycycle, the average current is 500uA.

No LED resistor? You do the math.

wilf


Edited by - wilf_nv on 17/01/2007 06:06:19
wilf_nv is offline  
Old 17-01-2007, 06:24   #2
Dr_Acula
Moderator
 
Join Date: Jan 1970
Location: Adelaide, Australia
Posts: 2,505
Default

That is cunning.

I remember once seeing a mathematical explanation of why a group of fireflies end up flashing in synchrony. With a lot of these circuits and a bit more code to adjust the delays it might be fun to explore...
Dr_Acula is offline  
Old 18-01-2007, 11:16   #3
acrylic
Member
 
Join Date: Jan 1970
Posts: 59
Default

Ummm, I want to do the math, but I don't know what I should be adding or subtracting (or multiplying or dividing)!

So, ummm, why no LED resistor again?
acrylic is offline  
Old 18-01-2007, 12:13   #4
BeanieBots
Moderator
 
Join Date: Jan 1970
Location: UK South Coast
Posts: 7,852
Default

(Vcc-Von_led)/(IOsource_Z+IOsink_Z) for peek I
X duty for average I

IOsource_Z and IOsink_Z are the output impedances of the PICAXE IO lines for each state. These can be found in the PIC datasheet and will also be a function of the supply voltage. Then multiply by the on/off duty cycle to get an average current draw.
BeanieBots is offline  
Old 18-01-2007, 20:54   #5
wilf_nv
Senior Member
 
Join Date: Jan 1970
Posts: 204
Default

&quot;So, ummm, why no LED resistor again&quot;

Because to be the simplest flasher, it should have the fewest components and in this case we can eliminate the LED resistor if the current can be limited by the internal resistance of the two picaxe outputs at the maximum supply voltage of interest (4.5V).

We must try not to exceed the maximum load current for the 08M picaxe outputs which is 25mA per pin.

The maximum current flows when the LED is on.

I measured the average current using a multimeter as 500uA and the dutycycle of the flashing LED is 1/10.

For simplicity, we can ignore the Picaxe quiescent supply current and assume that all the measured current flows through the two outputs connected in series with the LED.

Given those values, the peak output current during the time that the LED is on must be Iavg/dutycycle = 5ma.

This does not exceed the max output current so we can get away with no LED resistor for this particular application.

wilf

Edited by - wilf_nv on 18/01/2007 20:55:39
wilf_nv is offline  
Old 18-01-2007, 21:51   #6
manuka
Senior Member
 
Join Date: Jan 1970
Location: Wellington,NZ.
Posts: 2,809
Default

Well done! This is super tempting to take further as an educational stimulator, since it'd quickly get kids curiosity going &amp; motivate them to investigate the background. See the likes of <A href='http://mvh.sr.unh.edu/mvhinvestigations/light_investigations.htm ' Target=_Blank>External Web Link</a> Interested?

You've jogged my memory over a long standing interest in LED based light detection,with even IR types being capable of such persuasion. Naturally the effect of using different colour LEDs spring to mind in your bare bones flasher. Now where's that breadboard... Stan
manuka is offline  
Old 18-01-2007, 22:30   #7
premelec
Senior Member
 
Join Date: Jan 1970
Location: Colorado USA
Posts: 1,216
Default

Hi Wilf - I admire your search for minimalist functionality! I wonder if you have _measured_ the peak current [say with a 1 ohm resistor in series with LED and scope] occuring when run with a hard power supply?

I have gotten a similar effect with a soft power supply so that when an LED turns on it forces a reset of the PICAXE... :-0
premelec is offline  
Old 18-01-2007, 23:04   #8
wilf_nv
Senior Member
 
Join Date: Jan 1970
Posts: 204
Default

Thanks,

my mission in technology is to do more with less and ultimately, by reductio ad absurdum, to do everything with nothing. 8^)

One factor I have not fully investigated is reduced &quot;short circuit&quot; output current while the 08M is in the NAP mode which is the case here used to conserve power.

I will measure the peak current in the normal mode and in the NAP mode with my DSO and report the results.


Edited by - wilf_nv on 18/01/2007 23:11:44
wilf_nv is offline  
Old 19-01-2007, 00:54   #9
manuka
Senior Member
 
Join Date: Jan 1970
Location: Wellington,NZ.
Posts: 2,809
Default

Well this certainly works OK, but the LED type seems quite crucial,as some reds here just would not illuminate at all. All whites to hand (typically ex. cheapo solar garden lamps)gave a superb performance however, as did my favourite &quot;Jaycar Blue&quot;. As whites have a yellowy phosphor dollop on their underlying blue LED, PV performance is often only modest.

Out of interest, &amp; since the down under summer sun is at it's obliging best, I exposed several LEDs outdoors &amp; recorded their resulting &quot;PV&quot; reading on a DMM.

Colour ~bright sun voltage (unloaded)
--------------------------------------------
Clear green 1.6V
Frosted yellow 1.5V
White &gt; 1V
IR 0.8V
Frosted blue 0.8V
Plain red 0.2V

LED responsiveness to illumination changes was most striking, although the IR LED readings remained much more constant as this varied, perhaps due to nearby thermal sources (shielding hands etc) as well.

We're in a fascinating era for LED lighting applications, so further work as dual purpose sensors sensors may be very productive - &amp; fun!
manuka is offline  
Old 19-01-2007, 06:12   #10
Jo C
Senior Member
 
Join Date: Jan 1970
Location: Melbourne
Posts: 245
Default

I did a similar test to Manuka's on a few LED's of different colours, looking for sensors to use on a solar tracker, and the yellow and green LED's were the outright winners. Red LED's barely produced a few millivolts.

Solar tracker central: <A href='http://www.redrok.com/main.htm' Target=_Blank>External Web Link</a>.
Jo C is offline  
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 16:55.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) Revolution Education Ltd 2007