I'm writing a program for the pi I need to know if the user uses a pi cam v1 or the V2 is there a known way to tell the difference. I don't mind going low level (c or c++) if I have to


You can get the revision number by this Python code:

import picamera

with picamera.PiCamera() as cam:

picamera's revision returns a string representing the revision of the Pi's camera module. At the time of writing, the string returned is ov5647 for the V1 module, and imx219 for the V2 module.

Related links:
The PiCamera Class
How do I detect the type of camera installed?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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