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.
![IMG_9037](https://www.gadgetnate.com/wp-content/uploads/IMG_9037-300x200.jpg)
How did I do it?
Simple circuit. Here is how the Arduino is hooked up. (The resistors are 10k.)
![ConnectionDiagram](https://www.gadgetnate.com/wp-content/uploads/ConnectionDiagram-300x152.png)
/* 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).
—————————————————-
PhotoR 10K
+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;
void setup()
{
Serial.begin(9600); //Begin serial communcation
}
void loop()
{
lightLeft = analogRead(lightLeftPin);
lightMid = analogRead(lightMidPin);
lightRight = analogRead(lightRightPin);
Serial.println(“###BOD”);
Serial.print(“light_right,”);
Serial.println(lightRight);
Serial.println(“###EOD”);
delay(15000);
Serial.println(“###BOD”);
Serial.print(“light_mid,”);
Serial.println(lightMid);
Serial.println(“###EOD”);
delay(15000);
Serial.println(“###BOD”);
Serial.print(“light_left,”);
Serial.println(lightLeft);
Serial.println(“###EOD”);
delay(15000);
}
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:
nuewire.com/seriot/
This program will listen to the serial port and write the data to ThingSpeak.com
![seriot](https://www.gadgetnate.com/wp-content/uploads/seriot-300x238.png)
You can then use Restful API calls to get to the data and to chart it.
They have a nice ChartEditor
thingspeak.com/channels/23070/charts/
![thingspeak-charteditor](https://www.gadgetnate.com/wp-content/uploads/thingspeak-charteditor-231x300.png)
![ThingSpeak](https://www.gadgetnate.com/wp-content/uploads/ThingSpeak-300x180.png)