Wireless All Sky Camera

160,914

739

837

Introduction: Wireless All Sky Camera

About: Most of the things I build usually relate to either astronomy, physics or woodworking in general.

An all sky camera is a device designed to take pictures of the entire sky over a certain amount of time, usually to monitor meteor showers or other astronomical phenomena.

I built mine to monitor the northern lights. I live in the Yukon and we sometimes get beautiful aurora displays during the night. However, I also have a day time job and I need my 8 hours of sleep. I created this camera to record a movie of the entire night. That way, I can replay the movie in the morning and never miss any aurora night.

Step 1: Requirements and Materials

My requirements for this camera are the following:

  • needs to photograph most of the sky
  • needs high sensitivity to low light
  • should be weather proof
  • no wires should run to the house
  • needs to be autonomous
  • needs to create a movie from pictures and upload it to the internet
  • needs to start at dusk and stop at dawn

After thinking about it for a while, I decided that the device should include its own computer and send the pictures using wifi. As for the camera, I decided to use an astronomy camera that would be small enough and was powered over USB.

Here's the list of materials:

  • ASI224MC camera from ZWO (ASI120MC or MM works too and is cheaper)
  • wide angle lens Arecont 1.55 (It gives a wider field of view than the lens that comes with the camera)
  • Raspberry Pi 2 (or 3)
  • 64 GB micro SD card
  • Wifi module (no need if Raspberry Pi 3)
  • Short right angle USB cable
  • 4" ABS pipe with end caps
  • Acrylic dome

I thought about adding a dew heater but after a few month of testing, I never got any frost on the acrylic dome. This is possibly due to the heat produced by the raspberry pi itself.

Step 2: Wiring

In this instructable, I will assume that you already have raspbian installed on the SD card.

The wiring is relatively easy. Plug the USB cable to the camera on one side and the raspberry pi on the other. Plug the wireless dongle into one of the 3 remaining USB ports of the pi. Insert the micro SD card in its slot and plug the raspberry pi to its 5V adapter.

In order to keep things tidy, you can fix your camera and computer onto a plywood board like I did on the picture.

Step 3: Build the Enclosure

The enclosure is made of a 4" ABS pipe, a flat end cap and a threaded end cap with its lid.

The flat cap goes on top and is drilled to the diameter of the camera. The threaded cap goes at the bottom and a hole (for the extension cord) is drilled in the centre of the lid.

The acrylic dome can be fixed onto the top end using weather proof silicone. I used an acrylic ring but it makes things more complex than they need to be.

You can now fix the enclosure onto your deck, your roof or any other location with a good view of the sky.

Step 4: Software

Update: If you need to change the way the capture works, you might have to make changes to the C++ source and compile it on your Raspberry PI. To do this, follow PeterD192's detailed instructions in the comments.

Update 2 (Nov 11th 2016): I have set up a GitHub page with an install script to make things easier for everyone: https://github.com/thomasjacquin/allsky If you use it, you shouldn't have to use any of the following instructions.

Original Instructions:

In order to capture images with the camera, we need to run a program in the terminal. ZWO provides an SDK in order for developers to communicate with the camera. Using this SDK, I modified one of their C++ example and compiled it for the raspberry pi. Here's a list of dependencies that need to be installed in order to get the program running.

  • OpenCV to capture the image of the sky (You can get a compiled version here)
  • Sunwait to calculate the civil twilight of your location. There is a compiled version in the archive. Make sure you copy it to your path:
    sudo cp ~/allsky/sunwait /usr/local/bin
  • Required dependencies:
    sudo apt-get update && sudo apt-get install libusb-dev libav-tools gawk lftp entr imagemagik

To make things easy, I have attached an archive. Extract it at /home/pi/allsky.

From the lib folder, you will need to run this in order to use the camera without being root:
sudo install asi.rules /lib/udev/rules.d

You will also need to add libASICamera2.so to your library:
sudo cp ~/allsky/lib/armv7/libASICamera2* /usr/local/lib

Another thing you will need to do in order to automate everything is to run the main program on startup of the pi. You can open ~/.config/lxsession/LXDE-pi/autostart and add this line:
@xterm -hold -e ~/allsky/allsky.sh

Remember to set your wifi connection in order for the pi to upload videos.

allsky.sh contains all the parameters you might want to play with: GPS coordinate, white balance, exposure and gain.

Step 5: Collect Images

Now that the raspberry pi is ready, you can plug your all sky camera. The startup script should call allsky.sh which in turn calls the binary file named "capture". It will determine if it's day time or night time. In case it's night time, the capture will start and take a picture every 5 seconds (or whatever value you set in allsky.sh). At the end of the night, the capture will stop and avconv will stitch them together and upload a video to your website using FTP.

Step 6: Watch Your Time Lapse Videos

The video produced by avconv should weigh between 30 and 50 mb depending on the length of the night (here in the Yukon, we can get from 18 hours to 0 hours of night time) and should be viewable on any web browser.

In the event that you find something interesting in the video, you can access the individual images on the raspberry pi. They will be in a folder named after yesterday's date.

Here's a page showing my own videos with almost all night archived starting January 18th 2016. Some have beautiful northern light, others have clouds, snow or rain.

Space Contest 2016

First Prize in the
Space Contest 2016

Makerspace Contest

Participated in the
Makerspace Contest

38 People Made This Project!

Recommendations

  • Pocket-Sized Speed Challenge

    Pocket-Sized Speed Challenge
  • Super-Size Speed Challenge

    Super-Size Speed Challenge
  • Metalworking Contest

    Metalworking Contest

837 Discussions

0
astrobry
astrobry

Question 5 days ago

Hi Thomas et all,

Wonderful project! Thanks for sharing!

I also built this project with a RP 3B+ and ASI 385MC.
I am experiencing some peculiarities with the camera/settings.
When I lower the "gamma" to 40, the camera switches to B/W. When i change it back to 50 (default), camera gives again a color image.

When I adjust the brightness, I don't see any difference in image display. Now the image seems quite high contrast and pretty dark to me. That's why I tried to adjust it by changing the gamma and/or brightness.

Possibly this has to do with the type of camera ASI 385MC ? Any tips ? thoughts ?

thanking in advance !

Erik
http://www.astronomie.be/erik.bryssinck/allsky

0
ThomasJ1
ThomasJ1

Answer 3 days ago

Hi Erik, during the day when auto-exposure is used, it's the camera library that decides what exposure to use. I believe it's looking at the over-exposed and under-exposed areas and picks something in between. I don't have control on that value. During cloudy days, it appears quite dark but when the sky is blue, I find that the exposure is pretty good.

0
qwertiop321
qwertiop321

Question 14 days ago on Step 5

Hello Thomas (and friends) First off, thanks for the great project!

My question is a little silly but I spent today configuring the camera using your GitHub, installed GUI and saw the picture attached below. I could see the timestamp changing at the top left as well as a little dot moving around in the picture, but nothing else.

Is this because the program detects that it isn't nighttime yet judging by the time in my zone? Around what time should I expect the camera to start taking images, since I see that my images tab in the GUI is still empty.

Thanks!

exampleimg.PNG
0
ThomasJ1
ThomasJ1

Answer 11 days ago

The program uses your latitude and longitude to determine if it's day or night. During the night, it captures images and saves them to disk. During thew day, it uses gain 0 and auto-exposure but doesn't save images to disk. It looks like you need to update your lat, long.

0
wfeiereisen
wfeiereisen

Question 13 days ago

Hi Thomas, do you have a feeling for how hard it would be to adapt the software for the new RPi HQ camera? I have a set of scripts that do a small subset of allsky, but your work is MUCH more complete. I'd like to adapt it if the cameras are similar enough.

0
JohnKulin
JohnKulin

Question 4 weeks ago on Step 6

Hi Thomas,

I'm afraid I'm not brilliant at programming the RPi, but am learning....slowly

I have everything running or so I though, but it is not generating any images.

I looked in the allsky.log and it reported this last night: -

Jun 6 01:21:16 raspberrypi allsky.sh[799]: can't get debug descriptor: Resource temporarily unavailable

I've uploaded my camera settings but can't seem to find where I can configure the amount of images to capture and how long to keep them for.

Any advice would be most welcome, I'm having to use the GUI frontend as I am not brilliant with Unix commands, but can follow guidelines if you can point em in the right direction.

BTW ignore the location settings, I reset it and haven't changed them back.

Many Thanks.

Camera settings_2.jpegCamera settings_1.jpeg
0
olivierfp
olivierfp

Question 4 weeks ago

Hello Thomas,
I am able to run using terminal and everything looks good (not at the ftp level yet). But I cannot get the web interface to work, it keeps refusing connection. Any suggestion I can try to make this work. I have used the PI web browser, I have used a laptop. I can ping the Pi and it responds, I see it as Allsky using an IP scanner. Either from the Pi or from the laptop, I get the same error message: refused the connection.
Thank you in advance
Olivier

0
olivierfp
olivierfp

Answer 4 weeks ago

I deleted the Allsky folder and reinstalled the package, then the web interface, and now it is working from my laptop. Not sure what went wrong earlier, but a step in the right direction, and the liveview answers my previous question.

0
si6pack
si6pack

1 year ago

Hi,
what a great project - it was really fun to get this thing done! Thank you very much for sharing this project!
Having installed the AllSkyCam on the roof of my garage, I was wondering about temperature issues: Yesterday was an average sunny day here in my hometown (21°C), but when I saw the temperature of the ccd (61°C) and the CPU (63°C) doubts came up (these high temperature were not the result of the workload, but the result heating up due to sunshine)...what, if it is a full blown summer day with outside temperatures > 30°C? Do other users have experiences? It would be great if other would share their thoughts!
Thanks for considering,
Christian

0
ThomasJ1
ThomasJ1

Reply 1 year ago

Hi Christian, I would love to have an answer for you but I live in the North and we don't get very hot days up here. Do you have a heat sink installed on the RPi cpu? I know the Pi3 will throttle down or shut down if temperature gets too high (around 90C I think).

0
si6pack
si6pack

Reply 1 year ago

Hi Thomas,
thank you very much for coming back to me. No, I didn't install a heat sink, but this might be a first step. In the meanwhile, I "re-colored" my gray housing to white - this brought already some improvement. Up to now, the CPU reached approx. 60°C during a normal sunny say with an average outside temperature of 22°C; the chip of the 224 reached 62°C!...
I will carefully watch, how the temperature will increase in parallel to rising outside temperatures...I am also thinking about another place to put the AllSkyCam which at least hides the housing from direct sun impact, but difficult to achieve. I keep you posted about my "temperature adventures"!
Regards,
Christian

0
JoeF187
JoeF187

Reply 4 weeks ago

Hi, I was wondering about daytime temperatures myself. Gets very high in the box on summer days, but I'm only in the UK, maybe gets in the 30s C occasionally. I'm guessing it might reduce the lifespan of the pi and camera a little bit? Are heatsinks effective in a closed box, sealed environment anyway?

0
Higany
Higany

Reply 1 year ago

My Pi is in my astronomy shed, we had red alert for heat during the past week, and the temperature was above 50°C in the shed during the day. The Pi reported temperatures around 75°C, and still operated without any problem. These stick-on heatsinks can't help the situation much, but fans are very effective, even on low rpm.
I had no 5V fan around, so I looked for a 12V 80*80mm fan in my old PC-part box which can work on 5V. Totally silent, but of course it has a very limted airflow. I mounted it over the Pi, powered with 5V from the GPIO header and now it operates around ambient +10°C.

0
si6pack
si6pack

Reply 9 months ago

In the meanwhile, I changed my setup - I installed three "layers" of items (similat to Thomas' setup):

1) On top ASI ZWO 224MC
2) 5V 2-pin ventilator
3) Raspi 3b

The constant air-flow helps to keep the temperature below 60°C (this is true for CCD chip and CPU). Unfortunately, there was no real heat (next year then). Highest outside temperatures reached 28°C...

0
Robjen67
Robjen67

Question 5 weeks ago

I'm curious if you have any plans to maken the AllSky software work with the new Raspberry Pi HQ camera? If not, would you mind if I would give it a go to implement this in your code?

with kind regards,
Rob.

0
JoeF187
JoeF187

Answer 5 weeks ago

The code is open on github to modify as you wish. It should just be a matter of looking at the documentation for the library used to access to Pi Camera, and checking what differences there are for setting up the camera and taking the photos.

0
technoplusnl
technoplusnl

Question 2 months ago

Hi Thomas,

The camera works great, but I have some problems getting it to upload images to my website.

I put your sample website in a subfolder "allsky" on my exising website.
When I open this web page I get the correct website with the image "Loading".

I set the UPLOAD_IMG switch to true in config.sh
From my Raspberry, I started a manual sftp session to the webserver, and I confirmed the host, before I did that I always got a Key error, that's now gone.
Apr 30 07:58:52 allsky allsky.sh[637]: cd: Fatal error: Host key verification failed.

But the latest imagestill doesn't get uploaded. I see something like this (I changed my web site name for this post):
Apr 30 12:46:28 allsky allsky.sh[637]: cd: Access failed: No such file (/:public/sites/www.mysite.nl/allsky)
Apr 30 12:46:28 allsky allsky.sh[637]: put: Access failed: Permission denied (image-resize.jpg)

When I sftp into my web server, there is a subfolder "public", in there is a subfolder "sites" in there is a folder with the actual website "www.mysite.nl" and inside that is the subfolder "allsky" containing your sample web site.

This is my ftp-settings.sh with the password and user removed and web site name changed:

#!/bin/bash
# FTP/SFTP settings
PROTOCOL='sftp'
USER='user'
PASSWORD='password'
HOST='sftp.mysite.nl'
IMGDIR='/public/sites/www.mysite.nl/allsky/'
MP4DIR='/public/sites/www.mysite.nl/allsky/videos/'
KEOGRAM_DIR='/public/sites/www.mysite.nl/allsky/keograms/'
STARTRAILS_DIR='/public/sites/www.mysite.nl/allsky/startrails/'

What did I do wrong? Something in the paths?
Thanks in advance for any insights.

Regards,
Albert

0
ThomasJ1
ThomasJ1

Answer 7 weeks ago

Sorry for the late answer. Did you fix it?
Try ssh mysite.nl in a terminal to accept the host key first.

0
technoplusnl
technoplusnl

Reply 7 weeks ago

Yes, thanks Thomas. It was exactly that!
My camera is online now, you can put it on the map if you want:
http://www.astropix.nl/allsky/
Thanks again for a great project!
Regards,
Albert