Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Mitch K
Published © CC BY-NC-SA

Timelapse Camera Station

Ever wanted to do time-lapse video but don't want to buy a expensive camera or use your iPhone? Raspberry Pi to save the day!

IntermediateFull instructions provided8 hours1,441
Timelapse Camera Station

Things used in this project

Hardware components

Raspberry Pi 3 Model B
Raspberry Pi 3 Model B
×1
Camera Module V2
Raspberry Pi Camera Module V2
×1
Camera Tripod
×1
Texas Instruments 74AHCT125
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
NeoPixel Ring: WS2812 5050 RGB LED
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
×1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
only needed to print mount... can be achieved easily without a 3d printed part

Story

Read more

Custom parts and enclosures

small camera mount for the RPi v2 raspicam

Schematics

schematic

using the 74AHCT125 logic level shifter

Code

flashScript.py

Python
The flash python3 script that is called before taking a picture to turn on the flash.
import sys
from time import sleep
import board
import neopixel
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)

pixel_pin = board.D18
num_pixels = 30
ORDER = neopixel.GRB

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=1.0, auto_write=True, pixel_order=ORDER)

while True:
    if GPIO.input(23):
        sleep(0.1)
    else:
        with open("/home/pi/timelapse/status.txt", 'r') as f:
            state = int(f.read())

        if state:
            pixels.fill((0,0,0))
        else:
            pixels.fill((255,255,160)) 

    sys.exit()

capture.sh

Plain text
The shell script to take the pic and run the python3 flash script
#!/bin/bash -e

python3 /home/pi/timelapse/flashScript.py
echo "1" > /home/pi/timelapse/status.txt

DATE=$(date +"%b%d%C%g_%H%M%S")

raspistill -n -md 3 -ISO 100 -mm average -drc high -ex auto -br 50 -awb auto -q 85 -sa 25 -ifx none -vf -o /home/pi/timelapse/fastLapse/$DATE.jpg


python3 /home/pi/timelapse/flashScript.py
echo "0" > /home/pi/timelapse/status.txt

exit 0

Credits

Mitch K
10 projects • 34 followers
Maker, designer, & all around fun to be around!
Thanks to Adafruit.

Comments