As I mentioned in a previous post, this is the output that is printing on the serial monitor of the Arduino IDE when I have four photoresistors set up in a voltage divider with four 10k ohm resistors. (The schematic diagram and an image of the actual circuit can be found on 2/7/17.)
The values that are printing for each of the four sensors are actually the voltages outputted from the voltage divider as a 10 bit number.
The values printed as the sensor values can be calculated using a proportion. The equation will be the output voltage from the voltage divider over the maximum voltage (5v) which is equal to the value printed on the serial monitor over the maximum voltage in bits (1023).
For example, if the photoresistor, at a particular moment, had a value that was equal to the other resistor in the voltage divider, which in this case is 10,000 ohms, then the voltage divider will output exactly half of the initial power, which is 5v. This means that the output will be 2.5v so the value that will print on the serial monitor will be that number in bits which is calculated below:
2.5v = x
5v 1023
So the value of x is about 512.
Nice.
ReplyDelete