Skip to main content
Chemistry LibreTexts

9.21: CSI Camera

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Setting up Camera

    You will now set up the Ribbon camera as outlined in Figure \(\PageIndex{4}\), but first, you should watch the following two videos. The camera is very static sensitive, so you want to be careful.  It comes in a protective ESD bag, and you should store it in a ESD bag when not in use.  It is advisable that you touch a grounded metal surface before working with the camera.  You will attach the camera to the pi through the MIPI SCI (Camera Serial Interface) with the 15 pin ribbon, such that the blue side faces towards the USB 2.0 ports (Pi 4), or the Ethernet (Pi 3).  The connector has a plastic clip that needs to be raised slightly, you then slip in the ribbon and then lower the clip back into place.  I personally like to use tweezers and suggest you get a set of precision tweezers like these, as you will find them very useful when you are building circuits. 

    clipboard_e9fa61493b431fa864380e056b51451f9.pngFigure \(\PageIndex{4}\): You lift up the black tabs around the camera port and then insert the ribbon with the blue side facing the ethernet port. Note, this picture is of a Pi 3, and in the Pi 4 the USB 2.0 ports are located where the ethernet port on the Pi 3 is

    With the Raspberry Bullseye operating system the old raspicam program was deprecated and the new libcamera is installed.  Many programs still use the old system and you can switch between them with the raspi-config command.

    Switching camera interfaces

    To switch camera interfaces between raspicam and libcamera you go to the Pi Configuration Tool (raspi-config)

    • Raspicam using the legacy camera support
    • libcamera does not
    sudo raspi-config 

    Use the down arrow to navigate to option 3 (left image of fig. \(\PageIndex{5}\))

    clipboard_e1c76884e2d26dc0d3bd4528512571ee3.pngFigure \(\PageIndex{5}\): Raspberry Pi Configuration tool (2022, Belford CC0.0)

    The first option is to support the legacy camera support (raspicam), and the default should be for it not to be supported (right two images fig. \(\PageIndex{5}\)).  If you wish to use Raspicam you need to choose yes.  If you wish to use Libcamera, just leave it at No.  I suggest you work with Libcamera, but if you have some third party software the issue may be that it is set up for raspicam commands, and so you may need to switch the interface.  

    If you choose to use Raspicam you can go to the 2020 class section 1.3.7.

    Right now we are going to interact with the camera through the command line. Later on we will do this through python scripts. 

    This page titled 9.21: CSI Camera is shared under a not declared license and was authored, remixed, and/or curated by Robert Belford.

    • Was this article helpful?