Saturday, August 23, 2014

Automated Time Lapse - Raspberry Pi

Based on a previous Time Lapse generating system, I wanted to build another version with a Raspberry Pi that would be put outside inside an enclosure. I had attempted Time lapse Photography with a Raspberry Pi and a Microsoft Webcam before, but had issues with stability past more than a day. The Raspberry would lockup. I think it had to do with the small power supply and the 3 long USB extension cords, but that's another issue entirely.

This is my current version of my WeatherCam that I use to make Time Lapse Videos. I purchased a Dome Enclosure and mounted it upside down onto a pole. I found a servo at the local toy shop, and mounted the servo to the tripod screw. I am using the Raspberry Pi Camera with the IR Filter, and the servo is being powered form the Raspberry Pi directly (Not optimal, but it works). I also added a RTC to this setup so I can use this camera when it is not on the Internet, and still get accurate timestamps on the images captured. After some testing, I determined a bigger power supply was needed to power the Raspberry and the Servo unit. I am using a 5v 2.1A USB charger for the power supply. 


One of the big drives for this project, was wanting to make a Web Based interface so I could rebuild the unit I deployed for my Mom. This way, she won't have to know CLI to build Time Lapse videos. She already has a Raspberry Pi generating Time Lapse Videos automatically, but I wanted to give her more control over the process. I also have a chance of building one to Time Lapse of storms in Colorado, and I wanted to make it all easy to use. It has came a long way since I first started, but here is the interface.







Main Page showing Image Feed, updates every 60 seconds
Help page explains all sections and settings

Browse images/videos captured on system

Build a previous days images
into a Time Lapse, or process/upload todays

Upload a previously generated Time Lapse

Rotate the camera with the servo

Check System Temperature and free space

System Settings

Here is a video of the camera system automatically taking a panorama image set for post processing. The Panorama below is what I stitched together on my iPad from the images that were captured here.


9 Images captured from this system, and post processed into a Panorama on my iPad. What a view.

Monday, August 18, 2014

Raspberry Pi Install - SunFounder DS3231 RTC Real Time Clock

SunFounder DS3231 RTC Real Time Clock Module High Precision for Raspberry Pi Arduino R3 Mega 2560

SunFounders RTC Clock is cheap ($8.99) and easy to use, but the instructions are a little weird, especially of you are a beginner on Linux/Raspberry Pi/Arduino. Here are the steps I did to get this low cost RTC functional on my Raspberry Pi.






#De-Blacklist the RTC
sudo sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf

# Load the module now 
sudo modprobe i2c-bcm2708

# Notify Linux of the Dallas RTC device
sudo bash
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
exit

# Test whether Linux can see our RTC module. 
sudo hwclock

# Use to see if the RTC shows on the i2c bus
sudo i2cdetect -y -a

# Set the time on the RTC
sudo hwclock --systohc

# Update config to get time from RTC on boot
sudo nano /etc/rc.local
     # Add the following lines, before the "Exit"
     sudo modprobe i2c-bcm2708
     echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device          
     hwclock -s

# Check the RTC Vs Local Time (After a reboot)
sudo hwclock -r
date