I am using Arduino Due and currently working with the photodiode and Dual wavlength LED circuit.
when I connect photodiode with opposite direction with 1M Ohm resistor in GND, connected to photodiode. The change upon light ilumination appreared in arduino serial monitor.
Each wavelength of LED is switced along the clock using Duetimer code.
But I also can see the envelop-like shape in the signal.
I guess it is noise from photodiode or Arduino due itself.
is there anyone who also experienced this problem and dealt with it already?
I tried to add capacitor (10uF, 220uF between source and GND) and buffer using OP-AMP.
still I couldnt solve that.
Can I get some comments?
Can you give the schematic? also what is the application you want. I understand your want to do some kind of signal or frequency meter... if so, what kind of frequency do you expect?
Sorry for late reply. Now I am just found how to upload my file and figure.
first attached is about simple schematic how I connected,
Just consider two LEDs as one dual wavelengths
The second figure is the measured data from the photodiode
One photodiode collect each wavelength intensity with same timing.
However, there is some critical noise depending on the sampling rate. (x-axis is second unit)
Third one is about code what I wrote.
When I measure voltage in each pins using multimeter the main source of noise is coming from the photodiode itself. I think I connected in right way (connection to opposite)
But I dont know about the additional circuit to reduce the noise.
Can you guess what causes the noise in my work?
smd.ino (2.65 KB)
I keep not totally understand the purpose of your sketch... But it seem normal to have that kind of wave on the photo cell, because it take some time to eat. But not that much. If you want to have something more like a dc signal on the input, At this low frequency it not gonna be easy with a cap.
I suggest you do it by sofware with debounce.
BTW, next time for code posting on the forum, use the 'code' tag on the top of editor and add it here.
A photodiode needs an amplification circuit before connection to the Due's analog input. Please have a look at this tutorial by Analog Devices.
Common Photodiode Op-Amp Circuit Problems and Solutions