-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the raspberry-pi-camcorder wiki!
GitHub Page
This Raspberry Pi dedicated device was developed for the University of California, Riverside Entomology Department in order to successfully capture footage of insect eggs in remote urban and agriculture environments to look for natural predators of the Brown Marmorated Stink Bug. This program has four (4) modules intended for use: a camcorder to continuously record hour-long .h264 video clips (day/night) and a time-lapse camera to continuously capture still .jpg images in 10 second-long intervals (day/night).
This wiki assumes the user is capable of accessing the Raspberry Pi environment and is intended for documentation of hardware and software components, or for use by anyone who wants to build their own Raspberry Pi camcorder system.
This system is intended to be used as a plug-and-play dedicated device. Once turned on, the Pi will start recording and save videos/images to an external USB NTFS hard drive or to /media/usbhdd
if the hard drive is unavailable.
The day and night modes are configured to work in harmony with each other. Each program checks sunrise_sunset_tables.csv
(a log of sunrise and sunset times from the year 2013) and turns its camera on/off accordingly. The day programs turn their camera on a half hour before sunrise and turn it off a half hour after sunset; the night programs turn their camera on a half hour before sunset and turn it off a half hour after sunrise.
If the Pi is configured to record/capture images at night, an infrared LED and a 220 Ohm 1% Resistor must be connected in series from GPIO 17 (pin #11) to ground.
- Raspberry Pi w/ Raspbian & power supply
- PiCamera(day)/NOIR PiCamera w/infrared LED & 220 Ohm 1% Resistor (night)
- RTC Clock Module by Abel Electronics
- An external USB hard drive (formatted as NTFS)
The system uses the /etc/rc.local
boot script to check for internet connection, load/set the RTC module (depending if there is an internet connection), and start the appropriate camera program.
To change which camera program for the Pi to run, first remove the USB drive and camera and log on to the Pi (locally or through SSH). Open up the /etc/rc.local
boot script (we will be using the Nano text editor because it comes installed on Raspbian:
sudo nano /etc/rc.local
At the end of the script, right above the line that says exit 0
, there should be four lines: three that have a #
sign in front, and one that doesn't, e.g.:
python /home/pi/raspberry-pi-camcorder/time-lapse-day.py &
#python /home/pi/raspberry-pi-camcorder/time-lapse-night.py &
#python /home/pi/raspberry-pi-camcorder/camcorder-day.py &
#python /home/pi/raspberry-pi-camcorder/camcorder-night.py &
Note: if you are building this system from scratch, you probably only have your desired program listed. For more information, please see the Build from scratch section.
The above is an example from the system that's configured for to run the time-lapse-day
program. To change which program for the system to run at boot, simply move the #
from the program you want to run to the program to which it has been previously configured for. For example, to configure our ongoing example to record hour-long clips during the day:
#python /home/pi/raspberry-pi-camcorder/time-lapse-day.py &
#python /home/pi/raspberry-pi-camcorder/time-lapse-night.py &
python /home/pi/raspberry-pi-camcorder/camcorder-day.py &
#python /home/pi/raspberry-pi-camcorder/camcorder-night.py &
Close, save, and exit the editor by pressing CTRL+X
, y
, then Enter
. Shut down the Pi and it should run your desired camera program next time it turns on.
sudo shutdown now
Note: please wait a moment before unplugging the Pi after executing the above command to ensure a proper shut down.
TBA....