Jump to content

740427863_Terminatorchallenge.jpg.2f4cb93182b2ce715fac5aa75b0503c8.jpg

RaspberryPi + HQ Camera All Sky Camera Build


davefi
 Share

Recommended Posts

Hi all, been lurking here for a few weeks reading up on the various observatory and camera builds. Always been interested in astronomy but never had the time, money or space to do anything about it, so been quite interesting watching you all building things!

I'd been wanting to build my All Sky Camera for a while after seeing some star trail and timelapse footage, so have been reading up and collecting parts. Finally finished it yesterday/today, so thought I'd put together what I have done.

I have a Raspberry Pi 3b connected to a WD Green SSD running Thomas Jacquin's All Sky software (https://github.com/thomasjacquin/allsky), with the HQ Camera support that Rob Musquetier added. Its housed in a large weather proof* enclosure, under a 4" dome. The dome is heated with a Dew Heater from AllSky Optics, which is controlled via a relay that the Pi is controlling. The dome, enclosure and outside air temp are monitored by 1-wire DS18B20 sensors, and the whole thing is powered via POE, with a 12v to 5v convertor powering the Pi.

image.png.83a8519904f78ce10eb54c5117fe2763.png

Preparing the cover for the done fixing holes, the camera hole, the camera fixing screws, the heater cables and the DS18B20 sensor.

image.png.c9b26262ae767d39d2bc1910cd0aaaa5.png

Gasket cut from 1mm gasket sheet.

image.png.726fbd081bcf103d8cc100a97e751a56.png

Test fit-up with the gasket in position, inner ring of black sticky back felt, dew heater, final ring of black felt. The exposed plastic from the camera hole was also coloured black with a Sharpie. I wasn't sure about painting the dew heater or not, but from the test footage I did last night, it doesn't look necessary for now, so I will leave it.

image.png.512d06be0b5805a9da7588ed4f2d68c9.png

Dew heater and DS18B20 fitted.

image.png.2f1fdc5f9e2866e4f17151b2158cfada.png

Everything fitted internally.

WD Green SSD & Pi3b is installed in an old 6x6 WD case, minus the cover. The POE splitter is at the top, with the power cables running from a 2.1mm DC jack-to-terminal connector, into some 3-way Wago blocks. 1 wire from the 3-ways, go to the CPT 12v to 5v converter, which goes to 2 more 2-way Wago blocks, then off to the Pi3b via modified USB cable. The other connections on the 3-way's go to the dew heater (ground) and the relay (12v). The relay control is then wired to the GPIO header on the Pi3b. Lastly, the DS18B20's are connected to a small stripboard with the 4.7K resistor (in the small black box at the bottom), which is then connected to the GPIO headers.

image.png.5db854eace1fe42e597588dddbdee81e.png

And the finished unit. I used it last night and didn't turn on the dew heater until I saw some dew forming, and very pleased to say it cleared it very quickly. I left it on all night and it maxed out at ~23c in the dome.

image.png.bb3af7c49ac3304f35e253a2d7646e92.png

Unfortunately we do have a really annoying street light on the right, which is giving the red glow all over the photo, but it is only temporarily thrown on the utility room roof, so I hope to move it further into the garden and the houses along the side should hide the light (although then introduce their own, but hopefully they will not be on all night!

 

Shopping List - I know I always appreciate it when people provide links to the parts they used, so mine are below:

Gasket Sheet: https://www.amazon.co.uk/gp/product/B00FEIP2HY

Relay: https://www.amazon.co.uk/gp/product/B07V1YQQGL

DC Power Jack to Terminal Connectors: https://www.amazon.co.uk/gp/product/B07RHM5KCW

12V POE Splitters: https://www.amazon.co.uk/gp/product/B078JNVRTR

Outdoor Enclosure: https://www.amazon.co.uk/gp/product/B0151KNMB2 (*note: the seal is crappy foam and ripped in two when I went to remove it (ironically to protect it), so not sure I trust it in the rain, yet!)

4" Dome: https://www.amazon.co.uk/gp/product/B01N29BQN6

Fisheye lens: https://www.amazon.co.uk/gp/product/B01CX4U7DK/

Waterproof DS18B20 Sensors: https://www.amazon.co.uk/gp/product/B07DNWX5LB

Wago Blocks: https://www.amazon.co.uk/gp/product/B07QBC9DKS

Pi HQ Camera: https://thepihut.com/products/raspberry-pi-high-quality-camera-module

Dew Heater: https://www.allskyoptics.com/store/product/allsky-camera-dew-heater-module

12v to 5v Converter: https://www.allskyoptics.com/store/product/dc-to-dc-converter-regulator-12v-to-5v-3a-15w-power-supply

SSD and Pi3B were ones I already had, but easy enough to locate from usual outlets. I think that is more or less all the main things!

Thanks for reading!

  • Like 18
Link to comment
Share on other sites

  • 2 weeks later...

Made a couple of updates:

1. Replaced the relay - the one I was using was not turning off reliably. I'd overcome that in the code, but after switching to a new relay with an octocoupler, it worked much more reliably (at the top in the photo below).

2. Added an INA219 breakout board to monitor the power, current and voltage - useful to check the dew heater is or isn't on, and overall system health (at the bottom in the photo below).

image.png.789efc394ca5ae06c63f571deba6f239.png

3. Added a breather vent - from various sources I've read online over the past few weeks, it was recommended to have such a device to allow the enclosure to equalise in pressure with the outside, to avoid forcing water in through the seals and/or condensation forming inside the enclosure itself. The vents are ePTFE membranes, which I believe act much like Gore-Tex, allowing the enclosure to breath without allowing water in. Some information at the bottom of this page: https://www.wiska.co.uk/en/30/cat/262/venting/ 

image.png.415b0142627655eaeec3057eab0da328.png

 

Octocoupled Relay: https://www.amazon.co.uk/gp/product/B07TYG14N6/

INA219 Breakout PCB: https://thepihut.com/products/adafruit-ina219-high-side-dc-current-sensor-breakout-26v-3-2a-max

M20 VentPLUG: https://www.wiska.co.uk/en/30/pde/10106591/evps-20.html

Edited by davefi
Adding photos
  • Like 4
Link to comment
Share on other sites

  • 1 month later...

Since the weather took a turn, I have not really used it - I hadn't had the chance to adequately test it for waterproofness and we have barely had any nights without some rain at least forecast, and I just didn't want to risk it. I plan to strip it down and put the enclosure out for a few days in more variable weather to see how it performs, but I haven't had the time yet - I'll certainly update the thread once I have done some more testing though.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

Just found this thread and planning to do something similar.  The venting thing is interesting as I have had lots of trouble trying to seal ASCs.  Followed your link but it didn't seem to lead to a buy-able product.  Could you give me more info, please?  How much and where to buy.

Link to comment
Share on other sites

  • 1 month later...

Thought I'd give this a go, but a slightly different approach - a positive pressure ventilated enclosure.

My initial bodge job is below. The entire system runs at 5V rather than 12V since it's native for the Pi. Not anticipating any local storage - the Pi is configured to keep everything in RAM so the SD card won't see many if any writes.

There's a 5V PWM fan which is PWM-controlled from the Pi and a simple I2C-controlled switch which toggles the circuit with a 25W power resistor on and off. I'm definitely going to affix a much larger heatsink to the resistor, since right now it does a poor job of passing heat to the rest of the enclosure.

The BME280 sensor tucked next to the camera does temperature and relative humidity so can calculate dew point.

The fan is filtered, as is the exit port, with metal mesh filters to keep out any bugs. The board is a Pi4 because it's what I had handy and the DC stage is a 5V MeanWell encapsulated supply.

20210317_231515.jpg.dc87253211328b96c1ad284f1e16d758.jpg

Not going to win any beauty contests, for sure. The big chunk of balsa wood is again a "close enough" fit - I'll 3D print a proper mount at some point! The top surface is covered in aluminium foil to reject the worst of solar radiation in daytime.

DSC_0027.thumb.jpg.e82c7c48781cb914e0ba012ea88b129f.jpg

So far it's working OK; I've been working on my own software since it's a ZWO camera rather than the Pi camera (an ASI120MC I had spare) but tests with KStars have gone well.

On the dew front, I'm actually struggling so far with dew on the outside of the dome. The ambient temperature is around 3-5c at the moment with the heater running around 20s per 3 minutes since if it's left on all the time it rapidly gets very hot (I clocked it at ~180c with a thermal camera after a few minutes). Definitely need a better heater solution but with 5V only the common 12V "ring" heater available isn't going to do the trick.

Link to comment
Share on other sites

  • 2 months later...
On 23/03/2021 at 00:14, skybadger said:

Any thoughts on the hq camera sensitivity ?

A few people have found that the Raspberry Pi High Quality Camera is affected by the Sony "Defective Pixel Correction" DPC process (aka. the Sony Star Eater algorithm):

https://www.strollswithmydog.com/pi-hq-cam-sensor-performance/

 

Fortunately there is now a command to disable the DPC algorithm in the Pi's firmware:
https://www.raspberrypi.org/forums/viewtopic.php?t=277768

  • Like 2
Link to comment
Share on other sites

  • 2 months later...
On 17/02/2021 at 17:26, Gina said:

Just found this thread and planning to do something similar.  The venting thing is interesting as I have had lots of trouble trying to seal ASCs.  Followed your link but it didn't seem to lead to a buy-able product.  Could you give me more info, please?  How much and where to buy.

Hi Gina, so sorry I only just saw this, its been a crazy year with one thing or another and the time has flown by, not had a chance to do anything with my camera, and completely forgot to even look at the forums (how on earth is it almost September already)... Anyway, if you still need them, I got them from Electrical Counter:

https://www.electricalcounter.co.uk/products/Cable+Accessories/Pressure+Equalization+Units/EVPS+20+Polyamide+Pressure+compensation+unit+IP68/2483938539

Link to comment
Share on other sites

@davefi I have been looking for some code for the pi to operate a relay hat based on dew point, both inside and outside the camera dome.

I also use Thomas Jacquin’s allsky on a pi4 and was looking to see if you’re willing to share your code or point me to where I can find something to modify to suit.

The relay hat I have is a 3 channel waveshare hat https://www.waveshare.com/wiki/RPi_Relay_Board and not being a coder I’m not sure where to start.

I’m happy to read code and make subtle changes to suit but I can’t start blank, nor have I found anything suitable yet.

Basically, I’d like to achieve the following:

1. 2 sensors, 1 internal, 1 external.

2. Sensors to be dht or 280bme to calculate the dew point and also report temperature and humidty separately, possibly to a text file ‘live’, ie append not add.

3. If internal temperature higher than say 30degC, switch on relay 1 (for tec cooling for example with fan for forced air movement.)

4. If internal dew point approaching, switch off relay 1 and switch on relay 2 ( internal heater and fan for forced air movement) until a set point above the dew point, basically internal climate control to prevent overheating or fogging.

5. If external dew point approaching, switch on relay 2 for heating to avoid dew on the outside of the dome.

Of course this is all basically a truth table of events but I don’t see any real reason why this cannot work?

Any help from you, or from anyone else would be greatly appreciated.

Link to comment
Share on other sites

Thanks Tomatobro, I’ve looked at it and it’s not really suitable. I already have the allsky software running, I just need to move onto the next step of automating internal climate and dew control.

Eventually, it should in theory run all year round without any intervention.

Link to comment
Share on other sites

Because I have an external power supply I don't bother with climate or dew control. I just apply 14 watts throughout the night. My previous version did but I found that from about now on in the year it was on all the time anyway in order to keep the dome clear.

I do have a sun shield that is operated by daylight that swings over the plastic dome. This is to stop birds scratching the clear cover with their claws. Also stops a concentrated image of the sun reaching the imaging sensor

16 minutes ago, Jonk said:

automating internal climate and dew control.

 

Link to comment
Share on other sites

I did think about a timed heater regardless but I also like having it on 24/7 so a cover isn’t something I’d have.

Maybe auto-dimming the dome, like photo-reactive film would help.

I’m not sure the sunlight will damage the sensor as it’s not ‘magnified’ but I will eventually fit a filter, either a Lum, LP or maybe UHC to help.

It’s the temperature inside that’s something I want to control, but it’s only an idea and may not even work as I imagine.

Link to comment
Share on other sites

On 27/08/2021 at 19:59, Jonk said:

@davefi I have been looking for some code for the pi to operate a relay hat based on dew point, both inside and outside the camera dome.

I also use Thomas Jacquin’s allsky on a pi4 and was looking to see if you’re willing to share your code or point me to where I can find something to modify to suit.

The relay hat I have is a 3 channel waveshare hat https://www.waveshare.com/wiki/RPi_Relay_Board and not being a coder I’m not sure where to start.

I’m happy to read code and make subtle changes to suit but I can’t start blank, nor have I found anything suitable yet.

Basically, I’d like to achieve the following:

1. 2 sensors, 1 internal, 1 external.

2. Sensors to be dht or 280bme to calculate the dew point and also report temperature and humidty separately, possibly to a text file ‘live’, ie append not add.

3. If internal temperature higher than say 30degC, switch on relay 1 (for tec cooling for example with fan for forced air movement.)

4. If internal dew point approaching, switch off relay 1 and switch on relay 2 ( internal heater and fan for forced air movement) until a set point above the dew point, basically internal climate control to prevent overheating or fogging.

5. If external dew point approaching, switch on relay 2 for heating to avoid dew on the outside of the dome.

Of course this is all basically a truth table of events but I don’t see any real reason why this cannot work?

Any help from you, or from anyone else would be greatly appreciated.

I use something similar, it's a MOSFET which is controlled PWM from the PI and switches a ni-chrome wire based heater I have in the camera mount on the dome. I then have a 18B20 temp sensor touching the heater element so I can control the temperature it is working at. This is then used in conjunction with the dew point of my weather station to workout what the dome target temperature should be (it's a simple offset at the moment). A python script then uses a PID control look to manage the PWM to the MOSFET to track the desired target temperature on the heater.

I'm using this shield which I have a couple of for another project (another dew heater as it happens!) 

https://www.tindie.com/products/mostlyrobots/4-channel-mosfet-shield-for-wemos-d1-mini-esp8266/#:~:text=the cha...-,The Four Channel MOSFET Shield for Wemos D1 Mini contains,up to a potential 20A.

The python code is a bit rough and ready, it's not something I have programmed in but managed to hack together something based on examples else where.  My weather station uses MQTT to communicate stuff, and I already had some data being captured by the PI for the overlay on the all-sky so it was trivial to add to that the dew point data and then bring that in to the python script.

The ni-chrome wire is out of an old toaster, looped round within a 3d printed part.

image.png.dc40adef2a1bf78b4e9a13e579598fc7.png

 

Messy proof of concept...

image.png.9f18b9a148fcd15e704784ea26ee3e58.png

Slightly less messy final install...

image.png.0df2fec1ab36d66dea0aafc100e38c30.png

 

 

image.png.1698f255b582f837f39f5279305efb09.png

 

 

Current position awaiting focus check before I put it on top of a scaffold pole where the weather station is...

image.png.f83f6d7e667ac4a001c22cc9fd5f6158.png

 

image.thumb.png.ff8cde8c8ca641c936be5799a2bfa690.png

Edited by jiberjaber
last couple of pictures added
Link to comment
Share on other sites

I've managed to get a script to switch the relays on and off via the cli, and also managed to get a stream of T, H and P from the BME280 which is a start!

Loads of stuff about installing libraries and compiling code, which is way above my pay grade.

But, progress is progress so I guess I need to ask someone who can write code in C to knock something up for me to do what I need it to do.

Link to comment
Share on other sites

16 hours ago, Jonk said:

I've managed to get a script to switch the relays on and off via the cli, and also managed to get a stream of T, H and P from the BME280 which is a start!

Loads of stuff about installing libraries and compiling code, which is way above my pay grade.

But, progress is progress so I guess I need to ask someone who can write code in C to knock something up for me to do what I need it to do.

I'm not sure you need it in C, python might work - though I must admit most of my coding is in C on microcontrollers so I've been stumbling around in Python to get it to work.  Sounds like you just need a simple on/off thermostat style if you are just using relays with a bit of hysteresis.

I used this as a starter to get the 18B20 reading in to the code, built upon that to get my MQTT values in too (they were already stored in files for use on the text overlay of the all-sky camera) 

https://www.circuitbasics.com/raspberry-pi-ds18b20-temperature-sensor-tutorial/

Just need a bit of math then to determine when to turn on your relay to suit your requirements (you might need an offset to take in to account the temperature difference inside the dome vrs the external dew point?) 

Here's a quick python code for a BME280 https://www.raspberrypi-spy.co.uk/2016/07/using-bme280-i2c-temperature-pressure-sensor-in-python/

Looks like https://www.waveshare.com/wiki/RPi_Relay_Board has some python code examples to control the board. 

There's lots of thermostat examples but they seem part of a complicated heating control rather than a simple turn on relay if measured temp < demand :)

Link to comment
Share on other sites

Thanks for the info - I've pretty much managed to do something very similar on the temperature etc, but the demo I found just streams the data continuously.

You're correct in that mine is a basic "read value-> check if within parameters -> do something or wait for next measurement" but it's a little more complicated as that, as I want it to work out the dew point for inside the camera dome and outside, and work out what the temperature is inside vs outside too and whether to cool / ventilate the dome internally (too warm), warm / ventilate it internally (for internal dew) or warm the dome without ventilation for external dew.

Yes this may only involve a python script, but only know how to spell python at the moment, nothing more!

The waveshare board examples is what I've tried, but these are manual - I need to learn how to run it automatically based on the results from the sensors / truth table.

  • Like 1
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.