Tank Journal Archive

Rob

Member
Apr 26, 2012
743
424
Webcam Using Raspberrypi
Have been thinking of connecting up a camera to my tank for years however never could decide on model, capability required etc etc so it kind of got too hard and shelved the idea. However I installed a fast wifi connection to my tank (dualband wifi bridge WN2500RP ) so I have fast copper ports at the tank. 1 is for the profilux and the other for my raspberrypi.

HARDWARE
Webcam: Old logitech 9000 web cam
Device: USB plugged directly into Raspberrypi
Software: Installed an application called motion, allows video streaming and snapshot
FrameRate: Can do 1 FPS and looks really good however set back to 1frame / 5 sec to reduce load on an external connection.


Aquapi_webcam.png

A quick shot of the raspberrypi streaming video to my Profilux interface. I'll post a better shot during the day as the lights are now down and fish gone to sleep.

Enhancements
Although the Logitech 9000 is OK its quite large compared to the newest models and mounting is an issue. I plan on getting a Logitech C525 this week and give it a go. Would really like a webcam which has manual focus ring however seems all the new ones have auotfocus. Still unsure if autofocus is in the camera or in the driver. I hope its in the camera.....
 

Attachments

Rob

Member
Apr 26, 2012
743
424
Purchased a new camera from logitechaustralia ebay store for $40.00 delivered this week so can compare two camera's on the tank.

Logitech 9000 (Old unit had lying around)
I think the optics in this unit (Carl Zeiss) is better but seems slower to focus and take a pic than the C525. So can be a little blurry on anything moving when streaming the picture. However water seems a lot clearer with this unit when it takes a picture snapshot.

The picture below is a standard no tuning pic from the 9000 (This image was not from streaming the camera, its a striaght snapshot.
snapshot - 9000.jpg



Logitech C525 ($40.00 delivered)
This unit took 20 minutes of messing around with the brightness and contract, hue and saturation before it took even a 1/2 decent pic / video. Im sure the 9000 above could be made even better if I took it off auto.
snapshot - C525.jpg


Conclusion
Physical mounting The 9000 is larger unit and does not look as good mounted to the side of the aquarium
Picture quality : 9000 wins when taking a snapshot, although think with a little more tuning I can improve the C525. the 9000 water surface looks amazing.
Resolution: Cannot seem to get anything above 640x480 on either camera. (I think its because the RPi USB interface being slow)
Focus: I think the C5252 wins on moving objects when streaming, but cannot understand why the 9000 makes the water look soo clear when it takes a picture.
Colour: 9000 is great without playing with manual settings.
Web browser: Streaming only works in FireFox or IOS. Still jpg are fine on anything. I think IE may need a web page with the stream embedded, I may ask @macca_75 to have a play as I know he's an IE fan and has his own webcam installed.

I am going to persevere with the C525 (and take some more time playing with the settings) only because it just looks like a small rectangular box on the side of the aquarium and does not stand out soo much even though 9000 may take a slightly better PIC. Without comparing cams side-by-side any aquarium stream is awesome.... Raspberrypi is a winner again for what you can achieve with a $35.00 RPi and an old webcam.
 
Last edited:

Rob

Member
Apr 26, 2012
743
424
Found a cool feature of the "Motion" application. That is you can control it through http requests to change its parameters whilst its running. The first thing to do is to overlay some data from the profilux.

Here is the script running on the Raspberrypi, it gets profilux data temp,ph,orp and then sends this string to motions text attribute.

Code:
#!/bin/bash
while true ;do
  data=`curl -s -d name="xxx" -d pass="xxx" 192.168.1.30:81/sensordata.html`
   /usr/bin/wget --delete-after "http://192.168.1.24:9080/0/config/set?text_left=Aquaruium Data\n$data" 2>/dev/null
sleep 900
done
This is the result, Aquarium parameters overlayed on the video stream, lower left corner
stream with tank params.png


I also set the text size as "double" in motion so its easier to read., The text is a little "blocky" not much I can do about that,
 

Rob

Member
Apr 26, 2012
743
424
@macca_75 imagemagic would do a better job as you could overlay a translucent rectangle and place the data in whatever size,style colour you want. However this would only work for the still image captures and requires another application.
Motions limited text attributes are here: http://www.mit.edu/activities/anime.../motion-3.2.8/motion_guide.html#Text_Features
If I wasn't soo bloody old and my eyes were good I could leave it at default size...

Depending on "OUR" final interface maybe we just stick with a snapshot and do a nice data overlay using imagemagic. However I do kind of like the 5 sec stream

Now if we could just get a "hot-spot" defined on the video stream so when clicked we go to your cool trend application :) We could do that with imagemajic and overlay buttons and data, could make a cool interface, shows a pic of the tank, current data and click the data area and go to a long term trend ... or just overlay your sig banner ! youve already got that done
 

macca_75

Member
Apr 22, 2012
2,125
844
@macca_75Now if we could just get a "hot-spot" defined on the video stream so when clicked we go to your cool trend application :) We could do that with imagemajic and overlay buttons and data, could make a cool interface, shows a pic of the tank, current data and click the data area and go to a long term trend ... or just overlay your sig banner ! youve already got that done
Not sure what you mean. Lets chat over coffee tomorrow.
 

Rob

Member
Apr 26, 2012
743
424
Going to try an ebay waterproof webcam. Not expecting too much however hope to be amazed or on the other hand Ill throw it out and forget I ever purchased it. The clarity of the current unit is pretty good however would like to tuck one away under a rock in the tank. Out of direct light and I would hope algae is controllable on the lens and maybe a wipe once a week would be great. At the moment I do not think I get any more resolution than 640x480 using the RPi anyhow. Excited to see the quality but for 16.00 delivered I would prefer to pay 5x this if I could get a better unit. Other units seems to have a brass/metal body.





IP67 webcam.JPG


Features:

  • Brand new and high quality.
  • The mini endoscopy is a true plug-and-play driver not installed, convenient detection equipment and a 10 mm camera ( 0.3937inch ).
  • A new electronic health and industrial pipeline detection products, which can capture the image, to the computer in real time video and photos, storage, printing, or uploaded to the internet.
  • XP system can watch video directly without install software, Vista or Win 7 need install software which in the CD
  • Can take photo (XP system can use itself photo function to take photo or use our software, other system need use our software to take photo)
  • You can use it to check, ear detection, etc.
  • Automatic white balance, automatic exposure
  • 4 white LED light adjustable.
  • Waterproof Level: IP67.
  • Resolution : 640*480 30ftps.
  • Sensor: 1/6 CMOS Image Sensor
    Pixels: 1/6 VGA COMS (640 X 480) Pixels
  • USB2.0 interface, Can adjust the 4 light-emitting diodes.
  • Focal distance: 8CM-infinate
  • Camera housing diameter Φ10mm
  • View angle: 62 degrees
  • Cable length:2 meters.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
I can envisage using one of these to check dottyback eggs that have been laid in some PVC pipe - you could leave it permanently in place so the fish get used to it...

So many things to do, so little time to do them :banghead
 

Rob

Member
Apr 26, 2012
743
424
Kind of excited about the possibilities, already thinking how I could drill a 10mm hole in the corner of my euro brace to pass the usb cable through neatly. I do have the perfect position for one which is between a zenia colony and a large green finger leather which could hide something as big as a tennis ball size. !.

gotta settle down and not get too far ahead of myself. Probably going to be shit resolution.... If only blueocean marine would sell those Microsoft lifecam acrylic enclosures Id be set.