PIR + Photocell Configuration

Hey guys,

Been looking at some tutorials on this (http://learn.adafruit.com/photocells/using-a-photocell) (How to use Pyroelectric ("Passive") Infrared Sensors (PIR))

I’m trying to read from a PIR and Photocell in my code loop and apply some logic based on this.
Having some issues getting both to work at the same time. Just wanted to check with you guys the best way to do this.

I am trying to check for motion. If there is motion, I want to read the light level to a value, and say if above this value do X, if below do Y.

Attached is an image of how I have the hardware setup at the moment. Here’s a snippet of the code I’m trying to write:

//  Light and Motion Sensor 
//  Version 1.0
//  Author  HarmlessSaucer
//  Website harmlesssaucer.wordpress.com

int inputMotion1 = 2;
int inputLight1 = 0;
int outputLED1 = 13;
int sensorLight1;
void setup(){
  pinMode (inputMotion1,INPUT);
  pinMode (outputLED1, OUTPUT);

void loop (){
  sensorLight1 = analogRead(inputLight1);
  Serial.print("Light level =  ");
  digitalWrite (outputLED1,LOW);
  int sensorMotion1 = digitalRead(inputMotion1);\
  if (sensorMotion1 == HIGH){
    if (sensorLight1 < 500) {
      Serial.println(" - Dark - Motion Detected");
      } else if (sensorLight1 > 500) {
      Serial.println(" - Light - Motion Detected");


If anyone can point me in the right direction I would be really grateful!