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

19 People Made This Project!


  • Warm and Fuzzy Contest

    Warm and Fuzzy Contest
  • Build a Tool Contest

    Build a Tool Contest
  • Organization Contest

    Organization Contest

608 Discussions


Question 1 day ago

I would like to pass a variable to the thread SaveImgThd, the variable is the camera temperature and I would like that variable present in the call to the saveImageNight.sh. How do I do this?

3 answers

Answer 12 hours ago

Hey Ron, you'll need to replace line 106 in capture.cpp by
system("scripts/saveImageNight.sh " + your_temperature_variable + "&");

Then in saveImageNight.sh, you can retrieve the temperature by calling $1 such as:
TEMP = $1

I haven't tried it but that's how you pass variables to sell scripts.


Reply 10 hours ago

Thomas, thanks, I have been using a work around by calling the saveimage script from code in the main program (rather than thru the thread), because the temp variable name is not recognized in the thread call. I get Camtemp (the variable) not declared in this scope at that line. How do I pass that variable into the thread function itself? need to define it like the variable dayOrNight, but it is a char while my variable is an int? I can read the temp in the script with the $1 as you said, but I cannot get it into the thread.


Reply 9 hours ago

You should be able to get around it by moving long ltemp = 0; (line 420) to the beginning of the file where the other global variables are such as dayOrNight. This will make it global and you should be able to access it from anywhere.


Question 13 days ago on Introduction

Hi Thomas. Greetings from New Zealand. I am trying to set up FTP from Raspberry pi. I have a web host set in 'scripts/ftp-settings.sh'. I am not sure if i set up the paths on the website or are they set for the Pi. Does the Pi send up html data or do I have to do something at the host end? Are there other settings I should check?
Its a beautiful bit of program, easy to install and so far it simply works. Just need to get this bit working. I thank you for the time you have put into this.

1 answer

Answer 2 days ago

Hi there,
I was installing this last night so was playing around and had to tweak a few things for it to work.

The directories in the file are for the target directory on the destination FTP server.

I also had to tweak the lftp command to look something like this


If I remember correctly there was a : in between the $HOST and $<TargetDirectory> variable that wasn't working.



4 weeks ago

Hi Thomas,

Great work on this project. It's a great piece of software. So great, I built two of them. The first one is my all sky camera. Built with a RP 3 Model B+ and a 224MC camera. Here it is on the obs:

It's working great. Producing some nice results. Here's one of the better star trails:

My second one is pointed at the southern sky only. I'm using a RP 2 with USB Wifi dongle and a 120MC camera with factory fisheye lens. Here it is on the obs:

I'm getting some strange result, however. Image is cropping and scrambling like a puzzle a lot of the time. Here's an example:

Have you seen this before? Any way to correct it? That's snow, by the way...


1 reply

Reply 12 days ago

Sorry Peter, I'm just seeing this message. The ASI 120MM and 120MC are USB2.0 and these 2 models are known to produce this kind of result on linux. There is a thread on their forum about patching the kernel but I never tried it because I don't own this camera.


Question 4 weeks ago on Introduction

Hello :)
I installed the interface but I can´t see an Livepicture. It´s only dark with a small symbol on the left corner. Can anyone help me please? Cam is an ASI 120MC-S


1 year ago

Great work on the software and support. I'm in the process of building one - the pi2 and camera worked out of the box (asi120mc-s). I'm putting a slightly different spin on it however. I often go to areas where there is no internet available and/or no mobile phone coverage or AC power.
I have decided to use a 12v 7Ah SLA battery in a 150mm tube (as opposed to a 100mm tube) with a voltage stepdown/regulator (approx 95% efficient) to power the pi2, camera and wifi. Current draw is approx 200mA at 12v, and the battery lasts 17+ hours. Power is turned on via a reed switch and magnet.
I have noticed 2 issues - 1 a hardware issue, 1 a possible software change may help (I am not a linux expert, this is jsut a suggestion).
1 Operating without an internet connection means that the OS cannot get the correct time as there is no RTC with battery on the Pi - therefore the time is incorrect and it will start shooting/saving images at the wrong time. I have ordered a RTC module to work around this.
2 Running on a battery means power is at a premium. For a good percentage of the time, the Pi is at idle (during the day, after it has compiled its images into a video). Wondering if (and I don't know if it is possible, there may be driver issues with this) the camera could be disabled automatically during the day to save power.
Next goal is to incorporate a small solar panel to charge the SLA and power the Pi during the day. I am also thinking of under-clocking the processors to save power, and as the Pi will generally be 'headless', turn off HDMI output after the machine has had 30 minutes of uptime (to save more power), but to allow use if a screen is needed.
I am hoping this setup can be put outside and run nearly indefinately nearly anywhere, irrespective of the availability of power or internet.
Again, really great work, and well explained.

3 replies

Reply 1 year ago

Hi David,

That's a great project. On the software side, I'm not sure you could disable the camera but I think you could save some energy by throttling some processes such as avconv.
There's a line in allsky.sh that you can enable by uncommenting it. It uses cpulimit to limit the amount of cpu power during the generation of the timelapse. It will take longer to build the video but it may use less power.
Good luck with the off-grid setup.



Reply 6 weeks ago

Hi David,

How did you progress with your off-line setup? I am also quite keen to create a good resolution all-sky camera, that is solar powered. If you have any advice around that, it'd be appreciated. I have the Pi 3b+ and hope to connect it to wifi for data transmission, although this won't necessarily have to be a continuous connection, it would be nice, so the power consumption may be higher because of that. It's also at 54 degrees latitude, so will have limited daylight hours in winter and plenty of cloud too. All things that need to be taken into account I guess!
I'd appreciate your insight.



Reply 5 weeks ago


My setup is still a work in progress.The software build is exactly what is done by Thomas (thanks mate, great work), with some slight modifications.I have
underclocked the pi to save power (Thomas suggested this - doesn't save much power, but it makes a definite difference in battery life and temperature). Also, as my setup will not have access to the internet, I added a battery backed real time clock module, such that the time/date is correct when I power on the system.

On the hardware side of things, I’m using a pi2 with a RTC module on the GPIO port, an edimax wireless USB and an ASI120mc USB3 camera.

Battery-I have a panasonic up-vw1236p1 (12v 6.6Ah) SLA that came from a decommissioned 3 phase industrial UPS.They are small, have enough power to power the pi and the camera for approx. 15 hours.

DC-DC stepdown – to provide the appropriate power to the pi I’m using a LM2596 DC-DC converter.They are cheap, readily available and have an input from 4v to 40v with a regulated output of 1.35 to 35 volts at up to 3A and is reasonably efficient.I set the output to 5.1v.

SLA charging – I’m haven’t decided on the final configuration of the charging
circuit yet, but it is working at the moment like this.I’m using a non regulated 15w solar panel, which is connected via a water proof connector to the PVC enclosure.I have a buck-boost board DSN6000AUD that allows a regulated output from a varying input (both above AND below the output voltage).The battery specs show a 13.6 to 13.8 standby voltage and that they support a constant voltage charge, so I set the output to 13.7v.

I also use a magnetic reed switch to power on the whole system without compromising the integrity of the PVC casing.



Question 6 weeks ago

I like to invest in upgrade my ASI290MM Mini (mono) to a ASI385MC (color), anyone try this model? could be a problem? same ZWO drivers? any help will be apreciated :D

1 answer

Answer 5 weeks ago

Although I don't own this camera, it should work without modification as the software is using the ZWO library (which is designed to work with all of their cameras).


Question 6 weeks ago

I have questions around which ZWO camera to use, or other brand if there are competing options. I'd ideally like an all-sky view for this project, and to capture at least what the eyes sees, or better, at close to real time. Is this possible? I don't mind if the exposures have to be up to 15 seconds or so, but the more real time the better. How is the noise in the images, and the detail? Is it better to go for a colour camera, or a mono? Ideally I want colour images, so I think with mono it might complicate it too much with having to take images with RGB filters?
Also wondering what the power consumption of the setup is, and if it's feasible to set it up with a solar panel and accompanying battery, so it's completely wireless?

3 answers

Answer 6 weeks ago

The project uses ZWO libraries so it is not (yet?) compatible with other brands. If you want a full sky view, you may have to go with a 1/2" sensor in order to capture the full circle. Mono is probably not the best solution since you'll need to deal with a filter wheel, aditional power consumption and risk of mechanical issues.
An ASI224MC or ASI120MC-S will do just fine. If you want to capture at least what the eyes see, you should be able to do it under 15 seconds. You can play with the gain to increase/decrease sensitivity (and noise at the same time).
I know one user who is using a 40W solar panel and a 16Ah lead battery for this project.


Reply 6 weeks ago

Thanks Thomas, this is great to hear! I'm very much looking forward to working on this project. I also had another idea around this. I'm assuming with the all sky camera, you can see a lot of stuff, but not huge detail if you try to zoom in? Do you think it would be feasible to setup perhaps 4 cameras covering smaller but more detailed field of view, and stitch the images all together into a 360 VR type image (well, 180 really). I guess the Pi itself would not cope with this, but if the system is to offload the images to a computer to process, do you think it would cope with this number of cameras?


Reply 6 weeks ago

Technically, this is possible. You would need 4 allsky cameras probably synced together. Then a computer would stitch the 4 images using a registration and stitching process (something like Hugin maybe). However, that would be quite expensive and technical.
Instead, I would recommend using a camera with a higher resolution such as the ASI183MC (20Mpx) and a fisheye lens that covers the whole 1" sensor.


Question 2 months ago

Hi Thomas,
Twice in the last few weeks, my 290MM unit recorded one or two zero-byte sized images. The avconv routine does not handle zero-byte images very well and usually stops the creation of the time lapse at that point (ie. video only includes early part of the evening/night). Is there some way for code to automatically remove zero-byte files before kicking off the avconv routine? Or perhaps there is a better way to handle this?

Not sure what might be causing the zero-byte files. This camera is still on version 0.5, but has been working like a champ. I'm not aware of any disruption the camera might have encountered at the time of the zero-sized images (ie. I was not logged into the camera, there was no power bump etc.).