I have three photoresistors in my study that are measuring light coming from 3 directions and showing the live and historical data on the graphs below.
How did I do it?
Simple circuit. Here is how the Arduino is hooked up. (The resistors are 10k.)
/* Simple test of the functionality of the photo resistor
Connect a resistor (around 10k is a good value, higher
values gives higher readings) from pin 0 to GND. (see appendix of arduino notebook page 37 for schematics).
+5 o—/\/\/–.–/\/\/—o GND
Pin 0 o———–
Similar setup for Pin 1 & Pin 2.
int lightLeftPin= A0;
int lightMidPin =A1;
int lightRightPin = A2;
int lightLeft, lightMid, lightRight;
Serial.begin(9600); //Begin serial communcation
lightLeft = analogRead(lightLeftPin);
lightMid = analogRead(lightMidPin);
lightRight = analogRead(lightRightPin);
I then setup an account at ThingSpeak.com
And to connect the arduino to the internet I used my laptop and a program called Seriot. It can be downloaded from:
This program will listen to the serial port and write the data to ThingSpeak.com
You can then use Restful API calls to get to the data and to chart it.
They have a nice ChartEditor