---
title: "Raspberry Pi time lapse camera"
date: "2022-01-27"
---


Using the Raspberry Pi's [High Quality Camera module](https://www.raspberrypi.com/products/raspberry-pi-high-quality-camera/) I made a time lapse camera in my living room.

<iframe width="600" height="337" src="https://www.youtube.com/embed/yXHe2t_M820" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

![Assembled camera sitting in my living room window](pi3.jpg)

# Case

I designed a case with a large lens hood and a recessed lens so that it can block the light from the room.
This would allow the camera to take photos at night.

![CAD screenshots of the case design](picam.png)

![Assembled camera](pi2.jpg)

![Camera chassis with HQ module on one side and the Raspberry Pi on the other](pi1.jpg)

![Camera chassis reverse side showing the Raspberry Pi](pi0.jpg)

## STL files

The files are also available on [Thingiverse](https://www.thingiverse.com/thing:4684807).

:: pichassis.stl pichassis.stl

:: pihood.stl pihood.stl

:: piback.stl piback.stl

# Capture code

I decided to strive for maximum image quality even at night, by capturing a stack of images and summing them up.

:: GitHub Gist https://gist.github.com/dllu/50cce626974859037d03d3221bd2e90c

# Lens

I found a Basler C125-0618-5M-P on eBay which seems to have good image quality and fits the Raspberry Pi HQ Camera.

![Picture of lens](basler.jpg)

![The lens has significant barrel distortion but that is compensated for by my code above.](distortion.png)

![The lens is quite sharp and can resolve even 200 lp/mm. This chart is at f/1.8, polychromatic, 0.5 m working distance.](resolution.png)

# Gallery

![Picture taken by Raspberry Pi camera](IMG_5450.JPG)

![Picture taken by Raspberry Pi camera](IMG_6776.JPG)

![Picture taken by Raspberry Pi camera](IMG_7139.JPG)

![Picture taken by Raspberry Pi camera](IMG_7171.JPG)

![Picture taken by Raspberry Pi camera](IMG_7324.JPG)

![Picture taken by Raspberry Pi camera](IMG_7564.JPG)

![Picture taken by Raspberry Pi camera](IMG_8418.JPG)

![Picture taken by Raspberry Pi camera](IMG_8419.JPG)

![Picture taken by Raspberry Pi camera](IMG_8632.JPG)

![Picture taken by Raspberry Pi camera](IMG_8667.JPG)

![Picture taken by Raspberry Pi camera](IMG_8668.JPG)

![Picture taken by Raspberry Pi camera](IMG_8669.JPG)
