Photoresistor as motion detector

Hi, I'm new in this field. I have not access to ultrasonic sensors. I'm planning for a bird trap. It has a smal door.can i use photoresistor+led to detect the entrance of the bird?and close the door after that? Any help will be appreciated. Thank you...

Yes, this is possible.

Here is some example code:

You will also have to test about how much light will be cut off by a bird entering the bird trap.

So yeah, it's possible.

Yes, you can use a photoresistor (or maybe better a phototransistor…) like photocell to “see” the passage of something.
the problems derive from disturbances, the sun light first. The best way is to use something that block the light of the enviroment, but allows only the led light to arrive at the sensor.

First of all, thank you for your fast replies. And can i set the value on a number to get rid of sunlight disturbance? I mean can i first test the value of led light and then the sunlight to specialize the photoresistor?

It depends. If the sunlight arrives directly to the photoresistor you can't, but even if it's not direct it's not easy. I suggest you to use black tape with paper to create a sort of tube and put the photoresistor inside. With this trick the light that comes straight from the front is detected more than the light that comes from the environment. Then you have to try and see the values that the sensor read. Wich led colour do you want to use?

Sunlight isn't constant. You can't just subtract one number from your measurement. What if it's night time? What if a cloud passes over the sun?

Often two sensors are required to do this. One senses unobstructed daylight and the other senses the door. Then you have a number you can subtract from the 'door' sensor.

The problem is that if the sunlight is too bright your photoresistor becomes saturated, and the light of the led doesn't change nothing in your lectures. You have to know where you will put this

Hi, How about considering the design need before assuming a solution (photoresistor)??

An Infrared LED aimed at an Infrared-filtered phototransistor would probably be a good solution.

But what other design considerations? Power?? Temperature extremes? Can you put the bird door in shade from sunlight? Etc..