This instructable will explain how to create your own light sensing LED,making some changes,programming the microcontroller,makingit on a breadboard and soldering the circuit.
A short video of it in action:
Remove these ads by
Signing UpStep 1: How Can The LED Sense Light?
The LEDs will be sensitive to the light which has the wavelength equal to it or lesser than it.
When light falls on the LED a small voltage is produced this voltage produced can be fed to a microcontroller which can read it and follow the further instructions.












































Visit Our Store »
Go Pro Today »




but you will need much more res.
setfreq M32
There is only part of a program here.
What about the 'readadc' to get the b0 value and the code to tie those snippets together?
I'd have written the program as:
do
high 2
pause 1000
end if
loop
but either way works.
How about putting in spaces after full stops in your text? It would make it a lot easier to read. Also, you mention the schematic in your text but I can't see it there. It's a very simple circuit but that would make things a lot clearer. All in all though, a good start.
There is another way of doing this which is more sensitive. The LED junction is first 'charged' and then the state of an input pin checked after a time. The discharge rate is related to the light level so can be used as a dark / light switch.
P.S. It's not a good idea to display your e-mail address like that unless you want all sorts of spam turning up in your mailbox.
I think you've got the chip in upside-down in your title picture!
Speed should not be a problem. If you're running this without the programming resistors, make sure that the chip pin 2 is tied to 0V otherwise you can get strange things happening.
Which of the programs gives you the short interval blink? The 'pause 1000' should give you a 1 second blink (at 4MHz) when triggered. Another thing you could try is a 0.1uF capacitor across the supply, as close as possible to the chip's power pins. (This is good design practice for any digital circuit.)