Astrophotography With the Raspberry Pi Zero.

by Greg_The_Maker in Circuits > Raspberry Pi

29951 Views, 167 Favorites, 0 Comments

Astrophotography With the Raspberry Pi Zero.

a.jpg
moon_01.jpg
im_0001_20161125_122201.jpg
2016-11-18 13.22.17.jpg
clear.jpg
s3d.jpg

I have made two other Raspberry Pi based camera projects before [1] [2]. This, my third camera idea, is my first Raspberry Pi Zero project. This is also my first go at Astrophotography!

Spurred on by the recent 'Supermoon' I wanted to get my brother's old Celestron Firstscope 70 EQ back into service. Over the past 10 or so years the eyepieces have all gone missing but the telescope covers have remained in place keeping the dust out.

In my useful electronics tub is a Pi Zero and a matching camera cable. Along with a LiPo, Powerboost 1000 and a camera module. A perfect coagulation of components, just ripe for the making.....

Design Brief.

Create a wireless camera built around the Raspberry Pi Zero which is deigned to fit into a 1.25" telescope eyepiece receptacle.

Please help support my work, your donations really do make a difference.
http://ko-fi.com/gregthemaker

Components.

2016-11-15 13.44.21.jpg

Electronics.

  1. Raspberry Pi Zero.
  2. Raspberry Pi Camera, (Amazon Affiliate Link).
  3. Raspberry Pi Zero Camera FFC.
  4. Raspberry Pi USB Wifi Dongle, (Amazon Affiliate Link).
  5. Adafruit Powerboost 1000, (Amazon Affiliate Link).
  6. LiPo Battery.
  7. MicroSD Card, (Amazon Affiliate Link).
  8. Miscellaneous Wire.
  9. Miniature Slide Switch (SPDT), (Amazon Affiliate Link).
  10. Raspberry Pi 3 | Optional, (Amazon Affiliate Link).

Hardware.

  1. 4 x 20mm Female-Female M3 Brass Hex Spacers, (Amazon Affiliate Link).
  2. 8 x M3 10mm Socket Cap Screws, (Amazon Affiliate Link).
  3. 1 x SpoolWorks Basic Black PLA Filament.
  4. 1 x NinjaTek NinjaFlex Filament.

Files.

The STL, STP and 123dx files are available from | thingiverse.com


Please help support my work, your donations really do make a difference.
http://ko-fi.com/gregthemaker

Part Preparation.

2016-11-14 16.26.22.jpg
2016-11-14 16.27.58.jpg
2016-11-14 16.28.33.jpg
2016-11-15 14.31.36.jpg
2016-11-15 14.30.07.jpg

To help slim things down and to gain access to the contacts on the USB WiFi Dongle, we'll need to remove the case from the dongle. Simply split the plastic case apart with a knife and carefully remove the PCB.

You'll also need to remove the lens from the camera module. There is a guide on the Raspberry Torte wiki showing how to do this. You can leave this step right until assembly if you don't want the camera lens gathering dust in the meantime.

Design.

design_01.jpg
design_02.jpg
design_03.jpg
design_04.jpg
design_05.jpg
design_06.jpg
design_07.jpg
design_08.jpg
design_09.jpg
design_10.jpg
design_11.jpg
design_12.jpg

I'm using 123D Design to model the parts.

Considerations to take into account are the path for the FFC. Access to the SD Card, the MicroUSB jack on the Powerboost, cable paths, space for the LiPo plug, and somewhere for the Wifi Dongle and switch to go. In addition the camera needs to fit into a standard 1.25" eyepiece slot in the telescope.

I started modelling a case to fit around the Zero, making note of the SD Card Slot and the position of the camera FFC.

As with my other camera projects I have used a layer type design with each new layer forming a frame for a new component or components.

It is easy to forget that wires will be needed to wire the electronics together. So be sure to add cable routing.

The last feature for the body is a method for holding it all together. Using brass hex spacers it keeps things clean with no nuts showing on the exterior of the camera.

No Camera is complete without some accessories. I've drawn up a lens cap, designed to be printed in flexibles, and an adapter ring for larger 2" eyepiece telescopes.

During assembly I found that the camera cable wasn't long enough! Rather than use a longer non-standard cable and complicate things for anyone who wanted to build their own camera I adjust the designs to compensate for the FFC's lack of length. I moved the position of the camera from the centre of the body, to the side.

Printing.

s3d_02.jpg
2016-11-15 12.42.37.jpg
2016-11-15 14.08.08.jpg
printing.jpg
2016-11-15 15.47.37.jpg
2016-11-16 08.05.56.jpg
2016-11-16 15.02.29.jpg
2016-11-16 15.36.57.jpg
2016-11-16 17.06.03.jpg

I'm using Simplify3D to slice the models for printing. They are printed on E3D's BigBox.

Import the models into your slicer. As I have a BigBox they will all fit on the printbed together. Configure your slicer.

Slicer Settings

  • 0.25mm Layer Height.
  • 15% Infill.
  • 3 Perimeters.
  • 3 Top Layers.
  • 3 Bottom Layers.
  • 50mm/s Print Speed.

The print took ~10 hours to do all 8 parts. If you have a spare Raspberry Pi you can monitor and control your printer remotely with the fantastic OctoPrint!

The body and adapter are printed with SpoolWorks Basic Black PLA Filament. The cap is printed with NinjaTek NinjaFlex Filament.

While waiting for the print to finish now is a great time to sort out the Software.

Software.

lite.jpg
wifi.jpg
web.jpg

You'll need a standard Raspberry Pi to prepare the SD Card for the camera.

Because we don't want or need the full Raspbian image we can start by downloading the Jessie Lite image file from the Raspberry Pi Website. Follow their installation guide to write the image to the SD Card.

As we'll be accessing the camera over WiFi we now need to install a web interface for the camera. I use RPi-Cam-Web-Interface. Follow their guide to install the software to your image-build.

The WiFi Dongle needs to be configured as a hotspot. There is a helpful guide by Phil Martin which configures the RPi as a hotspot | WiFi HotSpot. During the CONFIGURE HOSTAPD section I rename the ssid from Pi3-AP to Telescope.

Lastly to stop any stray light the camera's on-board LED can be turned off by following this guide | disable LED.

You can simply remove the MicroSD Card from the standard RPi after shutting it down correctly and put it straight into the RPi Zero. You don't need to make an changes to the software for it to work.

One also has the option of simply connecting the Raspberry Pi Zero to your home WiFi network, should it be in range of your telescope.

Assembly.

2016-11-17 12.39.10.jpg
2016-11-17 12.50.33.jpg
2016-11-17 12.54.33.jpg
2016-11-17 12.57.31.jpg
2016-11-17 13.00.45.jpg
2016-11-17 13.02.23.jpg
2016-11-17 13.03.23.jpg
2016-11-17 14.05.29.jpg
2016-11-17 14.10.09.jpg
2016-11-17 14.17.29.jpg
2016-11-17 14.22.22.jpg
2016-11-17 14.32.45.jpg
2016-11-17 14.33.17.jpg
2016-11-17 14.35.42.jpg
2016-11-17 14.38.01.jpg
2016-11-17 14.38.45.jpg
2016-11-17 14.39.06.jpg
2016-11-17 14.43.35.jpg
2016-11-17 17.33.19.jpg
2016-11-17 14.48.08.jpg
2016-11-18 12.54.18.jpg
2016-11-18 12.54.54.jpg
2016-11-18 12.55.16.jpg
2016-11-18 12.55.39.jpg
2016-11-18 12.57.11.jpg
2016-11-18 12.58.06.jpg

Printed Parts.

I have taken a needle file to the top surfaces of all the printed parts, except for the final layer. This will take off any high-spots and ensure an even and flat fitment when stacking the layers together.

Raspberry Pi Zero Wiring.

We require four wires to be soldered to the Pi, two power cables and two USB cables. I have recycled the wires from an old USB cable. Using Chris Robinson's guide for adding a low profile WiFi dongle to the Raspberry Pi Zero we can select the correct solder pads.

In Chris's guide he uses the solder pads on the underside for the power in, however we will be using the GPIO to feed 5v into the RPi. Using this Guide to the RPi GPIO And Pins we know we want to connect +5v (red wire) to pin 2 and GND (black wire) to pin 6.

Layers 1 - 3.

Attach the four 20mm Brass Hex spacers to the first printed part with 4 x M3 10mm Socket Cap Screws. Place the part down. Fit the FFC to the RPi and place it into the printed part. Don't forget to fit the MicroSD Card!

Fit layer two over the top making sure to feed the cable and FFC through the holes.

Place layer 3 onto the stack, again take cable with the cables.

Layer 4.

Using the Pinout Reference from Chris's guide we can solder power cables to the WiFi Dongle.

Place layer 4 onto the stack taking care with the wires.

Solder the two cable from the RPi's USB pads to the WiFi Dongle. Put the dongle into the stack along with the Powerboost 1000.

Cut the four power wires to length and solder to the Powerboost. Double check the connections against Adafruit's Pinouts Guide.

The power switch needs three connections. I have soldered a length of 3-way ribbon cable to the switch before fitting it into layer 4. Route the wires round to the Powerboost and solder in. Double check the connections against Adafruit's ON/OFF Guide.

The Battery.

The wires on the battery are too long and ideally should be shortened.

This is a potentially dangerous step and should only be attempted if you are comfortable with your abilities to do it safely.

Begin by removing the Kapton tape covering the battery's PCB and solder terminals. If you don't have your own roll of tape keep the removed tape for when the pack is reassembled.

Unsolder the wires from the PCB and fit the connector to the Powerboost.

Feed the wires through the hole in layer 5 and approximate the required length before cutting off the excess. It is safe to leave a little more wire than you think you will need.

Resolder the wires to the battery and wrap up the PCB in Kaptop tape.

Layer 5.

I have added two foam pads to the underside of layer 5 to help keep the Powerboost from moving around.

Pass the battery plug through the hole in layer 5 and plug it into the Powerboost.

Feed the FFC through the hole in layer 5 and put it onto the stack.

Place the battery in the space in the layer.

Test.

Now is a good time to check everything works. Briefly connect the camera to the FFC and flick the switch. The light on the Powerboost should come on (there is a small hole in layer 3 through which you should be able to see the blue power LED).

Wait a few moments and using your phone, or mobile, or other WiFi device, scan for the Telescope ssid. You should be able to connect and by pointing your browser to 127.24.1.1 you should be presented with the RPi-Cam-Web-Interface.

If all is well shutdown the system, turn off the switch, remove the camera and carry on with the build. If you find things didn't go to plan check back through the instructions and fix your issues.

Layer 6.

If you haven't already done so please remove the lens from the camera module. Refer to the Raspberry Torte Wiki for instructions.

Place layer 6 onto the stack, feed through the FFC and attach the camera to the FFC.

Layer 7.

While holding down the camera into layer 6, add layer 7 to the stack.

Layer 8.

Hold layer 7 in position and placer layer 8 on top. Allow the camera to align to the opening in layer 8.

Secure layer 8 using 4 x M3 10mm Socket Cap Screws.

Camera Cap.

As soon as everything has been assembled fit the Cap to the camera. This will help keep dust and other detritus off the sensitive CCD.

Getting Ready.

2016-11-18 14.06.35.jpg
2016-11-18 16.11.06.jpg

Before we start.

You'll need to make sure the battery is fully charged. Plug in a Micro USB Charger to the connector on the Powerboost. It should take a little over two hours to fully charge from empty. Look for the little green LED to light up when fully charged, you should be just about able to see it through the gap.

It is worth noting that it is more than a possibility to carry a power pack around with you. The Powerboost has fully-fledged power management and can both charge the battery and power the camera at the same time. If you're near a power point there's nothing stopping you from running a USB charger to the camera for endless recording. Just make sure that both the PSU and battery pack are able to supply 2A or more.

The British Weather.

2016-11-15 14.17.05.jpg

Some Things Can't Be Controlled.

Sooooo, it's cloudy.

It could be worse I suppose.

At least it's not raining.

Yet.

Oh. No. Wait, now it's raining.

My First Try at Astrophotography.

a.jpg
01.jpg
02.jpg
03.jpg
04.jpg
05.jpg

While the moon is visible up in the sky in the morning at the moment I decided to try out the camera, and myself, during daylight hours so I can see what I am doing. Being new to this I felt it best to do so during the day.

After setting up the telescope and installing the camera into the diagonal I turned on the camera, connected to the WiFi access point, loaded my browser and then began to look for the moon (If you are on your mobile phone as I am, I found I had to turn off mobile data otherwise the phone wouldn't connect to the RPi web server and tried to go out over the mobile data network instead).

Having never done this before I wasn't quite sure what I was doing. To check the camera worked I covered up the front and confirmed the camera is functioning when the image went dark on my phone. Next I simply wiggled the telescope around looking for a change in light or a light spot. Sure enough I found one and after some time fiddling with the telescopes controls I managed to get it steady in view.

Next is the focus. The telescope has a large focal range and twiddling the focus knob(s) on the rear easily brought the moon into focus (I did originally try this without the diagonal but found that there wasn't enough travel and it required the added distance provided by the direction change).

Now I had the moon in shot I took some photographs. As you can see from the images attached there is a lot of dust and dirt in the light-path. In all my excitement I forgot to clean the lenses and diagonal mirror! There is also a red hue, I'm not entirely sure what is causing this at the moment...

I will give the telescope a good dusting and research the best settings for the camera in preparation for my next upwardly gaze...

The images have been adjusted in Photoshop. All I have done is use Photoshop's in built image Auto Tone function. I have attached all the raw unedited images as a zip file.

The time & date shown in the photos is incorrect as there is no RTC in the camera. The images were captured on the morning of the 19th November 2016 at approximately 0900 UTC.

Downloads

Bright Ideas.....

2016-11-25 11.25.16.jpg
123d.jpg
cased.jpg
im_0001_20161125_122201.jpg
im_0002_20161125_122224.jpg
im_0003_20161125_122531.jpg
Solar Video 1
Solar Video 2
Solar Video 3

In the interceding days between rain, cloud and sunshine I drew a quick design to attach a solar filter to the telescope. The filter is designed for telescopes with a dew shield up to 100mm (4") in diameter and also includes a case to keep the filter safe when not in use.

Download from thingiverse.com | https://www.thingiverse.com/thing:1904985

Sun Spot!

I waited a few days for the sun to come out, attached the filter to the telescope and pointed it skyward. I did give the lenses and diagonal a jolly good clean before attaching the camera.

One must be exceptionally careful and never look directly at the sun, that would be silly!

With my back to the sun I setup the telescope, fitted the filter and attached the camera. When I had the sun in the view I found that there was a sun spot! I tried to focus as best as I could before taking a few photographs. I managed a few videos too.

I'm still having issues focusing the camera, I'm not sure if this is due to my inability to use the telescope focus correctly or if there is too much haze, or if it is something else. There is a bit of wobble, even from just the wind rocking the telescope.

I have noticed that the red glare has gone, but again that could be because I'm pointing right at the telescope.

I shall try it in the dark next...

The images were captured in the afternoon of the 25th November 2016 at approximately 1300 UTC.

The Lunatic Is on the Grass.

im_0007_20161125_125539.jpg
im_0000_20161125_125022.jpg
im_0002_20161125_125308.jpg
im_0003_20161125_125333.jpg
im_0004_20161125_125432.jpg
im_0005_20161125_125454.jpg
im_0006_20161125_125457.jpg
Lunar Video 1
Lunar Video 2

It's been nearly three weeks since the conditions were right to take the 'scope outside.

This time is dark! Taking my learnings from the two previous outing I managed to get some nice photos and a few good videos too.

I'm still having issues with the focus and a red hue. If anyone knows what the cause is I would really like to know.

I think I need a more ridgid tripod to help with the wobble, or a motorised focuser.........

The photos and videos were shot on the 14th of December 2016 at 1830 UTC.