Public Lab Research note


Webcam Conversion to (Near-) Infrared

by JoshMc | October 13, 2012 03:12 13 Oct 03:12 | #4389 | #4389

UPDATE: My previous image server has shut down, so I've uploaded them to a new host, so you can see them here: http://s1127.photobucket.com/user/Josh_McIlvain/slideshow/Webcam%20IR%20Conversion

For a while I've been wanting to convert a point-and-shoot digital camera to an IR camera by removing the built-in IR blocking filter and replacing it with and IR-pass filter. However, as a practice run (and to make sure the results will be as fun as I hope they will be) I decided to start with a webcam.

The webcam I used was a Logitech C270, but it seems like most recent Logitech cameras (it's 10/12/12 while I'm writing this) are pretty similar inside. From my research online it looks like they used to attach the IR blocking filter to the lens, but now they're attaching them to the CCD housing, which is unfortunate because the CCD is much more sensitive. More on that below.

Basically, this document is mostly going to be pictures with minimal wording for explanations. If you have any questions or think something should be clarified, feel free to post in the comments.

But first, a very important note: the home-made IR pass filter I used is made from developed 35mm film. If you've searched the internet, the majority of of sites you find will tell you to use unexposed or underexposed developed film. THIS IS NOT CORRECT. You MUST use EXPOSED (some will call it over-exposed) developed film. This means THE FILM MUST FIRST BE FULLY EXPOSED TO LIGHT, THEN DEVELOPED. If you already have some old film negatives, you can use the end-pieces that were exposed when loading/unloading the film. If you don't, you can either A) buy some film, pull it out of it's container and expose it to light, and get it developed (more expensive), or B) go to a store that develops film on-site and ask if they have any end pieces laying around (cheaper).

Again, I'll clarify YOU MUST USE DEVELOPED FILM THAT HAS BEEN EXPOSED TO FULL LIGHT BEFORE IT WAS DEVELOPED. Unexposed developed film appears mostly clear, because it lets a lot of visible light through. Exposed developed film appears opaque to your eyes, because it blocks visible light. This is exactly what you want for a IR-pass filter: let infrared light through, and block visible light. You can use unexposed developed film, but it will let almost all visible light through, and won't give you infrared pictures.

I'll discuss this more at the end, but obviously if you plan to use your webcam in a spectrometer setup, you probably won't want to use any visible light filter, otherwise it will only be useful for a very small range of near-infrared.

So, without further ado...

I used a size "0" phillips screw driver.

You can't see them really well in this picture, but two screws hold the circuit board down, one in the bottom left and one at the top right.

I didn't get a picture taken before I took the IR blocking filter off, but it was glued to the ledge just above the CCD shown in this photo. To remove it without damaging the CCD I first heated the glue with a hairdryer for about a minute to loosen the glue. This step is very important, if you don't loosen that glue, you'll probably damage the CCD when trying to pry out the filter. After the glue was loose, I used a sharp pocketknife (a razor blade would work well too) to carefully pry out the filter. Even with my precautions, the filter still broke as I removed it, because it's very brittle. You can also see at the top right corner where I dented the plastic a bit with my knife.

Next, the focus of the lens had to be adjusted, because the filter was removed. Alternatively you could replace the filter with a different filter of exactly the same thickness, but I didn't have one, so I adjusted the focus. It comes glued into place. I would have liked to use the hairdryer again here to loosen the glue, but I didn't have it with me. Instead I scored the glue with my pocketknife a bit then twisted hard and it popped loose. You still should be careful with this piece, but it's not nearly as sensitive as the CCD.

Uploaded on Razzi.me Once the glue is free, you can adjust the focus by screwing the lens in or out.

Uploaded on Razzi.me

At this point, it's good to check the CCD for fragments of the filter. I plugged it into my computer, and you can see it was pretty dirty. I wiped it off gently with a DRY q-tip. It's important to remove any dust, filter fragments, hairs of yours that have fallen out during the process, etc. Then you can screw the lens back in and adjust the focus.

Uploaded on Razzi.me

Uploaded on Razzi.me

Uploaded on Razzi.me

Uploaded on Razzi.me The above three pictures are intermediate stages of my attempts to focus the lens. It's not perfect, because at close range things get a little blurry, but for objects far away it's pretty clear, and I decided to mainly go for longer distance shots anyway.

Uploaded on Razzi.me Once I had it focused, I put it all back together. Then, I took two pieces of OVEREXPOSED DEVELOPED 35mm film and taped them over the lens of the webcam. If I wanted something more permanent, I could put these inside somewhere where they would be protected, but I wanted the ability to let visible light in or block it with the filter at will.

It does take two pieces of film to block out most of the visible light. With only a single piece, the CCD was still able to pick up about half the visible light. See the pictures below.

Uploaded on Razzi.me Internal IR blocking filter removed, but no visible-light blocking filter added yet.

Uploaded on Razzi.me A single piece of OVEREXPOSED DEVELOPED 35mm film blocks some of the visible light, while allowing infrared light to pass.

Uploaded on Razzi.me Two pieces of film block most of the visible light.

Uploaded on Razzi.me One of the first things I noticed was that while all of the overhead lights appeared to be the same brightness in the visible spectrum, some were drastically brighter or dimmer than the others in the near-infrared. I don't know enough about fluorescent lighting to say why, but I thought it was interesting.


I'll add more to this note as I play with this webcam some more. It's important to note that technically, it only picks up "near-infrared" light, because that's all the CCD is sensitive to. I plan to use this webcam (without the film filter) in my next spectrometer, and I'll do a test of just how far into the infrared it can go when I've got that built.


I did this Help out by offering feedback!


People who did this (0)

None yet. Be the first to post one!


35 Comments

The bright bulbs must be the ones with extra coatings to look "warmer" - mostly terbium and europium I think. See some of the cfl spectra on spectral workbench. Would be interesting to see if those bulbs look more visibly warm.

Reply to this comment...


Hi, thanks for this detailed writeup - I'm in the process of converting my c270 into a IR only tracking device for Freetrack (my 3rd or so). I'm also installing an IR only filter.

Your warning about the IR filter removal re hair dryer led me to heat it up for 5+ minutes, I've actually got it out in one piece :)

Cheers Nils

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Nice tutorial! I am building a DPSS laser and need a near IR viewer for alignment @ 808nm and 1064nm. The beams are quite bright on the optics (If you can detect the wavelength that is),for but did you get to the stage of constructing a spectrometer and learn how far the CCD from this camera will function into the IR?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Nice tutorial! I am building a DPSS laser and need a near IR viewer for alignment @ 808nm and 1064nm. The beams are quite bright on the optics (If you can detect the wavelength that is),for but did you get to the stage of constructing a spectrometer and learn how far the CCD from this camera will function into the IR?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


No, unfortunately I haven't had time to switch it into my spectrometer, so I can't say for sure how far it goes past the visible spectrum.

Reply to this comment...


the 808 should work, but not sure about the 1064nm. It may depend on the camera you use. The one in the Desktop Spectrometry Kit is a CMOS, btw.

Check this page for sensitivity of different sensors: http://publiclaboratory.org/wiki/uv-spectrometry

Reply to this comment...


Hi guys.

Trying to use this camera with facetracknoir. It worked normal but I wanted to remove the ir filter for better results. I followed JoshMC sequence but unfortunaly I destroyed the filter, but thats ok since I wanna use the cam for headtracking only. After I put my cam together, I placed a disc tape in front of the cam as a filter. But something went wrong. The cam sees only black space. Whether I use light or not the cam cannot spot the leds I use for headtracking. It can see nothing. Did I damaged the cam or is it something else? I took some precautions i.e. not to expose the cam in daylight while I was removing the filter, use hairdryer and so on...

Plz help.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hey VonK,

First thing that comes to my mind is I don't know what you mean by "disc tape", so I suggest first taking the disc tape filter off and see if the camera can see any picture. If it can see without the filter, then the filter you're using doesn't let through any light the camera can detect and you need to try another filter. Also, the camera has a little green light that comes on when it's sending information to the computer, does that light come on? If removing the filter doesn't give you a picture, open the camera back up and see if there is anything obviously wrong with electronics (maybe you dropped something in there or bumped something that broke loose, etc.). Keep in mind you can also plug the camera into your computer when it's taken apart, it will just have a blurry image if the lens isn't in place, just don't touch the circuitry with anything while the camera's plugged in. Try those things, and let me know how it goes.

Josh Mc

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hi Josh

I put a floppy disc tape in front of the lense and outside of the camera. This is mostly recommented for headtracking. I removed it and there is black space again. Also, the green light is on when connected to my pc and capture an image. I also tried to screw unscrew the lense cap while plugged in and noticed no difference. All black.

Reply to this comment...


Ok, yeah, the film from a floppy disk is supposed to work well for this. If the green light is on and there's no picture at all, it sounds like the connection to the sensor may be damaged. Can you see anything obviously wrong when you look at the electronics inside? Wires broken off, components damaged, foreign objects stuck in the components, or anything like that?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


I have to go home to check this. Tnx for the replies Josh.

Reply to this comment...


Hi Josh I see no scratch or similar damage inside the cam. Nothing is wrong everything is in place. But the cam doesnt work at all. Green light is still on.

Reply to this comment...


Well, I can't think of anything else to try. I'm sorry I wasn't able to help more.

Reply to this comment...


No problem. I ordered a new one already.

Reply to this comment...


Oh, I have to ask a question. Is it possible that the green light has something to do with the black vision I have? what will happen if a turn it off?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


I don't think that disconnecting the green light would make much of a difference. It's supposed to be an indicator that the camera is in use (so people don't have to be paranoid about someone taking control of their camera and watching them through it), so if it's working correctly, it should light up whenever you have the camera plugged in and are running a program that tries to view the input from the camera, and it should not light up when you are not doing that.

However, if the camera isn't working anyway, I guess it's junk and it won't hurt to mess around with it and try whatever you like ;)

Reply to this comment...


Similar to VonK, I have just removed the lens from 2 of these cameras and both are now not working at all. Both IR lenses came out in one piece with a razor blade. I was afraid I had overused the hairdryer in the first one and caused some heat damage so I was very careful with the second one and it still is not working. I didn't damage any other parts in the process and visually the only mark I left is on the plastic where the lense was mounted. Any ideas?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


You should take some test shots of trees and grass outside. That's when you'll see the most dramatic impact of IR photography.

Reply to this comment...


Same problem here, i fear the webcam is broke after removing the IR filter. No visible damage either.

Reply to this comment...


Same problem here, i fear the webcam is broke after removing the IR filter. No visible damage either.

Reply to this comment...


Same problem here, i fear the webcam is broke after removing the IR filter. No visible damage here either.

Reply to this comment...


is it possible to for the webcams to stream videos and run through the plugin all while being viewed in real time? So essentially I am asking if I can view NDVI on my comp without just taking single images. Thanks guys this is great stuff.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hi, jyalarid - we are definitely planning a live streaming version of the infragram software: https://github.com/Pioneer-Valley-Open-Science/infrapix-flask/issues/19

It will likely be part of the Infragram Sandbox tool: http://infragram.org/static/sandbox/

Reply to this comment...


hello JoshMc I want to take pictures at close range, do you figure out how can I fix the focus problem ? Thanks,

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hey ikerluna! I don't know about the webcam you're using or how it's designed, but basically any webcam focus is going to be adjusted by moving the lens(es). On mine it twists to move up and down a bit, and that's how you get it in focus. However, there gets to be a problem once you remove the infrared filter. When light goes through a lens, the angle it bends at depends on it's wavelength. So essentially, different colors get bent differently by the lenses, so colors that lined up at first tend to get blurred. (If you zoom in to see individual pixels on a high quality image you'll often see a red tint on one side and a blue tint on the other of an object.) For red through blue light the effect isn't usually enough to make a big difference. However, when you start looking at the infrared light sent through a lens designed for visible light, the effect becomes greater. You can help it a bit by adjusting the focus as I suggested, but the short story is that you're probably not going to be able to focus the infrared+plus visible light perfectly.

To get as best as you can, start at a point that is out of focus, and move the lens a bit closer or further. If it gets better, do that some more. If it gets worse, go the other way. And just repeat that with progressively finer adjustments until you've got the optimum focus. Be sure you're looking at a good test object (some sharp contrasts on it for good reference) at about the distance you're wanting to take the pictures.

Reply to this comment...


Thanks a lot for your help I will try to use the same webcam that u are using.

Reply to this comment...


JoshMc: interested in this info but your pictures have disappeared with the demise of razzi.me Are you planning on reposting?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hey lannutti, yeah, I've been getting this alot since razzi shut down. I'll try to re-upload the files to my new host and post them here.

Reply to this comment...


Thanks! A lot of folks share your pain.

Reply to this comment...


Hi Josh - you can also drag & drop images into the research note itself now and they'll upload and embed.

Reply to this comment...


lannutti - I've re-uploaded the pictures, you can see them here: http://s1127.photobucket.com/user/Josh_McIlvain/slideshow/Webcam%20IR%20Conversion
I also added the link to original post.

warren - Thanks for that info. It was simpler for me to upload the images straight from my software, but I'll keep this in mind for the future, thanks!

Reply to this comment...


Hi, thanks for the tips on IR filter removal on the C270. I thought I'd share my experience... Firstly, I didn't want to heat mine too much as I feared the failures above may be due to melting the solder on the surface mount components, but ended up leaving mine for 2 minutes approximately 8cm away from a 1kw fan heater. I then tried to prise the filter off from the corners using a sharp stanley knife blade, but the glue would not give at all. Using more force I then 'successfully' removed the filter in no less than 1000 or so pieces, allowing gravity to let them fall away from the sensor. I then plugged the camera in and noticed another 1000 or so fragments had stuck to the CCD, along with a couple of big gashes across the image. I attempted to remove these by blowing and using a thin corner of a cigarette paper, but this caused more scratches. What did work was putting a blob of "lens cleaner" (smells like an ethanol/alcohol substance) straight onto the ccd. Viewing the picture from it I could see the fragments rise in the suspension after a few seconds. I then flicked the blob of alcohol containing the fragments off the CCD by flicking the back of the PCB. I repeated this a few times, and now have a picture with around 20 small fragments and a few gashes of white in various places! Conclusion: these CCD's may be a lot more sensitive to scratching compared to an SLR sensor which is designed to be cleaned on occasions. In the event of potential shattering of the filter, it may be wise to do this with a vacuum cleaner nozzle mounted very near, so shattering fragments have less chance of ever touching the CCD. Despite this experience (which, incidentally I did take great care with) I do now have a camera suitable for a spectrometer as enough of my picture is clear(ish) of marks to scan many clean horizontal lines. And I also thoroughly recommend this procedure, maybe trying more heat than I did :-) Have fun, Rob

Reply to this comment...


Hi, Update (13/02/2014). In the new version of this camera released by Logitech the IR filter is integrated in the sensor itself. It is impossible to remove without removing the entire sensor as well. That means that cameras with the serial number: 1345LZ0DXXXX they are no longer useful for IR conversions. The cameras that seem to work as described in this article are the ones that have the serial number: 1248LZ0BXXXX I hope this will be useful for somebody.

Best regards, Luis.

Reply to this comment...


Actually, it seems to be possible to remove the filter coating (which should only be a few microns thick) on the new versions. After removing the outer housing and the lens, I saw a monolithic sensor – no removable filter, but obviously reflecting reddish light. I sanded the sensor using ultra fine sandpaper (2000+ grit) until the reflective color looked much less reddish (though this could have just been my imagination). Then I used some Novus plastic scratch remover and polisher on the sensor. Finally, I cleaned everything up with isopropyl alcohol and let it dry. The camera now seems to be able to detect IR light.

Reply to this comment...


Yes drag and drop would be fine

Reply to this comment...


Login to comment.