I decided this morning to shoot a video of my progress so far on the SpacePi, which is intended to be a motorised platform for taking astronomical photographs using the Raspberry Pi with the official camera module.
Here are the details again for those who didn’t catch them from the video.
Bill of materials:
- Raspberry Pi Model B 512M in an SB Components case.
- Camera module (also see previous blog posts).
- Pan/tilt mechanism (also see my blog post).
- 2 x 8g servos
- 4 x AA batteries inside a battery holder.
- Small breadboard.
- GPIO breakout board with cable.
- A few pieces of bell wire for the connections
- LEGO. Lots of LEGO (or Megablocks).
The servos control the pan/tilt mechanism. They are powered by 4xAA batteries and controlled using 2 GPIO pins. They share a common ground connection (this is where the servo ground connection and the Pi ground connection are connected to each other). The camera module is held onto the pan/tilt by blu-tack (because I don’t have appropriate screws and nuts) and the whole thing is sat on a LEGO/Megablocks monstrosity.
The front end is a set of PHP pages. I’m using Nginx as a web server, but if you’re reproducing it, you don’t have to. The index page contains 4 controls: tilt up and down, pan left and right. These are watched using jQuery for ‘click events’. When the controls are clicked on, an Ajax request to one of two PHP pages is sent. These secondary pages use the PHP command shell_exec() to run a Python script that drives the PWM pulses going to the servos. The jQuery on the index page keeps track of the current position of the servos and resets them when the page is reloaded.
Eventually, I will be taking this rig outside to get clear pictures. Then, it will be powered by my USB battery pack.
Next steps
Make the UI a little more attractive (even if it’s just using arrow icons) and hook up the ‘take photograph’ functionality. I’ve already done the latter but I need to be sure that there is some kind of concurrency check as the camera doesn’t like it if you try and take two pictures at the same time.
[…] recantha *flicks microphone* Testing testing 1… 2… 3… Is this thing on? I decided this morning to […]
[…] http://178.62.14.192/?p=3615 ซึ่งเป็นส่วนหนึ่งของ SpacePi ของบล็อก […]
Hi Michael
I’m thinking a couple of steppers might be worth testing out as well,as they might be more accurate than a servo. (but not as quick to get into position of course
Simon
Hi Simon.
Yeah, I was experimenting with steppers to start with – running little ones off the GPIO (no battery).
I got them working, but I wasn’t sure how you mount things on them so looked for pan/tilt mechanisms and found that they were all servo-powered.
—
Mike