I’m trying to make a light measurement device with Arduino. Until now, the project is a phototransistor connected to the analog pin 0 and the value is passed to the pc through the serial port. The schematic is below
and the code is
my doubt is about the values captured by the analogic port. The values stay between 65 and 1023. How can I modify the circuit to get values between 30 and 1010, for example?
Or, anybody have a better idea of how can I make a light measure system with Arduino?
thanks for your help
Get rid of the 1K resistor and you will get closer to a 0 reading in full light. If you want the reading to be high with full light, then swap the 33K resistor and the photo transistor positions in the schematic.
If you want full values to not hit exactly zero or 1023, then you can add other resistors. To avoid a 1023 reading on your current schematic, place a high-value resistor in parallel with the photo transistor so that some voltage is present even when the photo trans is switched off. To avoid a zero reading, well you're already doing that. ;)
Experiment to see what you get. With 5V and GND as your input levels, you won't hurt the Arduino pins very easily, unless you short something out.
All good advice apart from:-
you won’t hurt the Arduino pins very easily, unless you short something out.
What do you have to short to what in order to damage an Arduino pin set as an input? I don’t know. :-?
Heh. I’m sure I could accidentally figure out some way to do it when it’s many hours past when I should have gone to bed. :
thank you koyaanisqatsi, you really helped me!
Is there a way to use 20 bits in the analogic in instead of 10 bits?
Something like a circuit between the Arduino and the circuit that contains the photo transistor.
Is there a way to use 20 bits in the analogic in instead of 10 bits
No you can't change the resolution, you can change the sensitivity with an amplifier though.
There is an article here that you may find interesting: http://www.automotivedesignline.com/191000257
Perhaps if you say more about what you are trying to do it will be easier for people to help you find ways to do it.
I just thought if there is a way to use two analog inputs though an external circuit and then, the accuracy of the light sensor could be increased. So, the range of the light intensity for each number returned by the analog input could be lower.
What resolution do you need and what is the resolution of your photodiode?
Sorry, I didn't explained what is the project.
The system will be used to verify the Malus' Law and the maximun of light intensity in the single slit diffraction. I'm student of computer engineering.
Today, I tested the system with a laser and two polarizers.
The value in the maximum light intensity was around 850 and minimum, 1015.
Anyone knows how can I change the circuit to modify the its sensibility to get, for example, 100 in the maximum light intensity (currently is 850) and 1000 in the minimum light intensity?
thanks for the help
For that kind of precise optical measurement application you might want to consider a better sensor. Here is one from Sparkfun that is easy to interface with and has large dynamic range. There is also a link to a Arduino sketch one member used for his photography use.
I’m from Brazil and I found the el7900 and TSL230R here, but the EL7900 is much more cheaper than TSL230R (6x cheaper).
If I choose to use the EL7900, how I connect it to the arduino? Just connect the OUT pin to the Analog input? or should I connect a 10k resistor and a 25uF capacitor in parallel, like the figure 10 in the data sheet? (http://www.intersil.com/data/fn/FN7377.pdf)
thanks for the help
The capacitor is only to smooth the signal and slow down the response. You should only use it if there is too much noise (variations from reading to reading) on your input.