0
\$\begingroup\$

I'm working on a hobby project which involves a Raspberry Pi (zero) and I want to connect 2 cameras to it. One is the Raspberry Pi HQ camera with a tele- lens, the other one is a cheap wide angle camera. I've seen there are some multiplexing modules made just for that (mentioned in a similar post on this platform), but they're a bit pricey, and I'm thinking maybe that's a bit overkill for me. I'm trying to keep the parts count down because eventually this project will end up on a drone and can easily be lost. So the cheaper and jankier this whole thing is, the better.

My idea is to just wire both cameras in parallel and then splice up the ribbon cable and make some small logic circuit that will send power only to the needed camera. Is there any reason why I shouldn't do this? Looking at the pinout of the camera interface, I see that it's power + ground + I2C + some diff pairs. Power and I2C shouldn't be a problem I guess. Is it bad to have diff pairs connected in parallel to an unpowered second camera?

One issue I see here is that there's obviously some initialization going on when the raspberry boots up. So if it starts with one camera and then I hot-swap the other one, it will not work. But I'm thinking it should be possible to switch power to the second camera and then re-run this whole initialization part, right? Or at the worst case, reboot the whole raspberry?

I don't need the cameras to work at the same time and don't really need fast switching between them. So if it takes 10, 20, 40 seconds to switch I'm good, as long as it works at least.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ You'll almost certainly have issues with this approach... could you consider the Pi 5 (which has 2x MIPI CSI interfaces), or 2x Pi Zero? \$\endgroup\$
    – Attie
    Commented Jul 6 at 18:19
  • \$\begingroup\$ @Attie I actually considered using 2 pi zeroes, but then I'll need to do some tricks to transfer the images. Also seems weird to have a second pi just for the camera. I think if I can't get this to work I'll just add a USB camera \$\endgroup\$
    – floppydisk
    Commented Jul 6 at 18:25

2 Answers 2

2
\$\begingroup\$

You'll almost certainly have issues with the "Y-split" approach you've presented... if you want to keep the technical complexity low, could you consider either 2x Pi Zero, or CM4 / Pi 5 (which have 2x MIPI CSI interfaces)?

If you're content with a USB camera, then that would probably be the easiest / quickest route forward by far.


If you need / want to do this with a single Pi Zero, then you'll need to look into something like the TS5MP645 (from a quick / low-effort Google search), which is fundamentally "an SPDT switch for MIPI".

Depending on what addresses are used by each camera, you may also need to put the cameras on separate I2C busses or require a mux on the I2C bus.

I believe MIPI CSI2 supports multiple cameras (see "virtual channels"), so the "Y-split" approach isn't entirely technically infeasible... but you may find support from the host / cameras / drivers is lacking, and you will also need to be very careful with the signal routing and signal interity.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for the info, that's more or less what i thought, there should be a reason it isn't done like this 😅 if I still were to try the Y-split option, do you happen to know if it is theoretically possible to set lower data speed for camera interface to try to increase the robustness of the signal at the expense of lower image refresh rate? \$\endgroup\$
    – floppydisk
    Commented Jul 6 at 19:06
  • 1
    \$\begingroup\$ You can generally reduce the clock speed and/or resolution which impacts the frame rate... That said, having an unpowered sensor on the signals will likely destroy any signal another node is trying to put out - you'll need to "disable" it (possibly hold in reset), or look into multi-sensor support. \$\endgroup\$
    – Attie
    Commented Jul 6 at 19:11
0
\$\begingroup\$

Yes, there is a reason why it's not done like you say because it will be bad.

High speed digital interfaces can't be paralleled the way you expect.

The unpowered camera will still be on the bus and the powered camera cannot communicate with the RPi.

Also the high speed signals see the other flat flex cable as a stub so signals will reflect and bounce back.

So you would need to mux the data bus only to the powered camera.

Which is likely what the camera mux modules do and why you think they are pricey, but if there was a cheaper way like just connecting them in parallel like you suggest, it would have been already done as cheaply as it possbly could.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.