Page 1 of 1

A light sensor plugin for an automated chicken coop door?

Posted: Tue Oct 26, 2021 11:55 pm
by MrStewartsir
Hi,

I'm trying to find a light sensor that would work well to be plugged in to the micro:bit; rather than using the LED sensor method.
As it's going outside, I'd like to keep the micro:bit enclosed in the coop and run a light sensor up and out, but I can't find any accessories that can plug in just as a light sensor?

Also, if you have any ideas or suggestions for how to go about the process, I'm looking to write a program that senses sunrise and sunset, tells a servo or piston to go up or down to open and close the door, and be connected a trickle charged battery fed into by a solar panel.

I know I could buy a chicken door that'd do all this for me, but I'm a teacher and I'd like to show my students some real world application of coding in action.

Any and all advice welcome

Re: A light sensor plugin for an automated chicken coop door?

Posted: Sat Oct 30, 2021 8:18 am
by karfas
You could
  • use a LDR (Light Dependent Resistor) together with a pull up/pull down attached to a GPIO port
  • calculate sunrise and sunset (provided you have some means to maintain the current time)
  • use your solar panel as a sensor (it's most likely day when the panel's voltage reaches a specific threshold)
Regards,

Thomas

Re: A light sensor plugin for an automated chicken coop door?

Posted: Sat Oct 30, 2021 3:20 pm
by scruss
Kitronik sell an external light level detector that outputs an analogue voltage that might work for you. Thomas's suggestions are all good, too. Solar panels are extremely good at detecting sunrise, but the output voltage is quite dependent on temperature (the warmer it is, the lower the voltage). Your trickle charge controller may not output a panel voltage in the form that a micro:bit can use, though.