Post by Jason on Jan 20, 2021 8:21:52 GMT -8
My daughters are in love with the stars and the planets. We undertook a really simple and fun project together to further fuel their interest. The three of us built a camera to photograph the night sky and create time-lapse videos that show the Earth rotating throughout the night. To make it fun, we built our camera inside a flower pot :-)
You're prolly wondering "What the heck does this have to do with the Weather Rack 2?!?" Let me explain :-)
Version 2 of the official Raspberry Pi camera supports ten-second exposures. Even a small amount of light causes the resulting image to be pretty much all white. In the original scripting, I was polling an API once daily to determine when sunrise and sunset would occur based on the latitude and longitude of our home. Unfortunately, there is still quite a bit of light at both sunrise and sunset.
As a result, I adjusted the script to use the values "first light" and "last light" returned by the API. Again, there is still quite a bit of ambient light around so we were still getting white images bookending our videos. I started thinking about ways to maybe use AI to determine if the image was worth keeping, or simply adding a fudge factor to say start/stop 10 or 15 minutes before or after first or last light. Fortunately, the light bulb in my brain went on and I realized I have a sunlight meter on the roof of the house that can tell me when the ambient light level is 0!
Fortunately, I had already added MQTT publish to the readWeatherSensors.py script in order to get data to NodeRED. A little scripting was all it took to have a flag managed by the light level reported by the weather rack and our white images are gone.
Thanks,
Jason
You're prolly wondering "What the heck does this have to do with the Weather Rack 2?!?" Let me explain :-)
Version 2 of the official Raspberry Pi camera supports ten-second exposures. Even a small amount of light causes the resulting image to be pretty much all white. In the original scripting, I was polling an API once daily to determine when sunrise and sunset would occur based on the latitude and longitude of our home. Unfortunately, there is still quite a bit of light at both sunrise and sunset.
As a result, I adjusted the script to use the values "first light" and "last light" returned by the API. Again, there is still quite a bit of ambient light around so we were still getting white images bookending our videos. I started thinking about ways to maybe use AI to determine if the image was worth keeping, or simply adding a fudge factor to say start/stop 10 or 15 minutes before or after first or last light. Fortunately, the light bulb in my brain went on and I realized I have a sunlight meter on the roof of the house that can tell me when the ambient light level is 0!
Fortunately, I had already added MQTT publish to the readWeatherSensors.py script in order to get data to NodeRED. A little scripting was all it took to have a flag managed by the light level reported by the weather rack and our white images are gone.
Thanks,
Jason