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
A light sensor plugin for an automated chicken coop door?
-
- Posts: 1
- Joined: Tue Oct 26, 2021 11:44 pm
Re: A light sensor plugin for an automated chicken coop door?
You could
Thomas
- 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)
Thomas
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
My repositories: https://github.com/karfas
Re: A light sensor plugin for an automated chicken coop door?
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.