When the chickens go to bed the marten starts to hunt, hard times for the chicken if the door isn't closed. When the temperature falls and the water freeze there will be no water to drink. So what to do?
The chicken house survillant will do the job for you. At night fall when the chicken are in the house the ambient light sensor starts a motor to close the door. The current of the motor is measured for save motor control.
A temperature sensor controls the water temperature. If the water is to cold for the chickens or it even freeze the water heater starts to work and heats up the water to a normal drinking temperature.
To increase the number of eggs in autumn and winter when the days are short a chicken house lamp will be switched on at predawn. The detectin of the predawn will be done by the ambient light sensor as well.