{"id":1639,"date":"2014-12-30T15:46:32","date_gmt":"2014-12-30T13:46:32","guid":{"rendered":"http:\/\/saisa.eu\/blogs\/Guidance\/?p=1639"},"modified":"2016-10-21T10:30:38","modified_gmt":"2016-10-21T07:30:38","slug":"raspberry-pi-camera-and-telescope-first-tests","status":"publish","type":"post","link":"https:\/\/saisa.eu\/blogs\/Guidance\/?p=1639","title":{"rendered":"Raspberry Pi camera and telescope, first tests"},"content":{"rendered":"<p>I got <a href=\"http:\/\/www.raspberrypi.org\/products\/model-b-plus\/\">B+ model<\/a> of the Raspberry Pi as christmas gift. Then I saw the size of the <a href=\"http:\/\/www.raspberrypi.org\/help\/camera-module-setup\/\">camera module<\/a>, and I just had to go and buy one. I have been testing different webcam and digital camera setups with my telescope, and this camera module seemed very promising.<\/p>\n<p>My goal is simple: take a photo on what you see through the eyepiece.<\/p>\n<p>It is using <a href=\"http:\/\/en.wikipedia.org\/wiki\/Afocal_photography\">Afocal photography<\/a>, where the camera is mounted over the eyepiece of an optical telescope, with the camera lens taking the place of the human eye.<\/p>\n<p><img loading=\"lazy\" alt=\"RPI-camera-2inch-eyepiece\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/rpi-camera-2inch-eyepiece.png\" width=\"275\" height=\"208\" \/><\/p>\n<p>Unfortunately the wheather has not been suitable for taking sky photos, so I did first quick tests through a window (there might be some artifacts in the photos).<\/p>\n<p>The picture below shows the camera support on top of the 1.25&#8243; eyepiece. Only the power and LAN cables are connected to the Raspberry Pi.<\/p>\n<p><img loading=\"lazy\" alt=\"RPI-camera-Zoom-meade\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/rpi-camera-zoom-meade.png\" width=\"275\" height=\"488\" \/><\/p>\n<p><strong>Camera details<\/strong><\/p>\n<p>From <a href=\"http:\/\/elinux.org\/Rpi_Camera_Module\">Rpi Camera Module<\/a><\/p>\n<ul>\n<li>\n<div>Sensor type: OmniVision OV5647Color CMOS QSXGA (5-megapixel)<\/div>\n<\/li>\n<li>\n<div>Up to 90 fps Video at VGA<\/div>\n<\/li>\n<li>\n<div>applications:<\/div>\n<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>\n<div>RaspiVid<\/div>\n<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>\n<div>creates H264 videos<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>RaspiStill<\/div>\n<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>\n<div>can create PNG and raw images<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>Pi Vision<\/div>\n<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>\n<div>a GUI based controller<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>picamera<\/div>\n<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>\n<div>\n<p>a Python library<\/p>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>From Raspberry Pi Camera Module &#8211; <a href=\"http:\/\/www.mobileappsystems.com\/blog\/camera-module-part-1\">Part 1<\/a><\/p>\n<ul>\n<li>\n<div>with link to camera&#8217;s <a href=\"http:\/\/dlnmh9ip6v2uc.cloudfront.net\/datasheets\/Dev\/RaspberryPi\/ov5647_full.pdf\">data sheet<\/a><\/div>\n<\/li>\n<li>\n<div>Dimensions: 25mm x 20mm x 9mm<\/div>\n<\/li>\n<li>\n<div>Weight: 3g<\/div>\n<\/li>\n<li>\n<div>Sensor size: 3.67 x 2.74 mm<\/div>\n<\/li>\n<li>\n<div>Pixel count: 2592 x 1944<\/div>\n<\/li>\n<li>\n<div>Lens: f=3.6 mm, f\/2.9<\/div>\n<\/li>\n<li>\n<div>Angle of View: 54 x 41 degrees<\/div>\n<\/li>\n<\/ul>\n<p>From <a href=\"http:\/\/www.raspberrypi.org\/documentation\/raspbian\/applications\/camera.md\">Camera module manual page<\/a>, <a href=\"http:\/\/www.raspberrypi.org\/documentation\/usage\/camera\/raspicam\/README.md\">raspicam commands<\/a><\/p>\n<ul>\n<li>raspistill<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>Capturing still photographs with the camera module<\/li>\n<\/ul>\n<\/li>\n<li>raspivid<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>Capturing video with the camera module<\/li>\n<\/ul>\n<\/li>\n<li>Time-lapse<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>Taking pictures at regular intervals and stitching them together in to a video<\/li>\n<\/ul>\n<\/li>\n<li>raspiyuv<\/li>\n<li style=\"LIST-STYLE-TYPE: none\">\n<ul>\n<li>Capturing still photographs and generating raw unprocessed image files<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Setting Up<\/strong><\/p>\n<p>Create a bootable image on microSD. I used <a href=\"http:\/\/www.raspbian.org\/\">raspbian<\/a> (Debian Linux) from downloads <a href=\"http:\/\/www.raspberrypi.org\/downloads\/\">page<\/a>. The instructions as also on that same page. Instructions for windows are <a href=\"http:\/\/www.raspberrypi.org\/documentation\/installation\/installing-images\/windows.md\">here<\/a>.<\/p>\n<p>Connect keyboard, mouse, LAN cable, and HDMI-&gt;VGA converter before connecting the power cable.<\/p>\n<p><strong>Raspberry PI basics<\/strong><\/p>\n<p>Login: Use userid <em>pi<\/em> and password <em>raspberry<\/em><\/p>\n<p>To turn the power off, use command <em>sudo poweroff<\/em><\/p>\n<p><strong>Raspberry PI tuning<\/strong><\/p>\n<p>One of the most important file is \/boot\/config.txt. The HDMI settings are defined there, so it is the first place to modify in order to get the display working. (Unless you have a monitor with HDMI.) The parameters are explained <a href=\"http:\/\/www.raspberrypi.org\/documentation\/configuration\/config-txt.md\">here<\/a>. I used a HDMI-to-VGA converter as shown in the picture below. The same power source (max 2A) is used to provide power to Raspberry Pi and the converter. The photo also shows the 1.25&#8243; zoom eyepiece modified to fit the camera. The camera is visible on the left, under the proof-of-concept mechanical support for the 2&#8243; eyepiece.<\/p>\n<p><a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/rpi-camera-zoom-vga-power.png\"><img loading=\"lazy\" alt=\"RPI-camera-Zoom-VGA-power\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/rpi-camera-zoom-vga-power-small.png\" width=\"550\" height=\"260\" \/><\/a><\/p>\n<p>In order to get the VGA monitor to work, I defined the following lines<\/p>\n<p><em>hdmi_force_hotplug=1<br \/>\nhdmi_group=2<br \/>\nhdmi_mode=16<\/em><\/p>\n<p>In order to turn off the camera light, add the line <em>disable_camera_led=1<\/em><\/p>\n<p>One need to activate the camera and ssh access by using command <em>sudo raspi-config<\/em><\/p>\n<p>After modifications, one need to reboot by command <em>sudo reboot<\/em><\/p>\n<p><strong>Using Desktop GUI with Raspberry PI<\/strong><\/p>\n<p>One can use command <em>startx<\/em> if having a monitor connected to HDMI and you are using RPI locally.<\/p>\n<p>One can use command <em>lxsession<\/em> if connecting over the network. I used <a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/?p=292\">Xming<\/a> (with one window) and putty (ssh with XForwarding) on Windows. (DISPLAY and Xauth is taken care by putty). Alternative command <em>openbox-session<\/em> worked also.<\/p>\n<p>H264 videos can be converted with <a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/?p=438\">VLC<\/a>. One can use <a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/?p=183\">WinSCP<\/a> for transferring the picture and video files to Windows.<\/p>\n<p><strong>Testing with Pi-Camera GUI tool<\/strong><\/p>\n<p>One can follow example instructions <a href=\"http:\/\/www.element14.com\/community\/docs\/DOC-65138\/l\/getting-started-with-the-pi-camera-instructions\">here<\/a>.<\/p>\n<p><em>sudo apt-get install python3-setuptools<\/em><\/p>\n<p><em>sudo easy_install3 picamera<\/em><\/p>\n<p>Download python3 and Tk based GUI tool <a href=\"https:\/\/github.com\/element14\/pi_project\/blob\/master\/Pi_Camera\/CamInterfacev1p0p0.py\">CamInterfacev1p0p0.py<\/a>, and run it with command <em>python3 CamInterfacev1p0p0.py<\/em><\/p>\n<p>I used this tool over the network to find a suitable camera position, and to mimimize vignetting.<\/p>\n<p><a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/rpicameradistances.png\"><img loading=\"lazy\" alt=\"RPiCameradistances\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/rpicameradistances-small.png\" width=\"550\" height=\"330\" \/><\/a><\/p>\n<p><strong>Testing with PiVision GUI tool<\/strong><\/p>\n<p>One can find the instructions for <a href=\"http:\/\/heywhatsthebigidea.net\/?ddownload=1021\">download<\/a> and usage <a href=\"http:\/\/heywhatsthebigidea.net\/projects\/pi-vision-a-raspberry-pi-camera-controller\/\">here<\/a>. Please note that there is no need to install FPC or Lazarus.<\/p>\n<p>One can also use the command <em>chmod u+x rpiCC<\/em> to change the extracted file into executable.<\/p>\n<p>The XMing screenshot below shows lxsession look and feel when operating over the network. The taskmanager shows high CPU often, and reminds that the CPU is much weaker than in desktops&#8230;<\/p>\n<p><a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/pivision-screenshot-raspberry.png\"><img loading=\"lazy\" alt=\"PiVision-screenshot-raspberry\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/pivision-screenshot-raspberry-small.png\" width=\"550\" height=\"343\" \/><\/a><\/p>\n<p>This tool is great and provides more options than the simple picamera example GUI. In addition it also shows the actual command line with parameters. I used this tool in order to see the parameters used, and then I moved to the command line versions since it provides more control.<\/p>\n<p><strong>Testing with command line<\/strong><\/p>\n<div style=\"OVERFLOW: auto; WIDTH: 650px\">\n<pre>\nraspistill -n -br 50 -t 500 -o \/home\/pi\/cmd45.png -e png -w 2592 -h 1944 -v\nraspistill -n -t 500 -o \/home\/pi\/zoomA4-21-90.png -e png -w 2592 -h 1944 -v -ss 10000 -br 50 -awb off -ISO 100\nraspivid -t 4000 -o \/home\/pi\/kuvat\/video3.h264 -w 1920 -h 1080 -fps 5 -v -br 50\n<\/pre>\n<\/div>\n<p><strong>Open Issue<\/strong><\/p>\n<p>The both pictures below shows a horizontal stripe around Y=430. I do not know if the stripe is related to specific parameters (like resolution) used to capture photo, or if they are related to power supply or electric shielding or any other issue. This is something to investigate in the future&#8230;<\/p>\n<p><a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/zooma12-7-5.png\"><img loading=\"lazy\" alt=\"zoomA12-7-5\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/zooma12-7-5-small.png\" width=\"258\" height=\"193\" \/><\/a> <a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/zooma20-7-5.png\"><img loading=\"lazy\" alt=\"zoomA20-7-5\" src=\"http:\/\/saisa.eu\/blogs\/Guidance\/wp-content\/uploads\/2014\/12\/zooma20-7-5-small.png\" width=\"258\" height=\"193\" \/><\/a><\/p>\n<p><strong>Summary<\/strong><\/p>\n<p>The camera looks very promising. The first test shows good capabilities. My impression is that the pictures represent the view that I see when I look through the eyepiece. There is a lot of tuning left, but that&#8217;s part of the game. I still need to improve the mechanical parts and manual focussing too \ud83d\ude42<\/p>\n<p>For the next attempt to take sky photos I will use the preview mode to find the right position for the camera. Unless if I find a good way to stream the video to another laptop, since I might need another laptop to find the &#8220;targets&#8221; with <a href=\"http:\/\/saisa.eu\/blogs\/Guidance\/?p=933\">Stellarium<\/a>.<\/p>\n<p>I see a lot of potential usages for small devices like Raspberry Pi. There has been interesting examples in the internet, things to test &amp; try&#8230;<\/p>\n<p><strong>Other Links<\/strong><\/p>\n<p><a href=\"http:\/\/www.raspberrypi.org\/astrophotography-with-the-camera-board\/\">Another case<\/a> where RPI camera has been used with telescope.<\/p>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/node-telescope-server\">Another case<\/a> where RPI is used to remote control the telescope. And <a href=\"http:\/\/simonbox.info\/index.php\/astronomy\">another<\/a>.<\/p>\n<p><a href=\"http:\/\/www.agurney.com\/raspberry-pi\/stargazy-pi\">Problems<\/a> to get Stellarium working on RPI.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got B+ model of the Raspberry Pi as christmas gift. Then I saw the size of the camera module, and I just had to go and buy one. I have been testing different webcam and digital camera setups with &hellip; <a href=\"https:\/\/saisa.eu\/blogs\/Guidance\/?p=1639\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17,18,74,67,34,63,82,66,51],"tags":[],"_links":{"self":[{"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=\/wp\/v2\/posts\/1639"}],"collection":[{"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1639"}],"version-history":[{"count":4,"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=\/wp\/v2\/posts\/1639\/revisions"}],"predecessor-version":[{"id":1974,"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=\/wp\/v2\/posts\/1639\/revisions\/1974"}],"wp:attachment":[{"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saisa.eu\/blogs\/Guidance\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}