{"id":29611,"date":"2020-02-19T20:42:57","date_gmt":"2020-02-19T12:42:57","guid":{"rendered":"\/blog\/?p=29611"},"modified":"2022-04-18T18:06:57","modified_gmt":"2022-04-18T10:06:57","slug":"how-to-use-raspberry-pi-gpio-pins-python-tutorial","status":"publish","type":"post","link":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/","title":{"rendered":"How to Use Raspberry Pi GPIO Pins &#8211; Python Tutorial"},"content":{"rendered":"\n<p>Whether it&#8217;s the Raspberry Pi 3, 4 or the tiny Raspberry Pi Zero, GPIO pins have always been a staple feature of our favourite single board computer (SBC), the RPi. However, do you know about its functionality and how to use it to create real world projects? In today&#8217;s tutorial, we will show you how to get started with the world of physical computing and GPIO through Python programming!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Today&#8217;s Raspberry Pi GPIO tutorial will cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What is GPIO and how does it work?<\/li><li>Explaining the Raspberry Pi GPIO Pinout<\/li><li>Configuring GPIO pins &amp; Communication Protocols (SPI, I2C)<\/li><li>Raspberry Pi GPIO Tutorial with Grove &amp; Python<\/li><li>Raspberry Pi GPIO Projects<\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is GPIO and How does it work?<\/strong><\/h2>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>GPIO, short for General Purpose Input Output is a standard interface found on microcontrollers and SBCs that enables digital input and output. It allows these devices to control external components like motors &amp; infrared transmitters (output), as well as to receive data from sensor modules and switches (input). In essence, GPIO allows our Raspberry Pi to interface with a variety of external components, which makes it suitable for a wide variety of projects ranging from a weather station to a self-driving robot.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"450\" height=\"354\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/02\/image-30.png\" alt=\"\" class=\"wp-image-29615\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/image-30.png 450w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/image-30-300x236.png 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-4-Computer-Model-B-4GB-p-4077.html?utm_source=blog&amp;utm_medium=blog\">Raspberry Pi 4 <\/a>40 Pin GPIO Header<\/figcaption><\/figure><\/div>\n\n\n\n<p>For GPIO pins to work, software configurations will be required. Fret not, for beginner-friendly Python libraries such as <a href=\"https:\/\/gpiozero.readthedocs.io\/\">GPIOzero <\/a>are available to make physical computing more accessible for all users. For more experienced programmers who prefer C or C++, GPIO access libraries such as <a href=\"http:\/\/wiringpi.com\/\">wiringPI<\/a> are also available!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Explaining the Raspberry Pi GPIO Pinout<\/h2>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If you&#8217;re using the Raspberry Pi B+, 2 , 3, Zero or the latest Raspberry Pi 4 Model B, you&#8217;ll find a total of 40 GPIO pins on your RPi&#8217;s GPIO header. Older iterations of the RPI, such as the Raspberry Pi Model B, will only contain a total of 26pins. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1030\" height=\"591\" src=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-1030x591.png\" alt=\"\" class=\"wp-image-63162\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-1030x591.png 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-300x172.png 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-768x441.png 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-1536x882.png 1536w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-2048x1176.png 2048w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/GPIO-Pinout-Diagram-2-1024x588.png 1024w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><figcaption>Source: <a href=\"https:\/\/www.raspberrypi.org\/documentation\/usage\/gpio\/\">Raspberry Pi Foundation<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p>Each of the pins on the 40 Pin header have a designated purpose. The different types are described in the table below.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<style type=\"text\/css\">\n.tg  {border-collapse:collapse;border-spacing:0;}\n.tg td{font-family:Source Sans, sans-serif;font-size:16px;padding:15px 15px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}\n.tg th{font-family:Source Sans, sans-serif;font-size:16px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}\n.tg .tg-cly1{text-align:left;vertical-align:middle}\n.tg .tg-1wig{font-weight:bold;text-align:center;vertical-align:middle}\n.tg .tg-yla0{font-weight:bold;text-align:center;vertical-align:middle}\n.tg .tg-0lax{text-align:left;vertical-align:middle}\n<\/style>\n<table class=\"tg\">\n  <tbody><tr>\n    <th class=\"tg-yla0\">GPIO Pin Type<\/th>\n    <th class=\"tg-yla0\">Pin Functionality and Explanation<\/th>\n  <\/tr>\n  <tr>\n    <td class=\"tg-yla0\">GPIO <\/td>\n    <td class=\"tg-cly1\">GPIO pins are standard general-purpose pins that can be used for turning external devices, such as an LED, on or off.<\/td>\n  <\/tr>\n  <tr>\n    <td class=\"tg-yla0\">Power<\/td>\n    <td class=\"tg-cly1\">5V and 3V3 pins are used to supply 5V and 3.3V power to external components.<\/td>\n  <\/tr>\n  <tr>\n    <td class=\"tg-1wig\">I2C<\/td>\n    <td class=\"tg-0lax\">I2C pins are used for connecting and hardware communication purposes with I2C compatible external modules.<\/td>\n  <\/tr>\n  <tr>\n    <td class=\"tg-1wig\">SPI <\/td>\n    <td class=\"tg-0lax\">SPI (Serial Peripheral Interface Bus) pins are also used for hardware communication, but with a different protocol.<\/td>\n  <\/tr>\n  <tr>\n    <td class=\"tg-1wig\">UART<\/td>\n    <td class=\"tg-0lax\">UART (Universal Asynchronous Receiver \/ Transmitter) pins are used for serial communication.<\/td>\n  <\/tr>\n  <tr>\n    <td class=\"tg-1wig\">DNC<\/td>\n    <td class=\"tg-0lax\">Use of DNC (Do Not Connect) pins should be avoided.<\/td>\n  <\/tr>\n  <tr>\n    <td class=\"tg-1wig\">GND<\/td>\n    <td class=\"tg-0lax\">GND (Ground) pins refer to pins that provide electrical grounding in your circuits.<\/td>\n  <\/tr>\n<\/tbody><\/table>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>For more information on the differences between and uses of PWM, I2C, SPI, UART protocols, please refer to the following resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/16\/basic-electronics-pulse-width-modulationpwm-and-arduino-applications\/\">What is Pulse Width Modulation (PWM)? Applications and Accessories<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2019\/09\/25\/uart-vs-i2c-vs-spi-communication-protocols-and-uses\/\">UART vs I2C vs SPI \u2013 Communication Protocols and Uses<\/a><\/li><li><a href=\"http:\/\/I2C Communication \u2013 All about I\u00b2C with Diagrams\">I2C Communication \u2013 All about I\u00b2C with Diagrams<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Configure Raspberry Pi GPIO, I2C, and SPI Pins<\/h2>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Now that we know more about the Raspberry Pi&#8217;s GPIO, it&#8217;s time to get started with physical computing! Similar to other electrical components, we first have to configure the GPIO pins before using them. The configuration guide below will be run on Raspberry Pi OS.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Configuring GPIO<\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If you&#8217;re running the latest version of Raspberry Pi OS, you can skip these steps and get straight into programming with GPIO!<\/p>\n\n\n\n<p>Otherwise, you&#8217;ll have to run the following commands in the serial terminal to update your RPI:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get upgrade<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If for any reason you don&#8217;t have the GPIO package installed, you can run the following command for installation:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install rpi.gpio<\/code><\/pre>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Configuring Raspberry Pi I2C \/ SPI Pins<\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To enable I2C or SPI for hardware communication, we&#8217;ll use the Raspi-Config tool by entering the following command:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo raspi-config<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In the menu that shows up, navigate to <em>Advanced Options<\/em> &gt; <em>I2C<\/em> and select yes. For SPI, navigate to <em>Advanced Options<\/em> &gt; <em>SPI<\/em> instead. Once complete, reboot your RPi and your I2C pins will be enabled. To ensure that I2C communication is working properly with your RPi, connect your modules and enter the command below:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>lsmod | grep i2c_<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>For SPI, run the following command instead:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>lsmod | grep spi_<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In each case, the command line should then return a list indicating the modules that you&#8217;re running through the I2C \/ SPI pins.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Essential Products for Raspberry Pi GPIO<\/h2>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Before we move on to how you can program the Raspberry Pi&#8217;s GPIO pins with Python, here are some necessities that we recommend.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/www.seeedstudio.com\/Grove-Base-Hat-for-Raspberry-Pi.html\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Grove Base Hat for Raspberry Pi<\/strong><\/a><\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The Grove Base Hat extends the capabilities of the Raspberry Pi by introducing 15 Grove connectors in addition to the original 40 GPIO pins. Grove is a modular, standardised connector system that allows for quick and convenient electronics prototyping by eliminating the need for jumper wires or solder.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2021\/03\/httpsstatics3.seeedstudio.comseeedfile2018-11bazaar975950_perspective-1030x773.jpg\" alt=\"\" class=\"wp-image-41198\" width=\"500\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/03\/httpsstatics3.seeedstudio.comseeedfile2018-11bazaar975950_perspective-1030x773.jpg 1030w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/03\/httpsstatics3.seeedstudio.comseeedfile2018-11bazaar975950_perspective-300x225.jpg 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/03\/httpsstatics3.seeedstudio.comseeedfile2018-11bazaar975950_perspective-768x576.jpg 768w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/03\/httpsstatics3.seeedstudio.comseeedfile2018-11bazaar975950_perspective-1024x768.jpg 1024w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2021\/03\/httpsstatics3.seeedstudio.comseeedfile2018-11bazaar975950_perspective.jpg 1400w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><figcaption>Grove Base Hat for Raspberry Pi<\/figcaption><\/figure><\/div>\n\n\n\n<p>With the Grove Base Hat, the Raspberry Pi gains access to the extensive Grove ecosystem with over 300+ sensors, actuators and communication modules. Thanks to the libraries and detailed documentation that come with Grove, getting started with building projects using Raspberry Pi GPIO has become easier than ever!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-A-B-2-40pin-to-26pin-GPIO-Board-p-2190.html?utm_source=blog&amp;utm_medium=blog\" target=\"_blank\" rel=\"noreferrer noopener\"><strong><strong>Raspberry Pi 40pin to 26pin GPIO Board<\/strong><\/strong><\/a><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If you have older accessories for the Raspberry Pi that were built for the original 26-Pin configuration, this 40-Pin to 26-Pin GPIO conversion board is going to be a true necessity for you.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/9d0ce51a71ce6a79dfa2a98d65a0f0bd\/h\/t\/httpsstatics3.seeedstudio.comimagesproduct114990109201.jpg\" alt=\"\" width=\"586\" height=\"391\"\/><\/figure><\/div>\n\n\n\n<p>This GPIO board converts the 40-Pin header on newer Raspberry Pi models into the original 26-Pin layout, so you can continue to use your existing Raspberry Pi accessories. If you&#8217;re interested to find out more about this module, please click <a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-A-B-2-40pin-to-26pin-GPIO-Board-p-2190.html?utm_source=blog&amp;utm_medium=blog\">here<\/a>.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to <\/strong>program Raspberry Pi GPIO Pins with Python?<\/h2>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>What\u2019s unique of running Python on Raspberry Pi instead of the typical PC is that you can run codes specifically to control hardware components through its GPIO pins! In today\u2019s tutorial, we&#8217;ll learn how to use GPIO to blink an LED.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">You\u2019ll need the following hardware components:<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Raspberry Pi 4 (<a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-4-Computer-Model-B-4GB-p-4077.html?utm_source=blog&amp;utm_medium=blog\">4GB<\/a> \/ <a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-4-Computer-Model-B-8GB-p-4595.html\">8GB<\/a>)<\/li><li><a href=\"https:\/\/www.seeedstudio.com\/Grove-Base-Hat-for-Raspberry-Pi.html\">Grove Base Hat for Raspberry Pi<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/Grove-Purple-LED-3mm.html\">Grove &#8211; Purple LED (3mm)<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hardware Assembly and Configuration<\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li>Plug the Grove Base Hat into Raspberry Pi<\/li><li>Select any GPIO port on the Base Hat and connect the Purple LED to it<\/li><li>Connect the Raspberry Pi to PC through USB cable<\/li><\/ol>\n\n\n\n<p>For step 2, you can connect it to the Grove Port as well, which would result in the pairing to look like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/SeeedDocument\/Grove-Red_LED\/raw\/master\/img\/BaseHat_LED.jpg\" alt=\"\" width=\"573\" height=\"438\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Software Configurations with Python<\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Step 1:<\/strong> Ensure that your development environment is up to date. This should have been done in our earlier steps.<\/p>\n\n\n\n<p><strong>Step 2: <\/strong>Next, download the source file by cloning the grove.py library with the following commands.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\ngit clone https:\/\/github.com\/Seeed-Studio\/grove.py<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Step 3:<\/strong>&nbsp;Execute the following command. Take note to replace <em>port_number<\/em> with the GPIO port number that your LED is connected to.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>cd .\/grove.py\/grove\npython grove_led.py <em>port_number<\/em><\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If your port number is 12, your command should look like this:<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>cd .\/grove.py\/grove\npython grove_led.py 12<\/code><\/pre>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>That&#8217;s it! You should now be able to see the LED blink!<\/strong><\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Raspberry Pi GPIO Projects<\/strong><\/h2>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Now that you&#8217;ve seen how easy it is to get started with Raspberry Pi GPIO using Grove, we couldn&#8217;t possibly leave you hanging without some project recommendations, could we? With a plethora of projects available thanks to the endless possibilities that GPIO pins offer, I&#8217;ll just be providing a few of my favourites today! For a comprehensive list of Raspberry Pi Projects, click <a href=\"https:\/\/www.seeedstudio.com\/blog\/2019\/09\/29\/top-20-best-raspberry-pi-4-projects-that-you-must-try-now\/\">here<\/a>!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.  Raspberry Pi Monitor<\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/e76fj-hkvsj-001.jpg\" alt=\"\" class=\"wp-image-63402\" width=\"397\" height=\"297\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/e76fj-hkvsj-001.jpg 900w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/e76fj-hkvsj-001-300x225.jpg 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2022\/04\/e76fj-hkvsj-001-768x575.jpg 768w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Want to build a helpful monitor that reports real-time CPU performance, temperature, RAM usage, and other useful information using Raspberry Pi.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"> <strong>Hardware &amp; Software Needed<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-4-Computer-Model-B-8GB-p-4595.html\" target=\"_blank\" rel=\"noreferrer noopener\">Raspberry Pi Model 4<\/a><\/li><li><a href=\"https:\/\/www.hackster.io\/breadboard-mates\/products\/timi-130?ref=project-5d251f\">Breadboard Mates TIMI-130<\/a><\/li><li><a href=\"https:\/\/www.hackster.io\/breadboard-mates\/products\/pi-adaptor?ref=project-5d251f\">Breadboard Mates Pi Adaptor<\/a><\/li><li><a href=\"https:\/\/www.hackster.io\/breadboard-mates\/products\/mates-programmer?ref=project-5d251f\">Breadboard Mates Mates Programmer<\/a><\/li><li><a href=\"https:\/\/www.raspberrypi.com\/software\/\">Raspberry Pi OS<\/a><\/li><li>Python3 (built into Raspberry Pi OS)<\/li><li><a href=\"https:\/\/breadboardmates.com\/products\/mates-studio\/\">Breadboard Mates Studio<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Want to know more about this project? Check out the full tutorial on Hackster by <a href=\"https:\/\/www.hackster.io\/breadboard-mates\/raspberry-pi-monitor-5d251f\" target=\"_blank\" rel=\"noreferrer noopener\">Team Breadboard Mates<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.  Raspberry Pi Smart Clock<\/strong><\/h3>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hackster.imgix.net\/uploads\/attachments\/502747\/FTKU1Q0JIEU13I8.png?auto=compress%2Cformat&amp;w=900&amp;h=675&amp;fit=min\" alt=\"\" width=\"379\" height=\"284\"\/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Want to build a smart clock with your Raspberry Pi that shows time on an OLED display? This project not only does that but also reads out the time to you at different intervals! All software configurations are done with Python.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hardware &amp; Software Needed<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-3-Model-B-p-2625.html?utm_source=blog&amp;utm_medium=blog\">Raspberry Pi 3 Model B<\/a><\/li><li>RGB Diffused Common Cathode<\/li><li>Speaker: 0.25W, 8 ohms<\/li><li><a href=\"https:\/\/www.seeedstudio.com\/Breadboard-Jumper-Wire-Set-140-PCs-Pac-p-1562.html?utm_source=blog&amp;utm_medium=blog\">Jumper Wires (Generic)<\/a><\/li><li>Raspberry Pi OS on Raspberry Pi<\/li><li>Python GPIO Library installed on the RPi<\/li><li>Python SSD OLED Library<\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Interested to find out more? Visit the <a href=\"https:\/\/www.hackster.io\/ashwini-kumar-sinha\/raspberry-pi-clock-94f011\">full tutorial with Python Code<\/a> by Ashwini Kumr Sinha on Hackster!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.  Raspberry Pi Driven Robot Arm<\/strong><\/h3>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video controls src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2021\/03\/\u673a\u68b0\u81c2GIF20190709_164446.gif.mp4\"><\/video><\/figure>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>This really cool project was developed by our Seeed R&amp;D team. By using the 3D Gesture Tracking Shield that interfaces with the Raspberry Pi via its GPIO header, you can control a robot arm for picking up objects!<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hardware &amp; Software Needed<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-3-Model-B-p-2625.html\">Raspberry Pi 3B+<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/3D-Gesture-Tracking-Shield-for-Raspberry-Pi-MGC3130-p-4073.html\">Seeed 3D Gesture &amp; Tracking Shield for Raspberry Pi (MGC3130)<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/uArm-metal-p-2196.html\">Seeed uArm metal<\/a><\/li><li>Raspberry Pi OS on Raspberry Pi<\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Want to learn more more? Check out the <a href=\"https:\/\/project.seeedstudio.com\/SeeedStudio\/seeed-e-ink-raspberry-calendar-24dc09\">full tutorial by Seeed on Hackster<\/a>!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.  Smart Raspberry Pi Fan Control<\/strong><\/h3>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hackster.imgix.net\/uploads\/attachments\/1013490\/_p4aNCfhhTk.blob?auto=compress%2Cformat&amp;w=900&amp;h=675&amp;fit=min\" alt=\"\" width=\"381\" height=\"286\"\/><\/figure><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Worry about the thermal issues present in the Rasberry Pi 4, yet only want the fans to turn on when the processor really needs it? This project implements a Python script to adjust fan speeds based on the RPi&#8217;s CPU temperatures! Now you can cool your Raspberry Pi and learn Python at the same time!<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hardware &amp; Software Needed<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/Raspberry-Pi-4-Computer-Model-B-4GB-p-4077.html?utm_source=blog&amp;utm_medium=blog\">Raspberry Pi 4 Computer Model B 4GB<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/Armor-Aluminum-Metal-Case-with-Dual-Fans-for-Raspberry-Pi-Support-Pi-4-p-4318.html?utm_source=blog&amp;utm_medium=blog\">Seeed Armor Aluminum Metal Case with Dual Fans for Raspberry Pi<\/a><\/li><li>General Purpose Transistor NPN<\/li><li><a href=\"https:\/\/www.seeedstudio.com\/RESK-Resistor-Kit-p-1484.html?utm_source=blog&amp;utm_medium=blog\">Resistor 330 ohm<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/400-Point-Solderless-Breadboard-p-4405.html?utm_source=blog&amp;utm_medium=blog\">Breadboard <\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/Breadboard-Jumper-Wire-Set-140-PCs-Pac-p-1562.html?utm_source=blog&amp;utm_medium=blog\">Jumper wires<\/a><\/li><li><a href=\"https:\/\/github.com\/iobridge\/ThingSpeak\">ThingSpeak API<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Interested to find out more? You can check out the <a href=\"https:\/\/www.hackster.io\/shahizat005\/smart-control-of-raspberry-pi-fan-using-python-thingspeak-4841b2\">full tutorial by Nurgaliyev Shakhizat<\/a> on Hackster!<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>That wraps up today&#8217;s guide on how to use the Raspberry Pi&#8217;s GPIO PINs with Python! I hope you&#8217;ve gotten a better understanding of the different uses of GPIO and how to use it to interface with sensors and modules for building your own electronics projects.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>For more Raspberry Pi resources, please visit the following links:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/01\/25\/three-methods-to-configure-raspberry-pi-wifi\/\">How To: 3 Methods to Configure Raspberry Pi WiFi<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/11\/28-raspberry-pi-linux-commands-a-quick-guide-to-use-the-command-line-for-raspberry-pi-m\/\">28 Raspberry Pi Linux Commands: A Quick Guide to Use the Command Line for Raspberry Pi<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/05\/build-a-raspberry-pi-security-camera-using-raspberry-pi-camera\/\">Build a Raspberry Pi Security Camera using Raspberry Pi Camera!<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2021\/02\/04\/raspberry-pi-line-following-robot\/\">Build a Raspberry Pi Line Following Robot!<\/a><\/li><li><a href=\"https:\/\/www.seeedstudio.com\/blog\/2019\/09\/29\/top-20-best-raspberry-pi-4-projects-that-you-must-try-now\/\">Top 35 Raspberry Pi 4 Projects That You Must Try Now<\/a><\/li><\/ul>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Whether it&#8217;s the Raspberry Pi 3, 4 or the tiny Raspberry Pi Zero, GPIO pins<\/p>\n","protected":false},"author":2850,"featured_media":29619,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[2910,247,1450],"class_list":["post-29611","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-gpio-pins","tag-raspberry-pi","tag-raspberry-pi-4"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Raspberry Pi GPIO Pins - Python Tutorial - Latest News from Seeed Studio<\/title>\n<meta name=\"description\" content=\"Learn all about physical computing with Raspberry Pi GPIO and Python programming, from concepts to configuration to project recommendations!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Raspberry Pi GPIO Pins - Python Tutorial - Latest News from Seeed Studio\" \/>\n<meta property=\"og:description\" content=\"Learn all about physical computing with Raspberry Pi GPIO and Python programming, from concepts to configuration to project recommendations!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Latest News from Seeed Studio\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-19T12:42:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-18T10:06:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png\" \/>\n\t<meta property=\"og:image:width\" content=\"594\" \/>\n\t<meta property=\"og:image:height\" content=\"467\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Shawn\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shawn\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/\",\"name\":\"How to Use Raspberry Pi GPIO Pins - Python Tutorial - Latest News from Seeed Studio\",\"isPartOf\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png\",\"datePublished\":\"2020-02-19T12:42:57+00:00\",\"dateModified\":\"2022-04-18T10:06:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2\"},\"description\":\"Learn all about physical computing with Raspberry Pi GPIO and Python programming, from concepts to configuration to project recommendations!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#primaryimage\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png\",\"contentUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png\",\"width\":594,\"height\":467,\"caption\":\"A guide to Raspberry Pi GPIO Pins with Python tutorial\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seeedstudio.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Raspberry Pi GPIO Pins &#8211; Python Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/\",\"name\":\"Latest News from Seeed Studio\",\"description\":\"Emerging IoT, AI and Autonomous Applications on the Edge\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2\",\"name\":\"Shawn\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g\",\"caption\":\"Shawn\"},\"url\":\"https:\/\/www.seeedstudio.com\/blog\/author\/shawn\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Raspberry Pi GPIO Pins - Python Tutorial - Latest News from Seeed Studio","description":"Learn all about physical computing with Raspberry Pi GPIO and Python programming, from concepts to configuration to project recommendations!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Raspberry Pi GPIO Pins - Python Tutorial - Latest News from Seeed Studio","og_description":"Learn all about physical computing with Raspberry Pi GPIO and Python programming, from concepts to configuration to project recommendations!","og_url":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/","og_site_name":"Latest News from Seeed Studio","article_published_time":"2020-02-19T12:42:57+00:00","article_modified_time":"2022-04-18T10:06:57+00:00","og_image":[{"width":594,"height":467,"url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png","type":"image\/png"}],"author":"Shawn","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Shawn","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/","url":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/","name":"How to Use Raspberry Pi GPIO Pins - Python Tutorial - Latest News from Seeed Studio","isPartOf":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png","datePublished":"2020-02-19T12:42:57+00:00","dateModified":"2022-04-18T10:06:57+00:00","author":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2"},"description":"Learn all about physical computing with Raspberry Pi GPIO and Python programming, from concepts to configuration to project recommendations!","breadcrumb":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#primaryimage","url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png","contentUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png","width":594,"height":467,"caption":"A guide to Raspberry Pi GPIO Pins with Python tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/02\/19\/how-to-use-raspberry-pi-gpio-pins-python-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seeedstudio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Raspberry Pi GPIO Pins &#8211; Python Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.seeedstudio.com\/blog\/#website","url":"https:\/\/www.seeedstudio.com\/blog\/","name":"Latest News from Seeed Studio","description":"Emerging IoT, AI and Autonomous Applications on the Edge","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/c9b61b761840d544e2d830b0e3bc9fe2","name":"Shawn","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5afdc71205d9d485de69bc4b192294e3?s=96&r=g","caption":"Shawn"},"url":"https:\/\/www.seeedstudio.com\/blog\/author\/shawn\/"}]}},"modified_by":"Kelvin","views":106232,"featured_image_urls":{"full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"thumbnail":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO-80x80.png",80,80,true],"medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO-300x236.png",300,236,true],"medium_large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"1536x1536":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"2048x2048":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"visody_icon":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",32,25,false],"magazine-7-slider-full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"magazine-7-slider-center":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"magazine-7-featured":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO.png",594,467,false],"magazine-7-medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO-594x380.png",594,380,true],"magazine-7-medium-square":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/02\/Raspberry-Pi-GPIO-594x450.png",594,450,true]},"author_info":{"display_name":"Shawn","author_link":"https:\/\/www.seeedstudio.com\/blog\/author\/shawn\/"},"category_info":"<a href=\"https:\/\/www.seeedstudio.com\/blog\/category\/news\/\" rel=\"category tag\">News<\/a>","tag_info":"News","comment_count":"1","_links":{"self":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/29611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/users\/2850"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/comments?post=29611"}],"version-history":[{"count":29,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/29611\/revisions"}],"predecessor-version":[{"id":63404,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/29611\/revisions\/63404"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media\/29619"}],"wp:attachment":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media?parent=29611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/categories?post=29611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/tags?post=29611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}