So I am getting some pretty weird readings from the 10-bit analog converter built into the arduino Nano.
I am taking readings from a photodiode and inverting that value with map() so it goes 0->1023 to 1023->0. I do this because the other pin is connected to 5V.
The values seem good for the first few reads and then all of the sudden o get a stream of Zeros and after that its back to the low level noise I expect. Has anyone ever seen something like this before?
This data is just a few seconds of reading and i have manually put in the linebreaks after the groups of Zeros to emphasize them:
Please post a circuit diagram (hand drawn, not Fritzing) and the code, using code tags.
The impedance of the source connected to the ADC input should be less than 10K Ohms. Normally with a photodiode, one uses an op amp as a current to voltage converter and to lower the source impedance.
jremington:
The circuit you posted is not accurate or very useful, but the basic approach won't work at all.
To which error are you referring that makes this inaccurate?
I did not think the circuit would be useful, but I am a "placater", what else can I say
My basic approach is only to read resistance of a diode based on certain amounts of ambient radiation; when this proves to be noisy and too small to detect, I will add bias and filter caps, but currently, I am stuck behind the arduino as of now. The only concern of this thread is to figure out why the ADC is giving false readings at very regular intervals.
Thank ya much for your time in replying, jremington. I loved the slideshow!
Does any one else have problems like these?
Does anyone know why this is happening?
Looks like your sensor is slamming up to full voltage (5V?) , 1023 ADC counts and your map is flipping it to zero. What do you read on pin A7 with a voltmeter?
jremington:
For example, you could identify positive and negative power lead
I am not very good with sarcasm so you will have to forgive me, I cannot tell if you are pulling my leg or not.. I labeled all grounds, 5 volts, and all pins going to the arduino.
jremington:
component leads, etc.
As to the other components: they are literately momentary switches, and in the case of the display it is a "self contained" unit sourcing, and sinking, current from only the arduino's pins listed. The pins are also doubly stated in my arduino sketch.
jremington:
This is because the circuit you are using will not work at all. The ADC is always giving "false readings".
You are mistaken in my verbiage. I apologize. The behavior of the adc pin is different than what is should be/ it should be constant noise all statistically in the same magnitude. It is currently acting as it should butt hen dropping to 0 for the next several readings.
jremington:
A correctly drawn circuit would have been useful.
I wish we had the thumb up emoji, as this retort deserves a thumbs up and or a cheeky grin ;D
edgemoron:
Looks like your sensor is slamming up to full voltage (5V?) , 1023 ADC counts and your map is flipping it to zero. What do read on pin A7 with a voltmeter?
Quite so, also thanks for taking the time to join! I appreciate it!
On dc it is a very constant 50mV, I also have a large .4 Volt ac component on that pin that is from the mains voltage.
edgemoron:
Hope you weren't expecting a read out of degrees Fahrenheit with the photodiode hooked up like that. Needs a little more work.
Oh Hahahaha, You sly dog you! I would never hope that: As a scientist, it is centigrade all the way!
Just yanking your chain hehe,
It is still in the calibration and proving stage... I feel like I will have to add a separate mapping function for each quantum coloring layer of the heating metal. But that is when I get there... lol
right now I am essentially just adding a resistor to an analog sensor and not getting the expected result: consistent noise/consistent lack of noise.
Tech-Guy:
This data is just a few seconds of reading and i have manually put in the linebreaks after the groups of Zeros to emphasize them:
Immediately obvious that that's mains pickup... In low light a photo diode is extremely high impedance(*) and
will need to be shielded thoroughly from capacitive pickup.
Normally you'd reverse bias a photodiode and measure the photocurrent using a 10k/100k/1M resistor or some
fairly high value. This prevents the impedance being super high and gives a very linear response.