Raspberry Pi Single Board Computer
Identify the Raspberry Pi in Software
Designed by Mark Little
Source Files, Libraries & Documentation
There are many models of Raspberry Pi and there are some differences between the models that may need to be taken into account if a program is capable of running successfully on all models. This project provides a library that can be used to determine the type of Pi in software.
NOTE: The Raspberry Pi units on this site run the Raspbian operating system. As a result, this library has only been tested running under the Raspbian version of the operating system. Potential users should also be aware that testing of the library is limited to a subset of models. As a result, the library made not successfully identify all models.
The library attempts to find a number of pieces of information about the Raspberry Pi based on information is extracted from the operating system:

(1) Hardware Revision
(2) CPU Features
(3) Raspberry Pi Serial Number

The library also extracts other information that is not made public, but the library can easily be modified to expose that additional information.