Category : Blog

First night sky timelapse video

So I had some (limited) success with my astrophotography last night. It was a clear night for an hour or so and I managed to get the settings for raspistill tweaked to capture some night stars. I grabbed a couple of hundred shots and then converted those into a short video.

The settings I used for raspistill were:

raspistill -bm -tl 1000 -v -set -ISO 800 -awb off -awbg 1,1 -t 21600000 -ss 6000000 -o %06d.jpg

This created a bunch of .jpg files, but skipped tons of frames, so the numbering sequence was way out of kilter (000001.jpg, 000048.jpg, 000073.jpg etc). To fix that, and get them into a proper sequence I used a little script as follows:

for F in 0*.jpg; do 
 echo "$F" `printf image_%06d.jpg $I` 
 mv "$F" `printf image_%06d.jpg $I` 2>/dev/null || true 
 I=$((I + 1)) 

Then, to convert the individual jpgs into an mp4 movie I used avconv in the libav-tools package as follows:

avconv -i image_%03d.jpg -r 5 -vf scale=1280:720 -vcodec libx264 -r 5 star-trail-$(date "+%Y%m%d-%H%M%S").mp4


Raspberry Pi NoIR Camera for Astrophotography

I’ve been looking at using my Raspberry Pi NoIR Camera for Astrophotography recently…

A decent shot of the Milky Way is the objective. A decent time-lapse video of a clear sky through the night is a secondary goal. The Pi NoIR camera may be a bit limited as it only has up to around 6 seconds of exposure. This limitation can be countered with ‘stacking’ (if I understand it correctly).
There is a great resource here that dives into the detail of how best to shoot astrophotography. It covers some great guides as to what equipment, what settings etc.
There are some interesting points around settings used for the Pi Camera with raspistill to get ‘star trails’ in this project. Those settings are a good starting point.

There is a lot of trial and error involved in shooting this kind of stuff. Capturing a bunch of frames, stacking and seeing how they look, rinse, repeat.
To hopefully remove a lot of that trial and error, I’ve used this github project. It has some really useful features:

  • A web view of the image, and
  • Allows control of all camera aspects, and
  • Handles time-lapse, and
  • Provides downloads of the acquired images, video or sequences.

So, tonight’s plan is to get things set up outside, find the optimal settings, then kick off a time-lapse run.

If I get a chance I’ll also look out my little IR LED module and see how things look with that.


Raspberry Pi with a RDA5708 FM Radio Module

I’ve been playing around with getting a Raspberry Pi with a RDA5708 FM Radio module working.

Raspberry Pi with a RDA5708 FM Radio

I bought 2 of them from ebay for around £7. They took around 2 weeks to arrive (from China).
Wiring them up is pretty simple. They are controlled via I2C, so only need SDA, SCL and power (3v3 and Gnd). Audio out is via a standard 3.5mm headphone socket and it has pin holes for a 3 pin header providing Left, Right and Ground.

It took me a little while to get things going and working out the correct command sequences to send it. When that was cracked it was pretty much plain sailing. The resulting audio is fine (for a small radio). The headphones also act as a decent antenna for radio reception, so no need for connecting an antenna for testing.

Raspberry Pi with a RDA5708 FM Radio : Getting it working

I will post a fuller tutorial later but getting it working boiled down to 3 steps:

  1. Send the correct initialisation commands (0x00, 0xC0, 0x02, 0x00, 0x00, 0x04, 0x00, 0xC3, 0xA7, 0x60, 0x00, wait 500mS then send 0x00, 0xC0, 0x01)
  2. Set the desired frequency and set the tune bit (there is a specific algorithm for it, but it is pretty simple to implement).
  3. Set the desired volume (least significant nibble of one of the registers)

There is a bunch more to do in terms of measuring signal strength, scanning frequencies etc. That said, for quickness, the 3 steps above will get you listening to your favourite station. Some of these modules also have RDS capabilitiy but I do not think the particular version I got has this. It may have and I just don’t yet know how to turn it on – more experimenting required.

Sample code will be posted to GitHub in the next few days is on GitHub

I have a project in progress where I’m replacing the ‘guts’ of a vintage Roberts Rambler II Radio (from the 70’s) with this module.

Vintage Pi Radio Project

Our kitchen radio finally gave up the ghost a few days ago. I suspect it is just the power supply, and at some point I’ll crack it open and see if it is salvageable. However, it was a good opportunity for another little side project – A Vintage Pi Radio.

I just won an auction for one of these vintage transistor radios on eBay.

Vintage Pi Radio - Case

… which prompted me to order a couple of FM Stereo decoder modules (with a convenient I2C interface for control) and begin shaping ideas for a Raspberry Pi Zero vintage radio project. There’s plenty of info and datasheets around for the RDA5802 IC that these modules are based on, so it shouldn’t be too much trouble to get it up and running. I also have a bunch (5) of the little 3W+3W 5volt amplifiers from my previous (first version) of the Raspberry Pi Outdoor Music Player project (which, by the way is also getting a cool new chassis).

Vintage Pi Radio - i2c fm stereo receiver module

Combined cost was less than £10, so less than £15 all in, including a Raspberry Pi Zero. Watch this space for more details

Pi Outdoor Music Player Update

Finally completed the V1 Pi Outdoor Music Player. This is an old power tool case modified to mount/contain:

  • Speakers mounted on the top/face.
  • A 3Watt 5Volt stereo audio amp.
  • A 20,000mAh portable battery pack.
  • A Raspberry Pi B+ with a Wifi dongle, running mpd and ympd.

Pi Outdoor Music PlayerPi Outdoor Music Player

Sound is loud enough for a family BBQ and decent quality. The stereo amp has a volume control to allow adjustment. The wifi dongle (and ympd) allow the music and playlists to be controlled via a phone or tablet.

A full write up on the project will be coming shortly…
The full project write up can be found here

Another Raspberry Pi Zero Case

So, it was time to buy another Raspberry Pi Zero Case, as I’m now onto my third one of these amazing little devices. I had intended to buy another of the cases that I purchased for my first one. At the last minute I decide I should probably go for a bit of variety and choose a different one.

After a little searching around on Amazon and eBay, I settled on one of the modular laser cut acrylic style cases – £3.47 with free delivery. It arrived in a couple of days in a thin envelope.
There was a ~3mm thick piece of acrylic about 70mm wide by 200mm long, taped to a piece of card to hold it all together. From this the shape of each layer had been cut.


Snapping all the layers out and peeling the protective film off was a simple task. There are 4 layers plus an (optional) couple of super thin bits for some support.  You put the bottom 2 layers together then the Pi Zero, then (optionally the 2 super thin bit – I used the stand-offs instead) and then choose between the 2 top pieces. One designed for covering in the GPIO header (no pins soldered) and the other exposing the GPIO header. There are also 4 nuts/bolts provided to secure the whole thing together with the Pi Zero sandwiched in the middle.

The case looks good, is very functional and has easy access to all the ports, SD card and camera connector. There are a few little (tiny) blemishes on one of the parts, but they are hardly noticeable. The whole thing feels very secure and there is no movement, nor any undue pressure on the device.

All in all, a decent Raspberry Pi Zero Case. Here are some pics of the assembled unit.