I would like my led light to turn on when a certain number of volts is sent to the photo eye, not just when the photo eye is on. Is that possible?
If you have a light dependent resistor, then this might help:
No, nothing you can afford can.
But it can get close
Give a man a watch and he knows exactly what time it is.
Give a man two watches, and he is not sure.
Yes. The basic logic is if(X == 200) or if(X > 200), or whatever the number turns out to be.
If your photo-eye puts-out an analog voltage (not just high or low) you pretty much have to do that.
The ADC reads voltage but it doesn't actually give you "volts" without a calculation. And, there's no need for your software to calculate voltage if you can figure-out what the "number" should be.
But... Nothing in the analog-world is "exact", and that usually goes for analog-to-digital conversion too. So, more-often we look for greater-than, less-than, or a range that's "close".
In engineering & science we rarely say "exact".
Digital CAN be exact but you have to know if the digital data is coming from analog because the digital number might not be exactly what you expect..
...If you are making an alarm clock (time is analog) you usually don't look for an exact time. You check for the alarm-time or later, just in case the software "misses" the exact match.
Eggs are digital. You can have exactly one dozen eggs.
Milk is analog. There's not exactly a gallon of milk in a one-gallon jug. One jug might have one drop more or one drop less, etc. (And, this is the reason they can "get away" with pricing gasoline at $5.99 + 9/10ths of a cent per gallon!)
It's more like because a $0.01/gallon tax was added to gasoline in 1932, and gas stations didn't want to add 1 cent to their price when gas was sold for only around $0.20/gallon at the time, so they added 0.9 cent to the price, and consumers didn't really notice it. It's pricing psychology.
In engineering we say "close enough".
How do you manage to "send" a voltage? UPS? DHL? FedEx?
not sure what a "photo eye" is
I assume some kind of a light-sensor which has an electrical output.
If this output is an analog output
The voltage you can measure on this output depends on how much light is around the sensor
best thing would be if you post a link to the datasheet of your components
and yes an arduino can measure analog voltages with a certain precision.
specify how precise you want the measurement to have
best regards Stefan
presumably you want to measure the output of the photosensor in order to measure the light intensity it senses. so you would need a calibration between light intensity and voltage.
knowing the reference voltage (Aref) and max value of the ADC (1023), the voltage is simply adcValue * Aref / MaxAdcValue. for a ~5V references, the resolution is ~5mV. (not sure about linearity)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.