We know that there are two types of Raspberry Pi’s on the market. The Model A and Model B, with the last one to be the first widely available on the market (somewhere around 2012). It is easy to differentiate the two of those by just looking at them. For example here is an abstract graphic of the Model B (photos from www.raspberrypi.org)
and here is the Model A version
The problem is how to differentiate the revisions of those models, not the models themselves! For example the first Model B on the market was the one with the 256MB of RAM and the second revision double this amount or RAM. But the biggest problem for someone that is playing and developing peripherals is the changes on the GPIO port. For a full list of changes and improvements have a look here
Ok, so far! We know that there are some changes (more like improvements) but how we can look which revision board we have? To my knowledge there are two methods to do that. The first one is by using a simple command on the terminal and the second one is using the RPi.GPIO Python library.
Using the terminal command
Open a terminal window with your Raspberry Pi and type:
You will presented with some data that most of those will make a little bit os sense. Something like the ones below
Near the bottom is the revision of our board. Revision: 000e. This is not making any sense at lest on the first site. In order to decode this we can have a look on the elinux page here. This 000e code is translate to a Model B Raspberry Pi with 512MB of RAM, on a 2.0 PCB and is manufactured by Sony in the UK.
Using the RPi.GPIO library
The second method is with the GPIO Python library. This is build in to almost all the new Raspbain distributions. To find the revision of the board we can use the a live Python session by typing:
import RPi.GPIO as GPIO
The answer will be a single number like 2 for example, meaning revision 2.
This is enough for anyone that wants a clear answer for the GPIO pins configuration but is not giving us info like the architecture, the variant, CPU revision etc. Honestly, I don’t think that any regular user (or even an advanced one) will need more feedback than the simple number the RPi.GPIO will give