Alright, if I want to have a LED and photodiode on the same circuit, is there any way to filter the light out from the LED so that it doesn't affect what the photodiode is picking up? I want them to have seperate functions.
Oh, and a possible coding for incorporating these two things together (amps and resistors included) that'd be cool too. But I'm more concerned with the problem above.
I can't give you a picture (mostly because it's an idea in the works). I mean, I'm trying to get an LED to illuminate on a phosphor so that the phosphor emits a light that the photodiode can pick up. But I don't want the light from the LED to interfere with the readings I'm getting back. Lots of science-y mumbo jumbo type things.
I can probably figure it out if I get some kind of wiring schematics for hooking up LED and photodiode on the same wiring system.
Yikes. Just thought I'd make my problem a lot simpler to put.
I'm using a LED to activate a phosphor which will then emit light (at least 3 ms in time) and then the photodiode will pick up the readings given and I'll calculate the decay time based off of the volts then received by said photodiode. I don't want the LED in my readings in the photodiode, because then my readings on the phosphor will be useless. I want a filter so that the photodiode won't pick up the LED readings too.
So you want to monitor the glowing phosphor after it is "charged up" by an LED?
Just turn off the LED when you start reading the photodiode.
// declare variable, pinModes, Serial.begin, etc.
void loop(){
digitalWrite (ledPin, HIGH);
delay (3);
digitalWrite (ledPin, LOW);
for (x=0; x<100; x=x+1){
photoReading[x] = analogRead(analogPin); // declare int photoReading[100], size as need - 2 bytes used per sample; keep < 750 (1500 bytes), '328P only has 2048 bytes
delayMicroseconds(500); // or whatever you select, but >=4
}
for (x=0; x<100; x=x+1){
Serial.println(photoReading[x]);
}
}
OK, that makes more sense now - you want to monitor the phosphor decay, rather than just its output whilst being excited.
Quite different problem - it will only start to decay as such after you turn the excitation LED off, so that seems to be the solution - turn the LED off, then start monitoring.
Filtering/ separating simultaneous light wavelengths is a more difficult situation, optical filters are not highly selective, if you seriously need to separate wavelengths, you need a spectrometer type of system.