PipeCam: Low-Cost Autonomous Underwater Camera

Low cost autonomous underwater camera for long term deployments and exploration

Similar projects worth following
This projects aims to build low-cost in situ underwater cameras for shallow deployments, from relatively off-the-shelf materials.

The goal of the this project is to prove that "It can't be that hard?"

Project constitution:
- Must be made as cheap as functionality allows
- Must be made of materials and off-shelf parts as far as possible
- Must be easily replicated.

There will be three components to this projects:
- Mechanical hardware
- Electronic components
- Software

Possible applications:
- Biodiversity studies
- Visibility indicator for recreational diving
- Long term time lapses


Functional diagram of the pipecam

x-fritzing-fzz - 7.81 kB - 03/29/2018 at 11:35


The main script that handles taking of photos

x-python - 4.11 kB - 03/29/2018 at 11:10



A Fritzing schematic of a Pi Zero + Arduino Nano combo concept for future use.

x-fritzing-fzz - 40.31 kB - 03/29/2018 at 11:36


  • 1 × Raspberry Pi Zero W
  • 1 × Raspberry Pi Camera Module V2
  • 1 × 10mm Plexiglass/Perspex lens
  • 1 × USB Hub pHat
  • 1 × ON/OFF toggle switch

View all 10 components

  • Why the project stalled

    Fred Fourie11/26/2019 at 20:29 0 comments

    I was at a very exciting point when I last worked on this project:

    1. I was getting some cool results

    2. I just took delivery of my first PCB for the project.

    3. There was a lot of interest. 

    Then life happened ... HARD. I took a new job opportunity in a different country, uprooted my life, packed, sold my car, gave up rent and had to filter through my worldly possessions for what will make it into my two bags for my massive move.  Many aspects of this project did not make it into the bags. 

    In the time it has taken for me to find my feet the project truly stalled. One big obstacle to getting started again is that I felt that the connection I had with the sea (and my neighbourhood kelp forest) has been lost. And in a big way I am still grieving that loss.

    Without this turning into too big of a therapy session- I am now itching to get back in the saddle, but the pipecam as it is in the current vision may not be enough to explore the sea as it exists in my new home. Finding parts and materials in a new country with a different language has proven hugely difficult.

    Time to rethink and reconsider my approach.

  • An update.

    Fred Fourie09/10/2018 at 05:34 0 comments

    I've been trying to do an honest update on the progress of the project. It's been slow going, but there has been LOADS of progress. 

    At the moment I'm in the trial and error phase of designing a controller board.

    What the controller board does:

    • Control
    • UI
    • Power management

    I'm about a month away from getting back into the water. Of these three aspects, the user interface has taken most of the time. 


    This has been taking most of my time. If you can avoid it. 

    How users interact with a device is a massive study on its own. I've been juggling giving the users many control options while keeping it as intuitive as possible. This has taken many iterations and hardware changes. It's hard to draw the line between what's possible and what's practical. I think I've finally struck an acceptable balance in practicality/functionality.  At the moment users can set up the device with a dial and a tiny screen for feedback. 


    The PCB design & etching process is quite rewarding, but it has been a bit of a slow slog. I've made many mistakes in the designs and I'm close to creating a 4th iteration of the board which will hopefully be the last version before I start adding some extras. The design also keeps changing as I learn more about more suitable parts.


    Power management has been a real eye-opener. There is a lot of control I need to add to reduce the overall power consumption of the project. The power banks I've been so excited about has proven to have some real limitations. This is worth a log in the future, but I've basically decided to scrap them. In short, they are too smart for their own good. 

    I've also come to the conclusion that the project is at a cross-roads. I see this splitting off into two branches. One being the quick and easy one, that folks can build on the cheap and get in the water fast (with some limitations).  Hopefully I'll finish a how-to guide for this in the next few weeks.

  • Feeding Time at the Research Aquarium: Timelapse from Video

    Fred Fourie06/04/2018 at 05:24 0 comments

    I recently got a chance to drop the project in a tank filled with West Coast rock Lobster at the local research aquarium during feeding time. The camera was set to do 15min videos overnight. 

    Here is a timelapse made from the first 15min of footage:

    Problems encountered:

    • Low light (nothing I can do about that at this stage)
    • Camera did not switch over to next flash drive after current one was full
    • Focus was set too far forward to catch all the chaos right in front of it

  • Two drops: Time-lapse vs Video

    Fred Fourie04/25/2018 at 05:50 0 comments

    While I'm still busy with the low power electronics, I'm trying to use the camera to get a feel for the capabilities and limitations... and to figure out how to make it user friendly. 

    So over the last weekend I did two ~5hour drops, both from about 10:00 to 15:00 for the best lighting.

    The first was a 30sec interval time-lapse at the entrance of a small cave. 

    • Depth: ~2.5m
    • Mode: Photo
    • Interval: 30sec
    • Exposure: 'Beach'

    About two hours into the deployment, an octopus discovers the camera, fiddles with it and points it into the cave. Which is both delightful and frustrating. The time-lapse misses most of the action. The pipecamera does not deal with low light conditions that well at this stage :\

    In case you missed it, here is the culprit:

    The rest of the photos taken are very dark, fortunately there are some interesting fish hiding in the cave, but it's too dark to do a time-lapse of these photos. I will consider rather setting the exposure to 'auto' in the future to deal with such... interferances.

    The second deployment was done from 10:30 - 15:30.

    • Depth: ~1.5m
    • Mode: Video
    • Video lenght: 15min
    • Interval: 15min
    • Exposure: Auto

    Because I missed so much action in the time-lapse the day before, I decided to just go with continuous video.

    I placed the camera under a small overhang looking out to a small rocky outcrop. The camera eventually shifts in the surge, which is the reason for the skew video later on. I will need to look into adding a bit more weight in the future.

    At first I thought the footage was pretty boring, but the problem with having 5 hours of footage is that you just skip through it, often missing some of the fun stuff that are only a few seconds long. The little outcrop actually got quite a few visitors.

    After a second round of looking at the results (on recommendation from my video journalist wife), here are some of the highlights:

    A school of fish visiting the deployment:

    A cuttlefish hunting past the frame (LOVE IT):

    Below I took a about a 10min snippet over two videos and converted it into a time-lapse. This is the kind of footage I'm interested in getting more of:

  • Risking the first overnighter

    Fred Fourie04/03/2018 at 05:24 0 comments

    Here is some results and comments on the first overnight deployment.

    Details and findings:

    • 1 minute interval time-lapse was set
    • Pipecam was rested on a small reef on the edge of a kelp forest .
      • ~2m depth
      • Resting with a 3kg weight belt
    • Cronjob set up to operate only between day light hours which is roughly 07:00 - 19:00 at the moment, which looks like this: 
      * 7-19 * * * >> output.txt
    • Was recovered with no damage or leaks
    • The pipecam ran for about 25 hours before running out of power. 
    • The timezone of the pi was not the same as the cron, leading to a 2hour discrepancy
    • About 2.7 Gb of photos was recorded, which in this case was about 660 photos
    • At least two groups of divers found the camera at the location
    • Fish are very interested for about the first hour of deployment

    And here is a video of the results:

    Some conclusions:

    • Needs better identification signage for passing divers
    • Add STATUS Led to easily see that the project is still alive
    • Check timezone and sunrise/sunset times with pi timezone
    • Project is way more power hungry than anticipated (probably the USB hub adding more power than expected)
    • Kelp forests are pretty, but they make for VERY busy time lapses and is better suited for video
    • A night time deep sleep will score another ~12 hours on the current setup

    Now for some bench tests before we put it in the water again. 

  • Hammer time...

    Fred Fourie03/26/2018 at 08:14 0 comments

    Dylan and I completed a rush V1.5 as described in the previous log. 

    The new version sports a flashy transparent housing, but is essentially still the same concept with upgraded parts. 

    The internal mounting has also been changed so that the on/off switch and recharge port is accessible by only removing the lens.

    The next phase of the project is just to hammer it: Test it as much as possible, tweak settings, refine user interaction and push the housing to see what it's actual limits in the water are.  We will construct a second camera to test this phase. One of my continuing questions is whether we need to do video or time-lapse: The short answer is "it depends"

    As an intro in this phase I dropped the pipecam into a local kelp forest for a bit to test the new video modes (Take ~15min videos very 15mins).

    A short clip from the results of this test:

    Next test is hopefully a week deployment in a marina?

  • Modifications after some tests

    Fred Fourie03/10/2018 at 18:09 0 comments

    Four main things have become clear from the first set of tests.

    1. Power will need to be increase/managed

    The sealed lead acid battery is a cheap but bulky solution. The 12V 2.4Ah battery costs about R130. I have the space to easily double up on that battery, so that gives me 12V ~4.8Ah for about R260. BUT I can get a power bank with a similar form factor at 5V with 10 Ah of capacity at a prices of ~R270 PLUS I don't need the DC regulator board. So it's a bit of a no-brainer. I'll be swapping over to a lithium ion power bank.

    I have also decided to change from the Raspberry Pi 3, to the Pi Zero W to clamp down on the overhead. This means a loss of 4xUSB slots, which I will need to recover with an external USB hub which may mean a little bit of a extra power penalty. 

    2. Storage space needs to be increased

    Good video chows space. No way around it. I need to beef up my storage capacity to match the battery endurance. Time-lapse operations are a lot easier on storage, but video needs to be of good to maximum quality to make it worth it. My preference so far is the SanDisk Cruzer Blade flash drives, because of the small size and ease with which it can be removed from the Raspberry Pi after operations. I also like that they come in way-out colours, which make them easy to ID.

    3. Housing need further tests

    A minor/slow leak was found on the housing during the second test. Luckily the internals were protected by the internal mounting which lifts the electronics off the bottom. I have my suspicions on what is causing the leak. 

    I handed over the housing over to Dylan (the mechanical wiz and partner in the project) for testing and he will be building the a new housing while I focus on some software and electronics. 

     4. The Raspberry Pi V2 module is NOT robust

    Part of the reason why I'll be looking at the electronics: Looks like I fried a V2 camera module, even after taking care to handle it as little as possible. I will need to look into having a case 3D printed. The board itself is notoriously prone to static and has a rather fiddly ribbon cable. The board sports a crypto-chip to discourage cheap clones, which I can forgive to an extent. Still- for ~R400 it is still hard to beat. It's strike one for the module. I've had to order a new module, hopefully I can refine my design so that there is even less interaction with the board and it can prove that it's still the best choice for the project.

  • Results!

    Fred Fourie02/27/2018 at 05:37 0 comments

    For the first water test I've set the camera to 2 photos per minute and deployed it for about an 1 hour in ~2m of water (at a beach close by). Where I tested the camera there are LOTS of octopus, so they made for good subjects.

    The small 2.4Ah lead acid battery can do around ~5 hours with the current configuration.

    Being impatient I moved the camera around a few times, but this turned out to be good for the tests.

    Below are some of the results:

    And here is a time lapse:

    Notes and issues:

    • Resolution: 2 photos per minute is not fine scale enough. I was hovering a couple of feet away and there was two octopus fighting over the hiding hole. Footage missed that completely.
    • Focus: I will need to determine where the best range of focus is for the camera. In this case I missed it. 
    • Light: The Raspberry Pi V2 handled they underwater lighting REALLY well. Or shall I say a lot better than what I thought.
    • Ballasting: To keep it in place, two weight belts were used. +4kgs of weight was put on.    
    • Feedback: Consider a ON light. Note LED lights will have an effect on animals. So might not be worth it. 

    Moving forward (the immediate future).

    Do another test: 

    • Test video. Test power consumption with video.
    • Find ideal range for the focus.

  • Housing V1.0: a New Hope

    Fred Fourie02/24/2018 at 17:03 0 comments

    There has been considerable progress in this project. This is mainly because I have been asking for help (who knew).  

    The new housing allows for a great seal and easy access to the electronics. The key to the progress has been the PVC union used to hold the lens and letting go of the tethered idea. 

    The pipe used is still the 110mm waste pipe, but the new heavy duty fittings has given me the confidence that this project will perform the way mechanically as I hoped.

    Summary of what has changed since the last log

    1. Now using a Pi3 instead of a Pi2
    2. Camera module is now the PiCam v2
    3. Raspberry Pi sticker on the tube- totally worth the R15
    4. Real Time Clock added to keep time for timelapse intervals
    5. Unit is now self contained and runs off a battery (making a gland brings up issues)
    6. Lens is now 10mm perspex
    7. Voltage regulator is now a proper DC-DC adjustable Voltage regulator module
    8. ON/OFF switch

    The parts (costs in South African Rands)

    • 110mm Waste pipe (ordering 1m transparent PVC 110mm pipe at a specialist plastics place costs about R300)
    • 110mm PVC Female stop end (CA1) (costs about R50)
    • 110mm PVC union (comes with an oring groove and oring) (costs about R160)
    • 10mm Perspex lens (costs about R80)
    • Raspberry Pi3
    • Raspberry Pi camera module V2
    • 12V, 2.4 Ah Rechargable sealed lead acid battery
    • Adjustable Dc-Dc voltage regulator 
    • DS1307 RTC module
    • ON/OFF switch


    I approached a friend for help. I gave him the housing and within and hour he had it rigged up and was pressure testing the housing.

    These tests revealed a few things:

    1. The housing- as is does not leak.

    2. The housing could hold 2bar of pressue

    3. The 5mm perspex lens leaked when pushed beyond 2bar

    4. A 10mm lens was cut, it held 4 bar no problem.  

    4 bar is good enough for what I need.


    From my last field test I learned that I need to pay more attention to the internal mountings of the units. 


    Here is some of the work I've done on the software side to get the project to alpha testing:

    1. Made USB drive automount
    2. Installed the I2C RTC
    3. Installed apache2 - to have a health webpage
    4. Wrote a python script that does the following:
      1. Get the date and time
      2. Takes a photo using raspistill command (picam has been producing poor photos- will investigate later)
      3. save the photo to the USB drive if it is present and name it the timestamp
      4. save the photo locally if the USB drive is NOT present
      5. check the available space on the disks
      6. count the number of files
      7. write health status to a json file
    5. Add script to crontab

    Here are two photos to compare a raspistill and python-picam photo:

     Default photo taken from python-picam:

     Photo taken using the raspistill command (exposure mode set to 'beach')

    Moving forward

    It's already obvious that there is a need for more power and better power management. A slightly longer housing will suit more batteries better.

    Internal mountings should NOT be overlooked as easy. I will consider a small distribution board to tidy up the wiring and mount the RTC in a sensible way. The current internal cradle is made from hardboard, but a plastic or perspex one would be nice.

    For power management I would include a Arduino via I2C to the raspberry pi to give current and voltage reading from the battery. The Arduino could then control the interval of switching the Raspi ON/OFF. The Arduino can also sport an LDR to only switch pi if the light levels are sufficient. 

    On the software I would make a simple web page displaying the following diagnostics:

    • Power levels
    • Disk usuage
    • Latest photo

    Software also need to be able to handle low power states and full disk events

    Current Testing

    The pipecam is ready for a set of Alpha tests. I had to stop myself from throwing...

    Read more »

  • Block Diagram

    Fred Fourie07/21/2017 at 18:53 0 comments

View all 13 project logs

  • 1
    Build your own TPL5111 PIPECAM!


    The Pipecamera project has grown into something a bit bigger than what I originally envisioned (Hi-ho scope creep). To accommodate the project growth and the original project constitution I've decided to split the project into two lanes: 

    1. a ready to use Pipecam product with a user interface, field ready and no assembly required, built for long term use.
    2.  a DIY Pipecam, built for rapid, cheap deployment, assembled by the users themselves.

    This post will be discussing the core principals and operations of the DIY TPL5111 Pipecam. I'm not able to do a detailed step-by-step guide at this stage, so this post will aim to give you all the information you require to figure it out yourself. I hope that this will give someone enough information to get them going.  

    I have discussed the housing in the logs before, so this will only deal with the ELECTRONICS and SOFTWARE. 



    Parts and what they do: 

    Raspberry Pi Zero W (Any Raspberry Pi will do the job)

    - The main camera controller

    Raspberry Pi Camera Module

    - The actual camera

    Adafruit TPL5111

    - The timer circuit

    - Flips a switch ON every X seconds, where X is determined by the resistance set by the onboard pot.

    - X is limited from 1s to 2hours

    - Recommend that you set it to 47kΩ for ~6min (56kΩ for ~10min) interval. See here.

    Adafruit PowerBoost 500

    - The 5V power circuit

    - Handles battery charging

    A battery

    - The power source

    Putting it together:



    For this, I'm skipping the pi OS install process. I recommend you use RASPBIAN STRETCH LITE and create a default user.

    The pi setup:

    After the OS setup has been completed, install and set up the camera. Find a pretty good guide here:

    Once that has been done get the operating script here:

    Put the script in your directory of choice. Default is: 


     Then, add the script to your rc.local. This will run the script on start-up. (ref: To do this run the following command:

    nano /etc/rc.local

    Then add the following code before the "exit 0" line:

    string=$(vcgencmd get_camera)
    if test "${string#*$substring}" != "$string"
        python /home/pi/    # Camera connected start capture
        echo  -e "\e[31mCamera not found!\e[0m"    # Camera not connected.

    The code above first checks that the raspi camera is present before running the script.

    The main operating script will still needs some tweaks and should be considered as under development. The script can be found here:

    The script runs a command to take a photo and then shuts down** immediately.

    ** Note that this is NOT a 'safe' shutdown. 

    Python modules used:

    • os
    • gmtime 
    • strftime
    • RPi.GPIO 

    This script should be set to run on boot via the rc.local (or which ever method works best for your application)



    1. Once powered ON (battery is connected) the TPL5111 will read the resistance over the pot, which will determine the timer interval.
    2. The TPL5111 waits for the timer to fire
    3. Once the timer fires, the TPL5111 switches the VDD to ENABLE, which causes a 5V output. 
    4. The Pi will receive power and boot up. This takes about 30sec if you've tweaked the boot, otherwise, allow 1-2minutes
    5. A script will run on the pi to take a photo
    6. Once the photo has been taken, the pi flips BCM 17 to HIGH, to let the TPL5111 to go back to sleep. 
    7. Repeat from step 2

View all instructions

Enjoy this project?



Alex Vila wrote 03/13/2020 at 17:20 point

Do you have links to the screw-on end cap. I'm having trouble locating this part. Thank you. 

  Are you sure? yes | no

Fred Fourie wrote 04/24/2020 at 06:10 point

Here is a link for one

Usually they are called 110mm 3 piece PVC union or something along that line

  Are you sure? yes | no

bhaizlett123 wrote 08/05/2019 at 16:24 point

This is one of the coolest projects i;ve seen, i would love to build something like this for deep water, like dropping this down 600 to 900 feet deep, but not sure what kind of enclosure i would need for something like this, as well as what kind of light to put on it, since its pitch black down there, any suggestions?

  Are you sure? yes | no

Fred Fourie wrote 02/17/2020 at 07:20 point

I've not done enough pressure tests with my enclosures. We've dipped it too 100m (~328ft), but it was not a sustained test. Hoping to do some tests with my housing to see what the limits really are. You should probably look into Delrin/POM as a material for an enclosure like that.  You would for sure need a light those depths (It's on my list to build one too).

  Are you sure? yes | no

ahmetyasin98 wrote 06/24/2019 at 16:52 point

Hello, is your camera NOIR, if not, why? Wouldnt it be better for underwater projects where light is low.

  Are you sure? yes | no

Fred Fourie wrote 02/17/2020 at 07:22 point

I have not tested this. IR will get absorbed really quickly in water, so I'm not sure what the use of that would be

  Are you sure? yes | no

Steve R wrote 04/13/2018 at 19:42 point

Awesome project!   Been looking everywhere for something like this.  

Had an idea... have you considered pressurizing the pipe to a few PSI over operating depth?  Maybe something like a needle valve on the bottom that you could attach a tire compressor to.  Not sure if it would have a negative impact on the components.  Benefit would be detecting leaks before deployment, and preventing water ingres if a small leak does occur.  Might make it a little less buoyant, though I think the difference would be miniscule.

  Are you sure? yes | no

Fred Fourie wrote 04/15/2018 at 14:51 point

Hi Steve! Thanks! What would you use something like this for?

At the moment we pressure test each new housing with a modified lens that has a one-way valve that we hook up to a tire compressor. This means we can safely test up to 4bar. The test if considered a success if the housing maintains pressure. 

In a perfect world I would add a BME280 to log the internal pressure over time and temperature, but at I am avoiding the additional expense.  

  Are you sure? yes | no

Giacomo wrote 03/14/2018 at 11:46 point

This is really interesting, especially your progression in battery power and switching to Pi W.  Do you think the Pi W is powerful enough to make the video you need, or will you strip down a Pi 3b+ of the components you don't need (saving power and space)?

  Are you sure? yes | no

Fred Fourie wrote 03/16/2018 at 05:48 point

Pi Zero should be fine to record video. My only concern at this stage is that a Pi Zero + USB Hub = Pi3 with regards to energy consumption. 

  Are you sure? yes | no

danel.turk wrote 03/13/2018 at 08:38 point


Have you tried to add also motion control to it. To idle on time when nothing happens ?


  Are you sure? yes | no

Fred Fourie wrote 03/29/2018 at 12:17 point

Hi there. Motion control is not really suitable for a constantly moving environment such as a shallow seafloor: everything moves.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates