Low cost autonomous underwater camera for long term deployments and exploration
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
pipecam_v1.fzzFunctional diagram of the pipecamx-fritzing-fzz - 7.81 kB - 03/29/2018 at 11:35 |
|
|
takePhoto.pyThe main script that handles taking of photosx-python - 4.11 kB - 03/29/2018 at 11:10 |
|
|
pipecam_v2.fzzA 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 |
|
Although work on the controller PCBs have stalled, I have been fortunate enough to use the exact hardware in 2 other projects:
1. A remote logger for an oceanographic instrument in Greenland: measure, transmit data, sleep
2. An long term underwater scanning sonar: do a sonar scan of the seafloor, sleep.
The second has been my avenue to produce my first paper and submission to the HardwareX journal, a small bucket list checkbox to tick. Instead of a photo timelapse I was able to generate a timelapse of seafloor changes for 30m over 3 months.
I have been eager to continue with this project again, with a new, improved controller PCB, but as years have passed since I have started the project I decided to check the market. And damn. I found a product that makes my efforts near unnecessary:
The Witty Pi 4 (L3V7)
https://www.uugear.com/product/witty-pi-4-l3v7/
Finding this thing made me swear a lot. I immediately bought one to check out and damn, it really is a near drop in replacement for my controller. UUGear has created an extremely capable companion board for a pi Zero, with some really useful and sensible software too.
If anyone ever in the future looks at this project and wants to build something similar, look no further for handling your Pi sleep cycle. Forget all the ploys I have mentioned before- even the TPL5111.
There are of course minor compromises, but really, everything you need to make a sleeping pi is here. My board of choice, the Witty Pi 4 L3V7 comes at a cost of about 24 EUR.
Alternative to the Pi
After the availability issues of the last 2 years Raspberry Pi has widely announced that they are “back”.
Unfortunately, for this project the Pi Zero W (and the new successor the Pi Zero 2 W) has returned to the market with a considerable price increase.
The base Pi Zero W now is anywhere between 17-25 euros with camera modules skyrocketing from 20 euros up.
Although the ~60 euro that you will spend on getting a decent base up and running is still relatively low cost, I started looking for alternatives.
Pi is still SBC King
When it comes to finding a single board computer competitor for the Pi: There simply isn’t one that can compete with their price point. (and community support)
https://www.makeuseof.com/what-is-the-cheapest-single-board-computer/
Although I very much appreciate the higher power and industrial new generation Pies, the niche that the Pi Zero filled had seems to have fallen by the wayside.
So if not a SBC, what then?
ESP32 Cameras
The ESP32 has been my go-to microcontroller for a while. It’s low cost and extremely versatile. There have been loads of comparisons done between it and the “new” Raspberry Pi Pico but the native wifi/BLE of the ESP32 is a massive advantage.
https://www.makeuseof.com/raspberry-pi-pico-vs-esp32-microcontroller/
In recent years several dedicated ESP32 camera boards have popped up on the market
https://makeradvisor.com/esp32-camera-cam-boards-review-comparison/
at prices from 9-20 euros (camera included) so I decided to invest some energy into investigating this as an alternative.
Criteria I have decided to study are:
AI Thinker ESP32-CAM
The first board that caught my eye was the AI Thinker ESP32-CAM and will be the board I will be reviewing in detail.
https://randomnerdtutorials.com/esp32-cam-ai-thinker-pinout/
https://docs.ai-thinker.com/esp32-cam
Right off the bat this looks great.
Small module, SD Card, 2MP camera and LED “flash”. These are peripherals that I would need for this project.
So let's review this against our criteria:
1. Image quality
The 2 megapixel OV2640 camera is probably not going to be good enough for the underwater environments, but doing some research has shown that the board is actually compatible with several other camera modules, including the 5MP OV5640, which might be good enough.
Previous tests with the Pi Cameras has shown that the difference between the 8MP and 12MP cameras are not that big and that the 8MP is good enough. Perhaps the 5MP will still suffice.
The board also matches the 5MP module pin to pin and using the OV5640 as a drop-in replacement seems to work well.
Below is the standard OV2640 (~60 KB file size):
Here is the OV5640, with a fisheye lens from the same distance (~408 KB):
As you can see it is a massive difference. Certainly the OV5 + fisheye lens is a great combo for landscape or security applications. It is for sure worth looking into alternative higher quality camera modules for compatibility. Below is my quick comparison of alternatives.
Comparing other camera module boards for compatibility:
Manufacturer | ESP32CAM | WaveShare | M5 Timer FLIP | M5 Timer |
Cam module | OV2640 | OV5640 | OV3660 | OV3660 |
MegaPixels | 2 | 5 | 3 | 3 |
ESP32 incl | yes | no | yes | yes |
USB incl | no | no | yes | yes |
SD Card incl | yes | no | no | no |
Price (EUR) | 11 | 18.17 | 20.5 | 20.5 |
Pin | ||||
1 | 2.8V | GND | ||
2 | GND | 3V3 | GND | |
3 | CSI_D2 | Y4 | SIO_DAT | |
4 | CSI_D1 | Y3 | 2V8 | |
5 | CSI_D3 | Y5 | SIO_CLK | |
6 | CSI_D0 | Y2 | RESET | |
7 | CSI_D4 | Y6 | VSYNC | |
8 | CSI_PCLK | PCLK | PCLK | PWDN |
9 | CSI_D5 | Y7 | HREF | |
10 | GND | GND | GND | 1V2 |
11 | CSI_D6 | Y8 | 3V3 | |
12 | CSI_MCLK | XCLK | XCLK | Y9 |
13 | CSI_D7 | Y9 | XCLK | |
14 | 3V3 | 3V3 | 3V3 | Y8 |
15 | CSI_1.2V | 1.5V | 1V2 | GND |
16 | CSI_HSYNC | HREF | HREF | Y7 |
17 | 1k | PWDN - GND | PWDN | PCLK |
18 | CSI_VSYNC | VSYNC | VSYNC | Y6 |
19 | CAM_RST | RESET | RESET | Y2 |
20 | TWI_SCK | SIO CLK | SIO_CLK | Y5 |
21 | CSI_2.8V | 2.8V | 2V8 | Y3 |
22 | TWI_SDA | SIO DAT | SIO_DAT | Y4 |
23 | GND | GND | GND | 3V3 |
24 | GND |
2. Sleep power draw
The ESP32 typically has great low power capabilities and are super easy to put to sleep. For this project I aim...
Read more »State of the project:
Ditching of the micro-controller:
This is by far the biggest change to the project. The old versions of all relied on an external micro-controller (the Arduino ProMini clone) reading an SD Card to determine the sleep intervals.
This meant that, once deployed, there was no way to change this apart from opening up the housing and getting to the SD Card. This was proven a problem in when working in the field.
Further more, a way to use the RTC alone on to do the power switching of the pi was devised. Removing the micro-controller would remove the need for an external SD Card (discussed next), reduce the power and reduce the complexity of the project. Ironically, shortly after this design choice was made, I found that the Robodyn Promini boards which I had used for my previous boards has been formally discontinued.
Removal of the SD card:
Not all SD Cards are created equal. Between brands and individual units, SD Cards differ. This is became very apparent when I started measuring the low-power sleep modes in the previous iterations. Different SD Cards would push the power consumption from a couple of uA to as much as 1mA in some bad cases. While troubleshooting this, I came across this from another inspirational hackaday project:
https://thecavepearlproject.org/2014/09/22/high-sleep-current-problem-solved/
With all of these troubles in mind, I decided to ditch the SD Card.
The Great Silicon Shortage:
It has been incredible to see that usually, easy-to-find components are just globally out of stock. This has pushed the need to redesign the board with less component and towards designing for interchangeable footprints.
DON'T RUSH IT
Over the last hear I had the opportunity to deploy at sea. I quickly made a new housing and introduced a number of "new" components to the housing. This catastrophically failed within minutes of deployment. Mechanical stuff is not my strong point. So next time I should take my time, test the housing.
Alternatives:
If you have landed on this because you are itching to build your own project, similar to this. I have some good news for you. There are off-the-shelf components that will help you get rolling MUCH faster than waiting for this project. The best example I have found so far is the Witty Pi:
https://www.uugear.com/product/witty-pi-3-realtime-clock-and-power-management-for-raspberry-pi/
The near future:
The new DORY PCB is currently undergoing testing, so far all the peripherals are performing as expected and the PCB design seems sound.
The next step will be a redesign of the internals: a battery pack and a set of mountings for the PCB and camera.
And the hopefully! Back into the water she goes!
Because the current version of the project has no light source, colour correction may be useful in deeper deployments. A simple method for colour corrections was applied that yielded good results.
Scripts obtained from http://www.fmwconcepts.com/imagemagick/uwcorrect/index.php was tested, and the following command gave the best results for this case:
./uwcorrect -m 2 -b 5 -s 10 target.jpg corrected.jp
Then this command was used to write a small batch processing script in BASH:
for f in ./photo/*.jpg
do f2=${f%.*}_processed.jpg;
echo "Processing $f as $f2...";
./uwcorrect -m 2 -b -10 -s 10 $f $f2
done
The results:
Recently, I deployed two cameras in the local docks in very shallow (~50cm) water with a 4 hour day/night interval. The camera were not placed and ballasted well so they did move around too much to allow for a decent time-lapse.
Here are some of my favourite results from that deployment.
The photo above is with the Raspberry Pi HQ camera through a polycarbonate "lens". The discolouration seen at the bottom was an experimental LED. The LED did not yield conclusive results in this test.
The photo above is the same scene (roughly) after three weeks in the water. The algae growth on the lens is pretty dramatic.
The next set of photos are with the raspberry pi v2.1 camera and a different experimental lens and LED:
These show that the 8MP V2.1 camera still produces very good results (although the polluted harbour is very clear) and puts into question the use of the HQ camera at three times the price. Because of better positioning, these images produced by this camera were far more interesting.
Here are some of my favourite animal sightings in the results:
Yet unidentified juvenile fish
Shrimp:
Swarming Mysid shrimp
A little crab:
The results of this deployment has made me confident that all the current hardware performs as it should. The endurance is also very much with the spec of the project.
I believe that this specific version of the project is about one iteration away from being ready to be Beta tested.
More to come in the future.
After some more tweaks I recently deployed the camera in the harbour and left it for 4 days. I removed all the images too dark to immediately see and applied some colour correction. (log about colours coming soon).
Deployment:
Processing:
A uneventful time-lapse of some mussels on the pillar of a pier.
Clearly visible mussel excretion. Night time edited out.
Interval: 2 min
Duration: 3 days
Depth: 30 cm
Number of frames: 380
We're back in the water for a new set of tests (finally)!
In the image above there are a few things to note, one: the nasty reflection caused by the transparent tube and internal mountings, BUT there is also critter, a small swimming crab passing the camera.
Another shot of a different angle, reflection visible, but a great showcase of the new HQ camera lens set to focus closer.
Here is a quick update on where I am at:
There are quite a few design choices to justify, which I will briefly go over here.
I hope to add some more logs and explanations in the coming weeks as I do more tests....
Read more »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.
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:
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.
UI
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.
Control
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
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.
INTRO
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:
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.
******************************************************************************
ELECTRONICS
Parts and what they do:
Raspberry Pi Zero W (Any Raspberry Pi will do the job)
- The main camera controller
- The actual camera
https://www.adafruit.com/product/3573
- 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.
- The 5V power circuit
- Handles battery charging
- The power source
Putting it together:
******************************************************************************
SOFTWARE
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:
https://www.makeuseof.com/tag/set-up-raspberry-pi-camera-module/
Once that has been done get the operating script here:
https://github.com/FredFury/pipecam/blob/master/TPL5111_pipecam.py
Put the script in your directory of choice. Default is:
/home/pi/
Then, add the script to your rc.local. This will run the script on start-up. (ref: https://www.raspberrypi.org/forums/viewtopic.php?t=46113) 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)
substring="detected=1"
if test "${string#*$substring}" != "$string"
then
python /home/pi/TPL5111_pipecam.py # Camera connected start capture
else
echo -e "\e[31mCamera not found!\e[0m" # Camera not connected.
fi
The code above first checks that the raspi camera is present before running the script.
TPL5111_pipecam.py
The main operating script will still needs some tweaks and should be considered as under development. The script can be found here:
https://github.com/FredFury/pipecam/blob/master/TPL5111_pipecam.py
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:
This script should be set to run on boot via the rc.local (or which ever method works best for your application)
******************************************************************************
Workflow:
Create an account to leave a comment. Already have an account? Log In.
Do you have links to the screw-on end cap. I'm having trouble locating this part. Thank you.
Here is a link for one
https://www.pvc24.nl/shop/3-d-koppeling-110mm-2/
Usually they are called 110mm 3 piece PVC union or something along that line
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?
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).
Hello, is your camera NOIR, if not, why? Wouldnt it be better for underwater projects where light is low.
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
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.
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.
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)?
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.
Hey
Have you tried to add also motion control to it. To idle on time when nothing happens ?
d
Hi there. Motion control is not really suitable for a constantly moving environment such as a shallow seafloor: everything moves.
Become a member to follow this project and never miss any updates
Hey the github repository doesnt seem to exist anymore, any update on that?
cheers