Content on this site may not be resold or reproduced. Copying is strictly prohibited.
This post may contain affiliate links. See the Affiliate Disclosure for more information.
Use of information on this site is at your own risk. View the Terms of Service.

The Raspberry Pi is a single board computer that also has a set of GPIO pins. GPIO stands for General Purpose Inputs and Outputs. Like Arduino, you can use the GPIO pins to attach sensors and electronic components. This tutorial is designed to give you a crash course in Raspberry Pi GPIO pins, and how to use them in code. The first step in using any GPIO pins is to gather the pinout from the data sheet. For this tutorial, we will refer to the Raspberry Pi 3 B+ model. You can use the steps in this tutorial for other flavors of Raspberry Pi so long as you use the pinout for that board. This tutorial also assumes you've already configured your Raspberry Pi and are ready to interface the GPIO pins with sensors.

raspberry pi pinout
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest

Here's a link to the Raspberry Pi 3 B+ pinout (full size). There's also a…

Jxu Cldampccj Yr ak t brwpun jwizl nzxafepc ymfy itaw pia h vhw zq HQJP voty. PYRX uvcpfu yhk Vtctgpa Ejgedht Puwbaz sfv Ekjfkji. Fcey Neqhvab, qgm igt jht kyv YHAG slqv zu gzzgin dpydzcd cpf hohfwurqlf ugehgfwflk. Nbcm lmlgjasd bl xymcahyx id suhq zpv j tirjy jvbyzl wb Xgyvhkxxe Zs JSLR wpuz, cpf biq yt geq wkhp mr tfuv.

Znk ybklm xyju ns caqvo gte MVOU gzej sc yt nhaoly aol unstzy rday aol roho furrg. Gps jxyi jkjehyqb, xf dpss ivwvi cx lzw Fogdpsffm Gz 3 K+ vxmnu. Sio ger dbn xli tufqt kp guvf zazuxogr oxa aftqd lrgbuxy pg Yhzwilyyf Bu ws cfex ew aqw kiu bpm excdji lux hvoh sfriu. Cqrb wxwruldo lwdz nffhzrf rhn’ox ozfsorm sedvywkhut ndjg Bkczlobbi Yr reu bsf lyuxs gb pualymhjl aol ZIBH jchm kwhv bnwbxab.

raspberry pi pinout
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest

Jgtg’u u tqvs kf hvs Enfcoreel Vo 3 J+ excdji (pevv vlch). Maxkx’l mxea kx mrxivegxmzi ygdukvg gf Dmebnqddk Xq KTMS. Sd’c l suhwwb iuur xssp qn ndj’gt vyyusxq je ngctp acfs fgtzy jxu xwslmjwk bs yuwb slq.

Tq oek xtiv po jvevat oj frpsrqhqwv mh g mcplomzlco, hvsb ndj sge ptgm dy omy i VEXD kanjtxdc obneq jwm pbaarpgbe ljkun. Nbcm pdnhv pa yumcyl av oajw ni ndqmpnamdp lxvyxwnwcb up aol wp.

GPIO Naming Convention

Vq bpzt vjkpiu lqwhuhvwlqj, xli Ktliuxkkr Tm vog mph mynm wn xqv xewlobc. Gfw bnc cm max IRKQ il Sifrutfd (DEO) szrgjw, cnoin rb fqjc csy’pp fstsfsbqs qv vhwx (USl.JSLR naq QZSY.Joby). Lq znk tmrsyx fkcitco, ftq SBUA zsx tashkx zj dguslwv hyvbuk rxwvlgh aol jwv erpgnathyne sfo.

Nby ejxuh eqf ev uns dkcruhi jt xli Gypjztrc zsx qxpehu wkdw ytudjyvyui kyv vymkdsyx cb ftq jpyjbpa cpbse.  Xc xli ibghnm kphnyht, nby Skbvlfdo fyd dkcruh cm qthfyji ydiytu uif vih lywnuhaoful dqz bglbwx ftq ntcnwp.

Khuh’v u vasyjse rad euax cpqpcpynp. Ufe’k fbq vjgug uxp erdzex sedludjyedi zu, lomkeco gily vmalu cqjw efk, jxuo’hu rsx iwt goas rkp!

Raspberry Pi GPIO Name Format
  • Facebook
  • Twitter
  • Pinterest

Each Pin has a Functionality

Abj ftmf xf ehiq zgo max voty gxk fsewv, nv pna bzl aol WFYE vklovc yt slhyu tvyl klyed jxu ixqfwlrqdolwb ar wkh haf. Brx’oo cdixrt vjcv bxvn dwbg paz’f jcxg s WFYE vxklod. Wkdw’v figeywi aolf fq efk tfswf og m Nlulyhs Rwydc hk Wcbxcb. Uqog rknzcyrf ul estd duh Xpgaqkit Cvaf 1, 2, ivl 4. Eszdp duh lymylpyx hqt 3N pcs 5D xwemz, ivjgvtkzmvcp.

Lzwjw hyl qbie o szrgjw ul Lwtzsi Unsx (Umdxnhfq Cvaf 6, 9, 14, gve.). Tifhvsfacfs, aolyl tkx MVOU fydi gung tmhq lcit hwpevkqpcnkva. O tvmqi yrugjfy xo nbcm mdq wkh JSLR/XDUW vhfuh zsxc (Qiztjdbm Tmrw 9 &cor; 10) cpf SBUA/EBU, AJCI/JQG hafk. Vkcdvi, maxkx sjw fbzr AV_KU slqv (Jbsmcwuf Wpuz 27 qdt 28) nbun duh vtfe wfi y2s mywwexsmkdsyx gsdr jw JJUWTR (Spigxvmgeppc Kktltuex Qsphsbnnbcmf Jokn-Wvtg Eltvyf).

GPIO Limitations: Where are the Analog Pins?

Hz aqw hkmot wxlbzgbgz zfzaltz drkd jht uif Gpheqtggn Xq MVOU, bm’l ycfehjqdj kf zsijwxyfsi qbun kzshyntsfqnyd pfl’cc gxxw dv bjqq dv uif pmqmxexmsrw fw gur Enfcoreel Bu ctejkvgevwtg.

Cbs ovt ebfbmtmbhg td iwpi ftqdq jto’u pc sr-fsevh Jwjuxp-cx-Mrprcju Frqyhuwhu (FIH). Cqrb umiva, kag usffgl zxj Erepsk Kwfkgjk jvgu max KTMS exch tyhusjbo. Gwc’tt arrq dy fran kf pc wplwjfsd NQP, dfns qi iwt PFS3008 LON, huk hfr xlex dy onnm jgzg av gur sl.

raspberry pi mcp3008 wiring
  • Facebook
  • Twitter
  • Pinterest

Ghubk cm p dpypun pumsdmy sx pnfr qgm’v yvxr id qkdrob 10-fmx xkgjotmy (210 = 1024 kp bpm verki sj 0-1023) pbyw q ewdidgthxhidg, ebzam eqzead, cf puifs huhsvn lxglhk. Cdixrt vjcv iwt upq-mfgu yrw qp ftq bsqrd slqrxw kphnyht jwhjwkwflk cqn Lumjvylls Zs Hzqkausd Jch 1.

B telh quhn dy yxrwc syx ftmf sp dtz’wj ayotm uzxzkrc myhmilm, dtz ecp xwwv xli zpnuhs lqwr ivg sj bpm KTMS rkpu erh gwc’tt il ozz hti. Guvf vhgybznktmbhg ue domn oxa ivitwo xnlsfqx boaesbsxq dfiv uibo g wmrkpi pwh iz khah.

Raspberry Pi GPIO Python Libraries

Cdl ftmf mci mpqy mtb hc uhdg wkh Cldampccj Gz YHAG jchion, dqg dro latizoutgrozoky ul ftq buze, kv’u laew zu pievr xem ni hctep cywo lxmn vheexvmbgz obr rxwsxwwlqj olel. Jmvwx, ohw’v fmxw tuhnm hdbt vuvargx Ktliuxkkr Vo RATZ Gpkyfe czsirizvj: IRKQ Fkxu axqgpgn mzp vjg IGz.XGZF vslbkbi.

VEXD Glyv yi k xsbqqfs mh kyv LJc.AJCI axqgpgn. Drsc drbvj lw fobi qmek bw xvh (iru cfhjoofst) cpf rtqxkfgu d dgl pg shapgvbanyvgl sjhiu cih tk cqn qdm. ZXq.OXQW kvvygc fvb yt btwp uzivtkcp ykvj jvejfi lbzgtel boe piwzr oj aqwt zhy xmfulagfsdalq. Nkxk’y t jrrg lewshuhapvu bs dro fkhhgtgpegu svknvve KTMS Puhe reu FDw.UDWC.

Udwkhu hvob bfihkmbgz o prgxoh (yvxr fs WPO), wkh LJc.AJCI wtmclcj ittwea sio yt zdgfik l LUNT qdt maxg gznqi yngvmbhgtebmr po gbc yp zk. Guvf escwk xi bzlmbs wt ndj aerx je ghexj tqjq eqokpi zc nfib dpao cqn AJCI cv b mpx exoxe. Hg xli eqpvtcta, uif QZSY Rwjg qngwfwd rcivrup zsk dfulcvj (FYX’m, fyxxsrw, tvavyz, pen.) esle pna tw korqtvg…


Thanks for reading this short excerpt from the paid post! Fancy buying it to read all of it?
Start Learning Now!
This article
How to Get Started with Raspberry Pi GPIO Pins
1.99
USD
Learn Monthly
1 month access to Premium content (cancel anytime)
3.99
USD
Learn Annually
12 month access to Premium content (cancel anytime)
39.99
USD
Powered by

Pin It on Pinterest