gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sat Apr 19, 2014 1:32 pm

Mars 18/4/2014 Pi Noir camera with UV&IR cut filter.

Meade LX10, processed with registax.

Gordon77
Attachments
Mars_18042014.jpg
Mars 18042014
Mars_18042014.jpg (25.16 KiB) Viewed 5988 times

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Tue Jul 08, 2014 10:18 am

Just tried the latest Raspbian and my Philips NPC900 webcam connects on USB :D (the 840 won't or my 3D webcam :( )

The 900 webcam is a popular one for astrophotography.

Anyone know how to control a webcam via Python ?

Gordon77

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Thu Jul 10, 2014 9:16 am

All I can find is cam.set_controls() which only seems to have vflip, hflip and brightness.

Brightness seems to be working on the 900 so I'll go with that for now.

gordon77

EckyH
Posts: 1
Joined: Sun Jul 06, 2014 8:48 pm

Re: RaspberryPi Camera for Astrophotography

Sat Sep 06, 2014 8:11 am

gordon77 wrote: Heres the details of the ST-4 interface
Hello and thanks for the project idea. I'd like to control a mount (Losmandy G9 with DDS Model 492) via RPi as well.

I'm not in electronics generally and and integrated circuits in particular, so please forgive me my dumb question: What's the reason for those four dedicated digital relays?
Found a lot of other types available from several dealers, some with 4 integrated relays.
Despite a search for the ST-4 "standard" documents (eg. for voltage and current used) - didn't found any other documents than descriptions of the pin-out...

Thank you very much!

E.

raceconditions
Posts: 4
Joined: Fri Jul 04, 2014 4:56 pm

Re: RaspberryPi Camera for Astrophotography

Fri Oct 31, 2014 3:26 pm

So this very post was actually my inspiration for getting a Raspberry PI hooked up to my telescope. I ended up using Proto Armour and a series of mount adapters to make the attachment and I have to say it worked extremely well. I've blogged about this and some of the software I've been working on for GPS telescope sync and a WiFi telescope server.

For the hardware configuration, check here:
NexStar SE Telescope and Raspberry PI

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Thu Nov 06, 2014 6:43 pm

EckyH wrote:
gordon77 wrote: Heres the details of the ST-4 interface
Hello and thanks for the project idea. I'd like to control a mount (Losmandy G9 with DDS Model 492) via RPi as well.

I'm not in electronics generally and and integrated circuits in particular, so please forgive me my dumb question: What's the reason for those four dedicated digital relays?
Found a lot of other types available from several dealers, some with 4 integrated relays.
Despite a search for the ST-4 "standard" documents (eg. for voltage and current used) - didn't found any other documents than descriptions of the pin-out...

Thank you very much!

E.
Sorry l hadn't noticed this question.

The 4 relays provide the + and - ra and Dec controls.

Here's the st4 connection, but note it can change on various makes of equipments.

http://www.nexstarsite.com/OddsNEnds/AutoGuide.htm

Gordon77

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Thu Nov 06, 2014 6:54 pm

raceconditions wrote:So this very post was actually my inspiration for getting a Raspberry PI hooked up to my telescope. I ended up using Proto Armour and a series of mount adapters to make the attachment and I have to say it worked extremely well. I've blogged about this and some of the software I've been working on for GPS telescope sync and a WiFi telescope server.

For the hardware configuration, check here:
NexStar SE Telescope and Raspberry PI
Hi,

Looks very good. What software are you using ?

Gordon77

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Nov 07, 2014 2:44 pm

gordon77 wrote:
EckyH wrote:
gordon77 wrote: Heres the details of the ST-4 interface
Hello and thanks for the project idea. I'd like to control a mount (Losmandy G9 with DDS Model 492) via RPi as well.

I'm not in electronics generally and and integrated circuits in particular, so please forgive me my dumb question: What's the reason for those four dedicated digital relays?
Found a lot of other types available from several dealers, some with 4 integrated relays.
Despite a search for the ST-4 "standard" documents (eg. for voltage and current used) - didn't found any other documents than descriptions of the pin-out...

Thank you very much!

E.
Sorry l hadn't noticed this question.

The 4 relays provide the + and - ra and Dec controls.

Here's the st4 connection, but note it can change on various makes of equipments.

http://www.nexstarsite.com/OddsNEnds/AutoGuide.htm

Gordon77
Sorry I misread this, you already know the pinout !. I am the same on the ST4 volts and currents, I can't find any figures. I used the relays to get opto-isolation, and they can handle > 1A but I don't suspect the currents get anywhere near that.

Gordon77

Stupotmcdoodlepip
Posts: 21
Joined: Sun Jan 26, 2014 6:25 pm

Re: RaspberryPi Camera for Astrophotography

Fri Nov 07, 2014 5:08 pm

Many ST4 devices are USB bus powered, so you can safely assume that the total required current is less than 500mA, however, in reality, if the inputs simply drive, for example, microcontroller inputs, then they'll likely only draw microamps at most.
Pretty simple to check using a multimeter (set to mA mode) in series with the relay switched contacts.
The relays are most likely used for galvanic isolation, e.g., where there's no guarantee that the two subsystems will share a common ground, say, for instance if your controller is powered by a mains adaptor and the guide camera is plugged into a PC or laptop.

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sat Nov 08, 2014 6:04 pm

Stupotmcdoodlepip wrote:Many ST4 devices are USB bus powered, so you can safely assume that the total required current is less than 500mA, however, in reality, if the inputs simply drive, for example, microcontroller inputs, then they'll likely only draw microamps at most.
Pretty simple to check using a multimeter (set to mA mode) in series with the relay switched contacts.
The relays are most likely used for galvanic isolation, e.g., where there's no guarantee that the two subsystems will share a common ground, say, for instance if your controller is powered by a mains adaptor and the guide camera is plugged into a PC or laptop.
When 'driving' ST4 you sink current, to earth/common rather than supplying current, but your interface may need current, possibly from the USB etc.

Gordon77

HKay
Posts: 1
Joined: Mon Nov 10, 2014 9:15 pm

Re: RaspberryPi Camera for Astrophotography

Tue Nov 11, 2014 9:06 pm

Hi Gordon,

Some days ago, I found you posting and your autoguiding software. I was able to adapt your code to use the PiFace-interfaceboard to connect to the autoguider interface of my mount and to connect to the camera. As far as I was able to test, the autoguiding seems to work. Wasn't able to go outside yet.
Do you currently have some newer version of your program? Are you interested in the changes for the PiFace (which aren't very difficult, as you surely would know)?
Anyway, I want to thank you for this piece of code and hope to be able to test it outside as soon as possible!

Greetings,
Hardy

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Thu Nov 13, 2014 4:31 pm

Hi,

Glad you like the software. I attach the latest version, I think the changes are some bug fixes, some speed improvements, added a PHOTO button where you can take photos with an external camera (eg DSLR) with a suitable interface to another GPIO (you control the camera in bulb mode. Set the number of photos you want and the time of exposure and press PHOTO), you can also set the brightness of images if using a USB camera, and if you press the SHIFT key it will store images for later processing.

Please note that using any software or any interface designs l have uploaded is at your own risk. I have tested it on my own equipment. Please take care when interfacing to any equipment, eg a telescope, camera, to ensure you do not damage them.

If you want to publish how you used the PiFace that would be interesting.

Let me know how it goes.

Gordon77
Last edited by gordon77 on Wed Jan 21, 2015 2:42 pm, edited 1 time in total.

deivid
Posts: 46
Joined: Thu Oct 23, 2014 7:08 am

Re: RaspberryPi Camera for Astrophotography

Sun Nov 16, 2014 6:33 am

gordon77 wrote:noir[...]
I saw your post about taking a pic with an UV filter, does that mean that you can capture UV light? if so, could you take a picture of your face? I'm looking to set up an UV-capturing camera to 'check' people's skin

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sun Nov 16, 2014 9:03 am

deivid wrote:
gordon77 wrote:noir[...]
I saw your post about taking a pic with an UV filter, does that mean that you can capture UV light? if so, could you take a picture of your face? I'm looking to set up an UV-capturing camera to 'check' people's skin
Sorry I don't know if the Pi camera is sensitive to UV. I used an astronomy filter that cuts IR & UV that can blur the images. I think you'll need to look for a filter to pass UV to try.

Gordon77

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Wed Jan 21, 2015 2:13 pm

Updated version.

I bought a 7" HDMI so there is now a Display option where you can select LCD (848x480),Composite (640x480) etc. You'll also need to adjust config.txt to suit.
(note on a 7" HDMI display (848x480) the SAVE and RELOAD buttons won't appear fully, you can just press Keys 1,2 or 3 to RELOAD or Keys 4,5 or 6 to SAVE the configs. This maybe sorted with setting /boot/config.txt with appropriate settings and using Un/Decorate to remove the window header.

scr cap = screen (window) capture (as below)
pic cap = picture capture, saves a full res Pi camera image
con cap = constant capture, saves every image

It took quite a bit or rewriting so let me know of any bugs.

Please note that using any software or any interface designs l have uploaded is at your own risk. I have tested it on my own equipment. Please take care when interfacing to any equipment, eg a telescope, camera, to ensure you do not damage them.

Gordon77
Attachments
Pi with camera.jpg
Pi with camera and telescope adaptor
Pi with camera.jpg (58.15 KiB) Viewed 4331 times

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sun Feb 01, 2015 9:39 pm

Update.
Should now update the picture quicker (thanks to the tip from ethanol100!) plus a few minor bug fixes.

Picture from tonight, Canon 7D , 400mm f5.6 lens, guided by 80mm scope and Pi with camera and this software.

Gordon77
Attachments
M42.jpg
M42
M42.jpg (48.38 KiB) Viewed 4234 times
scr_pic10.jpg
Screenshot
scr_pic10.jpg (58.33 KiB) Viewed 4234 times
Last edited by gordon77 on Thu Dec 10, 2015 7:35 pm, edited 1 time in total.

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Tue Feb 03, 2015 5:17 am

The Telescope setup for testing.
Attachments
IMG_20150203_051502.jpg
The setup
IMG_20150203_051502.jpg (58.36 KiB) Viewed 4208 times

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sat Feb 07, 2015 4:41 pm

gordon77 wrote:Update.
Should now update the picture quicker (thanks to the tip from ethanol100!) plus a few minor bug fixes.

Picture from tonight, Canon 7D , 400mm f5.6 lens, guided by 80mm scope and Pi with camera and this software.

Gordon77
Updates the pictures even quicker with a Pi2 :D

If you're using RPi.GPIO you'll need to update, see below, or try raspbian image dated 2015-02-16
Attachments
P2g.jpg
Pi2 version
P2g.jpg (59.29 KiB) Viewed 4037 times
Last edited by gordon77 on Thu Feb 19, 2015 9:24 pm, edited 2 times in total.

fireshipjohn
Posts: 8
Joined: Thu Jan 26, 2012 12:34 am

Re: RaspberryPi Camera for Astrophotography

Fri Feb 13, 2015 5:02 pm

The RPi.GPIO is now updated/published and it all works OK on an Pi2 :)

So just an apt-get update and an apt-get upgrade will do it, although I think a firmware update is required to fix other (PWM) issues with the RPi.GPIO package, so best do a rpi-update and reboot also.

So now a nice VNC session to a remote Pi2 runs at about 35% cpu load.

John

vendinleciel
Posts: 2
Joined: Fri Feb 20, 2015 8:36 am

Re: RaspberryPi Camera for Astrophotography

Fri Feb 20, 2015 9:35 am

Hello, i live in North of France and i am very interesting by your developpement.
I try for a couple of weeks to make telescope tracking on an old st4 mount with a webcam and with raspberry.
So your project seems fit for it.
I should try with a webcam philips before buying a PI camera.
it seems there is two tracks for an ST4 mount:
1 for using an arduino with 4 relays module, but i do'nt find the .ino software for arduino ? does it exist somewere?
2 for using a direct connexion between GPIO and relays module.

Is one system more efficient than the other?

Congratulations for this project.

Vendin le ciel

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Feb 20, 2015 10:46 am

.ino attached for Arduino, if need any more details let me know.

If you use the Seeed 4 relay board (shown early in the thread as ST4-5c.jpg) you'll need to change

const int West = 4; //pin of the Arduino WEST
const int South = 6; //pin of the Arduino SOUTH
const int North = 7; //pin of the Arduino NORTH
const int East = 5; //pin of the Arduino EAST
const int MotorStep = 3; //pin of the Arduino connects to the STEP pin of the EasyDriver board or PWM interface
const int MotorDir = 2; //pin of the Arduino connects to the DIR pin of the EasyDriver boardor PWM interface

Either system is OK .
Using a usb camera and the GPIO may have some minor issues with timings of the pulses to the scope, depending how long it takes to take an image, and I haven't worked out a method to control the camera parameters except for brightness so everything else is auto.
Using the Pi GPIO maybe cheaper unless you have an Arduino + relay board.
You maybe able to us a cheap opto isolator instead of my opto relays.
I wasn't sure of the current needed to switch but I have read recently on Meade, Celestron its only 50mA so maybe worth a try.

Gordon77
Attachments
Scope_Emulator.zip
,ino file
(5.63 KiB) Downloaded 153 times

vendinleciel
Posts: 2
Joined: Fri Feb 20, 2015 8:36 am

Re: RaspberryPi Camera for Astrophotography

Fri Feb 20, 2015 4:01 pm

Hello Gordon
thanks for your quick answer.

I should first try with GPIO and 4 relay module because i am waiting for an arduino.

In your answer you speak of an Easydriver module wired on arduino; i don't see any reference about this module in the forum or in the pictures and diagrams of the project.
Does it drive directly a stepper motor and for what use?

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Feb 20, 2015 4:15 pm

This started out as a project to drive a Meade LX10 from a PC using PHD guiding software etc.

I added control to be able to drive a Meade #1209 focusser, another user wanted a drive for a stepper motor he wanted to use for focussing his scope so I added that, I've never seen it used.
I assume it drives one of these https://www.sparkfun.com/products/retired/9402

The arduino program can also do other features such as accept inputs from a LX10 handcontroller or a ST-4 device to control the LX10 ( the LX10 is not ST-4) and also accept variable pot inputs to produce a fairly crude drift control on star loss but you probably won't need any of this to drive a ST-4 scope. They should all be disabled in the program so you dont need to connect any of these inputs.

Gordon77
Attachments
focus.jpg
focus.jpg (20.11 KiB) Viewed 3772 times
arduino.jpg
the arduino
arduino.jpg (56.7 KiB) Viewed 3772 times

fireshipjohn
Posts: 8
Joined: Thu Jan 26, 2012 12:34 am

Re: RaspberryPi Camera for Astrophotography

Mon Mar 02, 2015 10:16 am

Hi Gordon,

I found a small bug I think, if I leave the program running for an extended period it sometime crashes with a message:

JPEG loading error - at line 736.

It looks like a race condition with raspistill updating /run/shm/test.jpg.

So I tried this little patch which seems to fix it. (well it outputs the message and doesn't crash!)

Code: Select all

735,736c735,740
< 
<       image = pygame.image.load(imagefile)
---
>       try:
>         image = pygame.image.load(imagefile)
>       except pygame.error, message:
>         print 'Failed initial load image:', imagefile 
>         time.sleep(0.5)
>         image = pygame.image.load(imagefile)  
Its not a full fix, because you could get two successive failures, but seems to work for me.

John

gordon77
Posts: 4112
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Mon Mar 02, 2015 5:16 pm

Thanks John,

I can't say I have seen that and I've run it for many hours, so I am not sure what's happening.

Are you using a Pi1 or Pi2 ?

What settings are you using ? Exp mode off ? Exp time ? Any options on eg graph, Plot, log ? Can you upload a screen shot ( scr pic)

When I originally wrote it I read about reading incomplete files but I never saw that either.

I'll include your fix in the next version, let me know if it all goes well. Sounds like we should only lose 0.5 secs occasionally.

Gordon
Last edited by gordon77 on Tue Mar 03, 2015 3:50 am, edited 1 time in total.

Return to “Camera board”