Night moves

Our spiders are very quiet during the day, but we noticed that every morning their cages were full of fresh cobwebs. We knew they were sneaking around at night, and we resolved to catch them at it. A student, Ade Atolani, and I put together a gadget so we could watch.

We got a Raspberry Pi with a NoIR camera, drilled a hole in a plastic cage, and mounted it above a spider. I had no idea if this would work adequately at all — would we have enough resolution to even see the spider? How effective was this camera at seeing in the dark anyway? — so we just slapped together a quick trial run. We turned everything on late one afternoon, told the Raspberry Pi to take a picture every 60 seconds, and let’s see what we get. Miraculously, it all worked, first try.

What you’ll see in the video is a rectangular wooden frame in a cage, and we’re looking down on it. There’s a nice velvety dark cloth on the bottom, to minimize glare and reflections. At the beginning, there’s diffuse light from the window, so the infrared camera isn’t kicking in yet, but when it gets dark enough, the IR lamps automatically switch on, and the purplish black cloth looks pink. The important thing is that we can see the spider all night long, as it goes through bursts of activity. Awesome.

It looks like we’re going to have to sample at a higher rate, because the behavior is very bursty. We’ll enclose the whole set up in a light-proof box to get rid of the extraneous light. I also want to try some side illumination with an IR lamp to see if we can resolve the webbing as it goes up. This was just a pilot experiment, but it’s very promising.


  1. says

    I feel like I’ve noticed this “bursty” behavior in my house spiders. Usually around 11:00 or midnight they start getting active and setting up new lairs.

  2. bcwebb says

    Pretty cool.
    1. Even fast frame rates should compress well when stored as jpg video since most of the image is static.

    The behavior may be set by light, the spiders may avoid motion when birds can see. – A box may change the behavior although I guess you could test with LED’s in the box. They may also flee rapid light changes as from predator shadows like how mice react.

  3. consciousness razor says

    I also want to try some side illumination with an IR lamp to see if we can resolve the webbing as it goes up.

    Just don’t let them get the wrong idea….

    Let the Midnight Special shine a light on me
    Let the Midnight Special shine the ever-lovin’ light on me

  4. wzrd1 says

    I had a quick look to see what wavelengths spiders see, interestingly, jumping spiders see green. I say interesting, as it seems an odd color for vision, given the amount of vegetation about in a spider’s natural environment. Also, camera sensors that detect green cross-react to see IR diodes quite well.

  5. unclefrogy says

    seeing green might make the contrast of their better.

    one of the things I am fascinated and curious about is the shape of the netting their web they make. they are all different some are very hard to see until they are all dirty or damp.
    the long legged spiders I have all the place here web is very hard to see the details but when you can see it it is an inverted bowl or dome rather large with some “guys” around inside anda large amount of structure outside the “dome to keep its shape
    The black widow \s web is distinct as well centered arond a hole of some kind mostly low to the ground and their web goes out from a round central shelter area out and down to the ground I have not been able to look very close to see the details of the active trapping webs but would suspect it has a pattern as well I do not think it is completely random just hard to see. the web is also extremely strong. what good is a trap that is easy to see?
    is there a pattern that those spiders want to make? does the size of their enclosure effect it in some way?

  6. komarov says

    Pretty cool. A suggestion, if I may: You could try to program the camera to capture live video when the spider turns active. E.g. capture at low frame rate throughout the night but if images start to change (-> spider moves) switch to live / high frame rate for a period of time or until images become fairly static again. That should cut down the amount of footage of spiders sitting still you get. Or you could probably throw some ready-made machine-learning software package and teach it to track spiders, but those kinds of solutions are so boring.

    As for visible webbing: You could always genetically modify your spiders to produce webbing that shows up on IR. That’s a thing biologists routinely do, isn’t it? I see no downsides to this approach at all. Well, maybe some activists will show up to protest against you breedng GM-spiders, all of which ultimately leads to the destruction of your lab* and the release of said spiders into the wild, thus sealing humanity’s fate for good. But nothing serious.

    *Biology departments are presumably insured against this sort of thing. Another matter of routine.

  7. lurker753 says

    Hi PZ,
    There’s a package for that. :-)

    Probably motion does what you want – watches video, ignores frames where nothing changes, does whatever-you-want when something does. See:
    (Tuning the activity threshold might be hard, though, & introduces its own detection bias. Hey, you could capture a whole night of video, then run motion against it with various settings…. figure out How To Observe Spiders In The Dark. Fun project for somebody)

  8. blf says

    As lurker753@11 says, there is motion-capture software for Linux. I myself use motion (the same package @11 refers to), and for my needs, it has worked fine. Offhand, I can’t think of a reason it wouldn’t work here, and so suggest considering / trying it to see if it “eliminates” (well, reduces, more likely), the burstiness.

    Like others, I kindof wonder if the IR or camera is detected by or otherwise effects the spiders — either the actual IR radiation, any heat emitted by the lamp (probably very low in the case of IR for obvious reasons), or the flashing of the LED on the camera? (That last one is probably simple to eliminate by simply covering the LED with some opaque tape.)

  9. whheydt says

    The existence of NoIR PiCameras was by popular demand. It started when people began removing the IR filter from the original PiCamera v1. The RPF responded by releasing a model without the filter. With the PiCamera v2, they released both versions right from the beginning. There is no NoIR version of the HQ camera, but there are directions for removing the filter. I was watching an interview with Eben Upton last night (it was recorded in mid-June) and he was musing about bringing out a NoIR version of the HQ camera.

    Anyway…the RPF really does respond to what Pi users want, within reason and budgetary limits.

    My own uses and plans for PiCameras are a bit different… I have a PiCamera v2 set up for my grandson to be the video feed for his teleconferenced schooling (the local schools are using Google Meet). Since I have an old Kodak Cine Special I and the associated lenses (several of them C-mount) and used to use an OM-PC 35mm camera and have those lenses, I have ordered an OM to C-mount adapter. I want to see how the Pi HQ Camera works with a 600mm catadioptric lens… (Also, the 63mm C-mount macro-focusing lens has possibilities.)

  10. old210 says

    You might look into Motion Eye OS for the Raspberry Pi. It takes pictures and video when it detects a change in the video image. I used it a year ago to find out who or what was knocking over my recycling bin. (Spoiler: It was a deer.)

  11. wzrd1 says

    @stroppy #15, any idea what wavelengths of UV are being reflected? I am oddly sensitive to long wave UV, perceiving it in the violet range, suspect it’s some protein fluorescing that allows that. I do know that shorter wavelengths some insects perceive very well.
    I’d doubt anything could see in the UV-C range or EUV, given those are energetic enough to cause ionization. ;)