Raspberry Pi CSI Camera Module



Raspberry Pi CSI Camera Module

The official Raspberry Pi Camera Module is soon to be launched according to the Raspberry Pi Foundation, so I decided to have a look at this CSI-2 MAPI compliant interface to see if it was possible to connect a standard mobile phone camera to it.

I must say that I was very pleased with the results I obtained with my DIY efforts to build ai camera, and can't wait when the official camera is released for consumer sale. - It's supposed to be very good.

The MIPI interface or Mobile Industry Processor Interface is widely used in most SoC processors including the BCM2835 Block Diagram processor. This allows designers to connect compatible devices such as cameras and displays to the processor with minimal interconnect circuitry, and knowledge. Although the CSI-2 specifications and MIPI protocols are standard you cannot just use any camera.

For the MIPI interface to be enabled, a piece of software called a 'driver is required. This driver is specific to a particular model of camera and tells the GPU how to communicate with it.  Whilst difficult to write this divers is, impossible it is not - as Yoda in Star Wars would say.

The drivers for the Raspberry Pi camera module will most probably be written in America by a boffin who understands the architecture of the Broadcom SoC processor and specifically how it ports data to the internal ARM 11 Core.

I hope that the drivers they develop will cater for a wide range of low-cost generic hardware that is currently available, if not then it could potentially pose a number of problems. Many manufacturers' products will be incompatible through software thereby effectively locking them out of the market. The lack of competition may also mean one particular vendor controlling the market leading to higher prices.

Image sensor camera modules are quite cheap to manufacture and you could buy them for as little as $4.00, however there is the possibility that a vendor may take advantage of the monopoly and a $4.00 camera might turn into a 'Raspberry Compatible Camera' that costs a lot more.





I decided to have a look at some of the MAPI Compliant Cameras that are already available in mobile phones. This meant a trip to my pal Hajeeb's mobile phone junk-shop where he stores lot's of junk mobile phones for spare parts. As you can see the CCD imager on this mobile phone is identical to that on the official Raspberry Pi Module.

After trawling through datasheets and manuals I managed to find the pinout data for this camera. It was not only MAPI compliant but was also CSI-1 compliant - these standards have been in use for many years I suppose. The only problem was that the PHYsical layer was different - the pinout connector was different to that on the Raspberry Pi. Obviously mobile phones use a much smaller connector standard as space is limited compared to the huge connectors that are on the Raspberry Pi.

I also needed a small and simple interfacing circuit between the camera module and the Raspberry Pi CSI connector, which I decided to build on stripboard.





As you can see many of the cameras follow the MAPI standard. The principle of serialising CCD data is the same and there are only a few manufacturers of these chips. These camera modules can be very small, this one is smaller than a British penny.





As you can see, the CSI connector on the Raspberry Pi has some yellow coloured tape over it to protect the connector contacts from dust. I managed to push the tape aside. The ribbon cable fits nicely as you can see. The other end of the cable went to a stripboard for remapping the pins to the camera module. It involved a lot of messy soldering and hacking and took many hours of my time.





The ribbon cable was just long enough to take this photograph of my hi-fi system behind my desk. As you can see everything was wrong with this photograph; Lights, Colour, Composition, Perspective, Focus... 

In conclusion I would have to say that it wasn't worth spending so much time and effort to make my home made camera. It was the experience of reverse engineering and hacking something that was interesting. For the software driver I had to guess many of the parameters from my memory.

I'll wait until the official camera is released and see how it compares to my home-made DIY Camera. If mine is better - which I doubt -, and if this article gets any hits then I might release more information such as the schematics etc.

So what are the applications of having a camera on a Raspberry Pi? There are loads of applications. I would like to see the Raspberry Pi used in the CubeSat programmes which would be cool. Imagine the Raspberry Pi in space taking pictures of the planet Earth.

For everyday use, I think a usable camera solution would have to be one where the camera had a proper plastic case into which the Raspberry Pi Board simply plugged in. However I can't wait until the official camera comes out. I intend to buy a couple for some experiments.

Many people have commented about my hi-fi rack and speakers. It's Just a little something I made when I was a young whipper-snapper back in the 1980s. Also, what's in the blue bag? In the Blue bag is the Sony TC-152SD / TC152SD Stereo Cassette-Corder. :-)


Raspberry Pi Projects
Donate



Raspberry Pi CSI Camera Interface
Raspberry Pi CSI Camera Module
Raspberry Pi CSI-2 Connector Specifications








































































































































Author: Peter J. Vis