This is a great project! http://www.instructables.com/id/Raspberry-Pi-as-low-cost-HD-surveillance-camera/?ALLSTEPS
I’ve burned through some commercial consumer-grade wifi cameras – they tend to not last very long…possibly a function of the weather and our Texas heat. I’ve even repaired them a couple times; replacing the IR LED array or even the wifi daughterboad. This will be much more easily serviced and debugged, though – really cool.
I went a little further by adding an IR LED array that I happened to have lying around (from previous repairs projects). It is similar to this one – http://www.dx.com/p/31632 – although I can’t guarantee this is the same one – I got it a long time. A wide variety of these arrays are available – check the dimensions carefully to make sure it will fit in your enclosure. The one I had fit perfectly in the cylindrical camera body specified in the parts list, above (not the square one shown in the pics, BTW). I mounted the camera board right behind it and cut a short length of black plastic tube that fit in the center of the array to prevent back-scatter of light when the LEDs are on.
These arrays generally come with a built-in light sensor, so they only come on at night. They tend to run on 12V, so I use a 12V AC adapter, and a ripped the guts out of a $10 cigarette lighter USB adapter from Walmart (cheaper are available) and hard-wired it in much like described here: http://www.instructables.com/id/Solder-USB-power-c…
Be sure and get one that cranks out at least 1 Amp – I did have issues getting enough power to the RPi to power it and the Wifi dongle.