I purchased a Raspberry Pi infrared camera module (Digikey part number: 1597-1423-ND
) to turn my Raspberry Pi model B+ into a webcam. I wanted something that could see in the dark at the time I purchase the camera module late last year. When I realized that a webcam would be useful with Skype, Webex, Google Meet, Discord, and Zoom meetings, webcams and cameras in general went mostly out of stock due the stay at home orders to combat COVID-19.
The Raspberry Pi camera module uses the 5 megapixel OV5647 sensor. The camera module includes two IR LEDs. According to the Raspberry Pi website
this is a version 1 camera.
The OV5647 sensor data sheet indicates that the camera provides the following formats. I've only managed to get the 640 x 480 resolution to works so far. The CPU utilization is 90% at this resolution and may indicate that a Model B+ may not be able to stream higher resolutions.
Raspberry Pi Camera Module
| Aspect Ratio
| Frame Rate
| 1 - 30
| 1 - 15
| 1/6 - 1
| 1 - 42
| 1 - 49
| 42 - 60
| 60 - 90
webpage provides useful information on using the Raspberry Pi Camera.
Raspberry Pi Webcam Setup
The article How to setup a Raspberry Pi Security Camera Livestream
has some missing info so I could not follow it. I used Build a Raspberry Pi Webcam Server in Minutes
instead and the steps below are a summary of the article. To begin, update the Raspberry Pi, and install motion and libjpeg62.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install motion
sudo apt-get install libjpeg62
with the following changes. Motion.conf has a lot of parameters so make a back up copy before making any changes just in case.
# Turn these off if motion freezes
# The default setting changed to 1296x730 for a 16x9 aspect ratio
# and a higher image resolution.
stream_maxrate 100 # default 100
framerate 49 # default 100
width 640 # default 640
height 480 # default 480
Motion is very sensitive to width and height settings. If they are not correct then there is no output. High resolutions setting produce a long lag in changes of motion.
Add the video driver
sudo modprobe bcm2835-v4l2
to the end of the file.
The following command can be used find out the status of the camera.
Test motion with the following command
sudo motion -n -c /etc/motion/motion.conf
Use the following commands to start and stop the motion service.
sudo service motion start
sudo service motion stop
Test the Raspberry Pi Camera
to determine the IP address of the Raspberry Pi. It should be a static IP address. If the Raspberry Pi IP address is set using DHCP, then set an IP reservation in your router to keep the IP address from changing.
Test the Raspberry Pi camera with your browser using its IP address and the port 8081. The URL would look like
, for example.
Connect the Raspberry Pi Camera to OBS
To add the Raspberry Pi camera as a source in Open Broadcaster Software (OBS), selected Media Sources in the Sources block, and uncheck the Local File
box. Add the IP address for the Raspberry Pi camera to the Input field
). Check Use hardware decoding when available
, and Show nothing when playback ends
. Click okay and size the image as desired.
I used my desk lamp as a makeshift tripod so that I could demonstrate hardware while on a video chat. The lamp-pod works, but it has a lot of limitations. I had to remove the LED light bulb to make the assembly light enough for the springs to hold up the lamp. Lifting the lamp changes the height and the angle of the camera at the same time. My camera module mount is fixed so I need to move objects on the desk to get them back in frame. To make the camera easier to position, the camera mount needs to be changed to be moveable to compensate for the angle introduced by raising and rotating the lamp arm. Also, there video lags by many seconds making it hard to position object precisely. The IR camera works well in low or with no visible light, but isn't good for my applications. It would be better for security applications.