Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Snail Habitat with photo capture

Snail habitat with a Raspberry Pi computer + camera attached to it for capturing a history of photos. The photos post to AWS and display on a web page. Full source code is at


This was project done in a classroom with 22 students. We broke the kids out into groups and created 5 snail habitats. It would be a great project to do school wide too, where you create 1 snail habitat per class. This would allow the entire school to get involved and monitor each others habitats.

You can follow the project and live habitats at I would love to see others habitats, so if you create one, please share it and I would be happy to publish it on

Supplies Used

Following is a list of supplies we used for the habitats

Raspberry Pi Image

The OS installed is Raspian After Raspian is installed on it, create an "images" folder and a "code" folder on the desktop and make the images folder writeable. Save the file into the code folder and make it executable.

You will also need to install s3cmd on the Raspberry Pi. To do this, open up the command prompt tool and type sudo apt-get install s3cmd and follow the prompts. It will prompt you to enter in your AWS S3 settings so make sure you have AWS S3 setup before running this. You can view a list if s3cmd commands from

Python Code

The python code installed on the Raspberry Pi for taking photos and uploading to AWS is at Make sure this script is located in the code folder you created on your desktop. You also need to make this file executable so it can be run from your CRON.

AWS Setup

You will need to setup an S3 bucket on AWS and sub-folders within that bucket for each snail habitat you want to capture photos for. Each sub-folder needs to be viewable for public so the photos can be accessible.


To create a scheduled CRON that will run your script every hour go into the command prompt tool and run crontab -e. Scroll to the bottom and add the following to have your script run every hour during daylight times (8am to 6pm).

0 8-18 * * * python /home/pi/Desktop/code/

If you want it to run at night, you will need to get a flash for the Pi camera, which we do not have for this project.

Web Pages

To keep things simple, we set this up using Bootstrap for design and coded in PHP 7 for connecting to the AWS API for pulling in the S3 images. You will need to install composer on your server and install the dependencies using composer. The composer.lock file is included making it easier for you to install the dependencies. Feel free to contact me if you have trouble installing composer or the dependencies.

Edit the config.php file with your AWS settings. To change group names or add more groups, edit the s3-photos.php file

Future To Do's

  • Install a flash on the Pi camera so we can capture photos at night
  • Change CRON to run every 5 minutes in order to capture more photos for a timelapse video


  • If the front of the tubs are not clean, photos will not be as clear. You may need to wipe this down periodically.
  • I suggest taping your PI & tub down after you get the camera in the right position. Any little nudge can offset the photo positioning.
  • Light coming into the room during different times of the day can affect the photos. Glare, shadows, etc. I suggest finding a spot that has good, consistent light throughout the day.


Snail habitat with a Raspberry Pi computer + camera attached to it for capturing a history of photos.







No releases published


No packages published