Marco Lurati

Raspberry Pi HD web cam

- file://plIwe11e6P8FT7eC

  • RaspberryPi

The camera is built around the Raspberry Pi Zero W (that does have wireless LAN connectivity) and the Raspberry Pi High Quality Camera that does have a Sony back-illuminated sensor with great size compared to the super tiny one generally used with the Raspberry Pi (sensor size is way more relevant than pixel count for the final image quality).

It also has a C and CS mount for choosing different lenses (this typology of lenses is used for security cameras or industrial applications). Thanks to that, it's possible to use the camera with a wide choice of lenses (high quality made with glass as well, not done with the cheap plastic as the tiny one). The camera can be used in various applications, like a wide-angle camera, a telescope, or a microscope.

The lenses used in this post are from ArduCam, which offers many solutions for platforms like Raspberry Pi, NVIDIA Jetson, OpenCV AI, and ArduCam, which offers many solutions for many platforms, like Raspberry Pi obviously, as well as NVIDIA Jetson, OpenCV AI, SPI solutions cameras for microcontrollers, etc.

Goals

The goal is to build a compact, customizable, high-quality 1080p HDMI camera for any possible use, ready to be mounted with a standard 1/4" screw on any existing tripod and fixture for flexible positioning. It should also have buttons to flip the image and easily adjust the orientation (so there is no need to do that in post production or use OBS).

Quick and fast setup recap

1) Install the Raspberry Pi OS on the micro SD card using the Raspberry Pi Imager. In the "Advanced options," set the SSH credentials, a custom hostname for the Raspberry Pi, and the Wifi connection settings. In this way, once booted, the Pi will be automatically on the local network without using a mouse and keyboard.

2) Install the SD and power it up. Access via the terminal (mac and Linux) of PuTTY. Via terminal (mac and Linux), write ssh user@hostname.local to access the Pi (example: ssh pi@raspberry-pi-cam.local). With PuTTY, insert the hostname.local in the hostname field and follow the login procedure in the terminal.

3) Activate the camera port (interface) and set the screen resolution to 1920x1080 in the raspberry config sudo raspi-config. Exit the config and reboot the Pi with sudo reboot. You must do the same SSH connection procedure of point 2. to reconnect afterward.

4) Update, upgrade, install python3, python3-camera and download the script from GitHub. Run the script to test that everything is working:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python3
$ sudo apt-get install python3-picamera
$ sudo apt-get install git
$ git clone https://github.com/marclura/raspberry-pi-hd-web-cam.git
$ cd raspberry-pi-hd-web-cam/code
$ python3 web-cam.py

5) Set the camera script to start automatically at power on.

$ sudo chmod +x web-cam.py
$ sudo nano /etc/rc.local
// add this line to the rc.local file before the last line "exit 0", then close and save the file:
sudo python3 /home/pi/raspberry-pi-hd-web-cam/code/web-cam.py &
$ sudo reboot