Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

kecsap

Building a cheap all-sky camera with Raspberry Pi

Recommended Posts

So I started my journey to create a cheap system on my urban balcony. The final target to have an all-sky camera and remotely controlled easy to setup system to try astrophotometry. I created this topic to document the process for the all-sky camera if somebody else wants to create similar thing in the future.

At first, I bought a camera for Raspberry Pi without infrared filter (NoIR camera) for ~23 euro to check if it works enough well for all-sky camera. Without proper weather proof box yet, I put out the Pi to take 40 seconds long shots for a half night and here is the result:

I was lucky, there were everything that night: clear sky, clouds and Moon. The youtube compression ruins the details, but I think it is obvious that it seems good enough for the purpose.

Here it is a quick trial to detect the clear sky with basic image processing. A mask image was created to eliminate the trees from the frames and the following steps were applied for each frame:
1. Gamma correction: 0.3
2. Threshold the pixels at 140.
3. Declare the sky not clear when more than 5% of the pixels are white.

The image label says NO!, if non-clear sky is detected.

Now I wait until the next components are delivered to continue the experiment.

Edited by kecsap
  • Like 4

Share this post


Link to post
Share on other sites

This project is making great progress. Look forward to your next update.

Share this post


Link to post
Share on other sites

Me too :)

I'm looking into using a fish-eye lens with the Raspi NoIR camera for a wider view

Share this post


Link to post
Share on other sites

It took some time this update because my Raspberry Pi was lost during transportation and I had to order a new one. And also laziness. :D

But finally I had a not-so-cold night with clear sky thus I put some hours to assembly the all-sky camera hardware along with a DHT22 weather sensor.

I know that the result is not very nice looking. I put some O-rings on the camera and melted the plastic around with my soldering iron to be "waterproof". The clear camera dome also has not arrived yet.

I installed WeeWX on the Raspberry Pi and wrote a small extension to read the DHT22 values. I put the code on github:

https://github.com/kecsap/allskycamera/tree/master/weather_sensor_dht22

...and my "weather station" is registered at Wunderground, temperature and humidity data are pushed "live" to that service:

https://www.wunderground.com/personal-weather-station/dashboard?ID=ITAMPERE125

I consider to get a pressure sensor to add barometer values.

I did test shots with the camera on two more-or-less clear nights, but I need to implement the first version of the all-sky camera software. The weather part was the easiest to do first.

1.jpg

2.jpg

3.jpg

4.jpg

Edited by kecsap
  • Like 1

Share this post


Link to post
Share on other sites

Nice work! How do you run the exposures for 40sec? I was under the impression that 6 sec was the max exposure for the RPI cams (or are you stacking multiples together?)

Share this post


Link to post
Share on other sites

As in the previous post, I'd be interested to see how you get 40sec exposures - I've used picams a lot and could only get 5secs.

Share this post


Link to post
Share on other sites

I'll hazard a guess it's meteotux or similar, and blends 6 sec frames to get the integration up. 

Share this post


Link to post
Share on other sites

Ok, right now I am quite unsure what happens.

I use a NoIR version of the "Camera Module v1" for Raspberry Pi. Specs:

https://www.raspberrypi.org/documentation/hardware/camera/README.md

According to the documentation I use only 4.5 sec shutter time with the command (and it can do max. 6 sec):

raspistill -ISO 800 -n -w 640 -h 384 -ss 4500000 -o test.png

...but this command returns only after 34 seconds. If it uses only 4.5 seconds shutter time, I wonder why it would take 30 seconds to return a simple png file, the Raspberry is in idle. But most likely it is the reality, I mixed the command execution time with the real shutter time.

Unfortunately the raspistill is closed-source, I cannot check what it does internally. I also don't have any conventional camera where I could check what I should expect for a 4 seconds-long shutter time and a 30 seconds-long. I am a beginner. I bought an Canon EOS 1000D, but it has not arrived yet. :)

Edited by kecsap

Share this post


Link to post
Share on other sites

It is usual to get a lag before taking the image (5 sec from memory) unless you supply a -t argument to the raspistill command - so that will account for some of the delay.

Also, do you get a quicker response saving as a jpg? Have a feeling they are accelerated, but not sure if pngs are. Either way, the exif data in the image should give the actual exposure time of the image (unless you are combining images). 

Share this post


Link to post
Share on other sites
On 2017. 02. 02. at 15:40, coatesg said:

It is usual to get a lag before taking the image (5 sec from memory) unless you supply a -t argument to the raspistill command - so that will account for some of the delay.

Also, do you get a quicker response saving as a jpg? Have a feeling they are accelerated, but not sure if pngs are. Either way, the exif data in the image should give the actual exposure time of the image (unless you are combining images). 

I tried quite many things today and played with the options. It seems that I can do nothing about this long processing time. Nothing changes the delay, I turned off the white balance settings etc. When I choose a different mode with -md parameter, raspistill returns quicker, the image has far-far less content, unusable. But anyway, it is not a huge problem.

Edited by kecsap

Share this post


Link to post
Share on other sites
On 2017. 01. 21. at 12:07, kecsap said:

I installed WeeWX on the Raspberry Pi and wrote a small extension to read the DHT22 values. I put the code on github:

https://github.com/kecsap/allskycamera/tree/master/weather_sensor_dht22

I renamed the github repository to:

https://github.com/kecsap/robot_telescope/tree/master/weather_sensor_dht22

Share this post


Link to post
Share on other sites

With the pressure sensor so you have plans to add function to see what change trend is like on a barometer?

Share this post


Link to post
Share on other sites

The sensors are only there because they were very cheap and easy way to create a small weather station over the allsky webcam function. In a longer run, I will see how I can use them for automating some things with my imaging sessions. Set up alerts based on sudden raining/snowing or similar. And it was fun to make it work!

Edited by kecsap

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.