I would like to build an underwater mammal detector to take videos of seals when they get in and out of their cave (the entrance of their cave is underwater).

It will be a waterproof sealed box with a camera in it, fixed on the rocks (underwater, in front of a cave), which will record video whenever a seal is swimming in front of it, probably connected to a solar panel placed on the ground (on the shore, not underwater). The device should be autonomous for about a week.

I can think of a few solutions:

  • Just use a regular smartphone with a waterproof case (connected to a solar panel), with an app which process the video and record it when something is moving,
  • Same thing with a Raspberry PI and a webcam (infrared?),
  • Use a Raspberry PI, a webcam and PIR sensor to trigger the video recording,
  • Same thing with a laser trigger (probably not the best solution)

I would emphasize on simplicity and robustness. So I have a few questions:

  • What solar panel would I need to power an iPhone processing/recording video non-stop (it will be in Greece with good sunlight conditions) (which power/specs, not which brand/model)? How will the battery evolve? Will a Raspberry PI consume less power?
  • Would a PIR sensor work underwater? Which one should I get (which specs)? How will it react to ambient light changes (day/night)?

The smartphone solution is attractive because of its simplicity, the PIR sensor solution might be better because it will consume less power.

Edit: Seals are mammals, they have warm blood (37°C), but it does not mean their skin is warmed than water. "Seals keep their skin at just 34°F (1°C) when lying on ice" Mammal Anatomy: An Illustrated Guide.

I don't know if they would be detected by PIR sensor + infrared is quickly absorbed by water.

  • \$\begingroup\$ Where are you planning to place the solar panel? In your sealed box or floating on the surface with a cable going down to the box? \$\endgroup\$ Mar 5, 2016 at 12:10
  • \$\begingroup\$ I suggest that both a solar panel and PIR sensor will operate very differently under water as opposed on land in the atmosphere. That is if either of them function in a suitable way at all. \$\endgroup\$ Mar 5, 2016 at 12:12
  • \$\begingroup\$ The solar panel will be placed on the shore, not underwater (I edited my question, thanks!) \$\endgroup\$
    – arthur.sw
    Mar 5, 2016 at 12:16
  • \$\begingroup\$ In my answer, I've ignored your request for recommendations for solar panels and other things. That type of question is off topic, and can get your question closed. I suggest you remove them as you already have one close vote. \$\endgroup\$
    – JRE
    Mar 5, 2016 at 13:06
  • \$\begingroup\$ Actually, this question's way too broad too & will likely be closed for that (why I placed the 2nd close vote) - besides that, I'd suggest an undewater ultrasonic rangefinder (i.e. "fishfinder") placed @ the entrance to the cave. When the distance reading changes from "cave width" to "less than cave width" something entered or exited the cave ;) \$\endgroup\$ Mar 5, 2016 at 15:09

2 Answers 2


I would suggest you use Motion on a RaspberryPi with a USB webcam.

The Pi is up there in a waterproof box by the solar panel.
Put the webcam in a watertight box down below watching the seals.

I would go this way for several reasons:

  1. The camera is the cheapest part of the system. If the waterproofing fails then all you've lost is the camera. A short won't kill anything, and you could put a sacrificial USB hub between the Pi and the camera just in case.
  2. Motion does its job very well - it detects motion from the camera pictures and decides when to record. It also has a buffer so that you can tell it to record the last X seconds before the detection and then continue recording afterwards until there is no motion for some other length of time - that way, you don't lose any part of the scene you wanted to capture. Motion is highly configurable.
  3. Many (if not all) webcams are actually IR sensitive and have an IR filter that can be removed. This will get you an IR camera for cheap that will record the seals even at night.
  4. You can use a really cheap, low resolution webcam to start, and upgrade cheaply to a camera with better resolution once you've tested the system.
  5. If you need a longer connection, you can replace the webcam with an IP camera with power over ethernet.
  6. The Pi and webcam solution will be fairly low power. The Pi operates on 5Volts at maximum 1A, so 5Watts worst case. The camera consumption is counted in that since it is powered from the Pi, and the Pi power supplies usually only provide 1A.

I have used Motion with a webcam in a rain shield to make videos of birds around our bird feeders. I used an old laptop and let it run 24/7 to record everything. Motion can also control the brightness and other things automatically - it managed to catch a flyby from a bat one night because it had cranked up the brightness automatically in the dark.

Given the way most webcams are built, I suspect the easiest way to get a good image is to drill a hole in your waterproof box and put the lens of the camera in from outside the box and waterproof that. Then you screw the naked webcam board onto the lens from inside the box. This gets the lens outside in the water and the electronics inside nice and dry.

You will have to play with the focus - water has a different index of refraction than air, so the focus will act differently. If you install it as I suggested, then you will focus by rotating the camera board inside the box rather than rotating the lens.

Focus is also different between visible light and IR. If you find that IR is useful but also want to take normal light videos, you may want to use two webcams - one modified for IR, and one with the IR filter still in it.

USB has some length restrictions, but I have used USB extensions of upto 4 meters. Try to get a single long cable rather than connecting several in series. Each junction causes problems (signal loss,) and must also be waterproofed.

Given that you want this to run for up to a week, I would suggest adding some mass storage to the Pi. A large USB flash drive or a small USB harddisk would be needed. Recording large amounts of data on the Pi's SD card would kill it in relatively short order.

Some informative links:

  1. Motion on a Pi
  2. Webcam IR conversion
  • \$\begingroup\$ Thanks for all those interesting details! I didn't know about Motion, I thought I might need to make everything myself with OpenCV. \$\endgroup\$
    – arthur.sw
    Mar 6, 2016 at 21:57
  • \$\begingroup\$ +1 Good answer .............................. <- > 15-14) = 1 dot \$\endgroup\$
    – Russell McMahon
    Apr 8, 2016 at 15:21

To answer the sensing problem:

PIR won't work as it relies on rapid changes in received IR emitted from the surface passing objects. The IR energy depends on the emissivity of the material to some extent but primarily on the surface temperature. The seals' skin temperature will be water temperature as will everything else in the background so I don't expect that there would be any detectable change in IR levels. (Someone may correct me on this.)

enter image description here

Figure 1. Liquid water absorption spectrum across a wide wavelength range. Source: Wikipedia.

The Figure 1 graph shows the absorption of light per metre of water. We can see that absorbtion is lowest in the blue region (giving the characteristic underwater "blue" look). If you want your trigger sensor beam to be invisible on the video you would select a transmitter / sensor in the near IR range. I suspect a reflector type would be the most reliable if you can place a reflector for the beam where it won't be obvious in the video.

Your video recorder will need a pre-trigger feature to record all action from, say, 10 s before the trigger is received. On pro-cameras with this feature the camera is continuously buffering and when the trigger is received the contents of the buffer are recorded along with all subsequent action for a time.

Have a look for industrial retro-reflective sensors to get some idea of what's available. See ifm for example.

A much simpler option may be to use a trail-camera as used by hunters - provided it doesn't use PIR as the trigger. These have all the required features except waterproofing and, perhaps, picture quality.

  • \$\begingroup\$ Thanks for this very interesting answer! I would like to accept it as well... Since seals are mammals, they do have warm blood (37°C), but you might be right, it does not mean their skin is warmed than water. "Seals keep their skin at just 34°F (1°C) when lying on ice" Mammal Anatomy: An Illustrated Guide \$\endgroup\$
    – arthur.sw
    Mar 6, 2016 at 21:55
  • \$\begingroup\$ And thanks for advising about retro-reflective sensors, they are probably better/safer than home made laser trigger. \$\endgroup\$
    – arthur.sw
    Mar 6, 2016 at 22:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.