Raspberry PI and GPIO pins: What they are and practical uses can give them?

The pins GPIO (GGeneral Purpose Input Output) of the Raspberry PI allow us to work with electronics in an easy manner as we could also do it with Arduino.


First steps with the GPIO.

Are 26 PIN organized in two rows of 13, and each of the pins or has its specific function or is general purpose, I'm going to show the distribution of the pins of the Raspberry PI Rev 2.0, It is that I have.

As we can see in the following comparative picture of the two reviews, the second revision of the PI has two pins +5V, five of GROUND (grounding), two of +3,3V, eight pins General purpose GPIO, five SP10, two UART, and two pins I2C1.

Comparing different pinouts of the two versions of RPI.

By comparing the different pinout of two revisions of RPI.

In the new Raspberry PI A + and B + we have of 14 PIN GPIO more, ID_SD, ID_SC, three pins GND, and nine GPIO general purpose; allowing us to develop projects more large.

Pinout of Raspberry PI A + and B +, identical to the of the Rev. 2 but with more GPIO.

Pinout of Raspberry PI A + and B +, identical to the of the Rev. 2 but with more GPIO.

With them We can control electronic circuits, for example for moving motors or control the power-relay that will act as a switches for circuits of 220V.

These pins can configure and control directly from the interpreter's orders Bash, or from programming languages such as C o Python, Thanks to the libraries GPIO that they have implemented for them.

gpioprogramarIn my case I chose Python, since despite not having never programmed in this language, which will allow you to learn on the fly with you, It is one of those recommended to start programming.

Hello World in Python.

Hello World in Python.

Also I find it very interesting the possibility of executing the Scripts in Python that we write through an HTML button, What When depressed executes a function in PHP, What at the same time called to execute the Python Script

gpioprogramar0pngThis will allow us to manage our projects from the browser of any device using a Web application, so being able to get to implement automation solutions very economic, for example.

Web application in HTML + PHP + Python to handle a few Leds through the GPIO.

Web application in HTML + PHP + Python to handle a few Leds through the GPIO.

Now that we know that they are the pins GPIO and so they serve, in the next installment we will see a light introduction to the Basic electronics to finally mount a circuit as the following diagram, to turn on a diode Led and check that everything is ready and working properly, what I have called Hello World version GPIO.

Circuit needed to control the ignition of a LED diode.

Circuit needed to control the power of a LED diode.

If you like you can follow me on Twitter, Facebook, Google +, LinkedIn, or share it with the buttons under this publication, If you have any questions or suggestions please do not hesitate to comment.

Help us to reach more readers Share on LinkedIn
Share on Facebook
Tweet about this on Twitter
Share on Google+
Google +
Email this to someone

10 thoughts on"Raspberry PI and GPIO pins: What they are and practical uses can give them?

  1. Hello

    In the first version of the RPi, I think just a pin to + 5v, another for + 3.3V and one for GND. And people are plenty remain unused.

    I also think the GPIO pins to work at 3.3V.

    If you can confirm it…

    • Hi John, Thank you very much for your comment.

      What version you mean? I've added diagrams pinout from models A and B rev 1.0; as I explain in this article and many other tutorials, all GPIO pins that can act as inputs or outputs work at 3.3V and if you add them more voltage can burn your Raspberry.

      Then there are those in power that offer 3.3V, 5V and GND; and you should keep in mind that there are some GPIO pins with specific functions such as SPI buses, I2C…

      I hope to have cleared your doubts, see you soon.

  2. Hello and thanks for your post, My question is this…the raspberry allows the same control of sensors that an ardruino for example, the light sensor, the ultrasonic sensor, the temperature and humidity sensor, presence sensor or that sensors can be operated with rasberry?

    • Hello Andrew,

      With Raspberry PI can make use of all kinds of digital sensors that work to 3, 3V.

      With Arduino, you can use all types of digital and analog sensors that work to 5V.

      The difference is basically the accuracy of the sensors, as the analogue ones are more accurate, Since the voltage could always adapt.

  3. Hello, I have the raspberry pi b + and wants an engine but it does not work the code of the gpio with the b + and b If, using the same PIN

  4. The layout of the GPIO pins on both versions is not the same, so it won't work if you don't connect each cable in the corresponding model B + GPIO.

    You can check out the numbering in the diagrams of this article, and once can adapt it to the model B + also will work with Raspberry PI 2 Since the position has been.

    • Hi Alex, Thanks for your comment.

      For possible uses actual system or similar, It is clear that it should be securizarse as much as possible.

      The minimum would be to configure Apache a password to access the website, secure all the services of each machine that compose the system, measures such as IPTables-based firewall, an IDS/NIDS, Port Knocking, Fail2Ban… tunnel flow streaming so that it will not clear, and an infinite number of measures that are available to you.

      Total security does not exist, but the more difficult we make it chances we have if not the white chosen.

Leave a Reply