RPi Tutorial Easy GPIO Hardware & Software

From eLinux.org
Revision as of 11:35, 3 February 2012 by Tufty (talk | contribs)
Jump to: navigation, search

Back to the Hub.


Community Pages:

Tutorials - a list of tutorials. Learn by doing.

Guides - a list of informative guides. Make something useful.

Projects - a list of community projects. Help others out.

Tasks - for advanced users to collaborate on software tasks.

Datasheets - a frambozenier.org documentation project.

Education - a place to share your group's project and find useful learning sites.

Community - links to the community elsewhere on the web.

Games - all kinds of computer games.

Warnings

While most of these circuits may interface directly to the RPi, the use of a buffered interface (such as the one supplied by the Gertboard) is recommended which will help protect against damage. Alternatively, experiment with one of the #Alternative Test Platforms.


Extreme caution should be exercised when interfacing hardware at a low level, you may damage your RPi, your equipment and potentially yourself and others. Doing so is at your own risk!

Aims

This tutorial is based on this thread and aims to introduce basic circuits which can be used with the RPi's General Purpose Input/Output (GPIO). Basic electronics knowledge will be required (i.e. familiarity with typical discrete components such as transistors, diodes and resistors).

Useful Links/Resources

Alternative Test Platforms

Until you have a RPi to test with, there are many alternative platforms available which will allow the testing of basic circuits. In addition, they may be interfaced with directly using the RPi in the future.


TI LaunchPad - A low cost development platform ($4.30 including free world shipping). Includes programmer/debug board, two processors (with 16 GPIO including I2C/SPI/UART, 8ch 10bit ADC etc).


Arduino - Common hobbyist development platform. Excellent community support and additional hardware.


PICAXE[2]


STM32 Primer/EvoPrimer - Self-contained development platform. Mentioned since I may use one at some point (I bought the original Primer a long time ago). It includes a battery, acceleration sensors and built in display screen.


Planned Tutorials

Basic Circuits

1. LED output

Directly driven (will need very low powered LED) or driven via transistor (allowing higher current).


2. Small DC motor drive

MOSFET or Darlington Pair to provide high power drive and reverse bias diode to protect from motor coils.


3. Simple on/off switch input

With or without de-bouncing.


4. Analogue resistive sensor sampled as a digital input

Using a basic transistor switch circuit.


Intermediate Circuits

1. Shift Registers - Multiplexing Data

An introduction to using additional ICs. In this case, using a parallel to serial 8-bit shift register to read 8 digital inputs using two GPIO pins.


2. Analogue to Digital Circuit

Use of a ADC chip to sample inputs.


3. PWM Driving Circuit

For example motor speed control.


4. Alpha-numeric 2x16 LCD Display

Control via 4-wire data (total 6 GPIO) and also alternative 2-wire interface circuit.


Advanced Circuits

1. Control Hardware Over The Internet

Implement web control and monitoring of GPIO connected components.


Contributing to this tutorial

This is an open project so please feel welcome to add your own sections and improve its content.

Please see the Talk:RPi Tutorial Easy GPIO Hardware & Software page to discuss this page.
{"cc_re__cc_re__cc_by_sa_3_0": ["itle=RPi_Tutorial_Easy_GPIO_Hardware_%26_Software&amp;oldid=95522\" title=\"Permanent link to this revision of the page\">Permanent link</a></li><li id=\"t-info\"><a href=\"/index.php?title=RPi_Tutorial_Easy_GPIO_Hardware_%26_Software&amp;action=info\" title=\"More information about this page\">Page information</a></li>\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t\t\t</div>\n\t\t</div>\n\t\t\t\t<div id=\"footer\" role=\"contentinfo\">\n\t\t\t\t\t\t<ul id=\"footer-info\">\n\t\t\t\t\t\t\t\t<li id=\"footer-info-copyright\">Content is available under <a class=\"external\" rel=\"nofollow\" href=\"https://creativecommons.org/licenses/by-sa/3.0/\">a Creative Commons Attribution-ShareAlike 3.0 Unported License</a> unless otherwise noted.</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<ul id=\"footer-places\">\n\t\t\t\t\t\t\t\t<li id=\"footer-places-privacy\"><a href=\"/eLinux.org:Privacy_policy\" title=\"eLinux.org:Privacy policy\">Privacy policy</a></li>\n\t\t\t\t\t\t\t\t<li id=\"footer-places-about\"><a href=\"/eLinux.org:About\" title=\"eLinux.org:About\">About eLinux.org</a></li>\n\t\t\t\t\t\t\t\t<li id=\"footer-places-disclaimer\"><a href=\"/eLinux.org:General_disclaimer\" title=\"eLinux.org:General di", "\t\t\t\t\t\t\t\t<li id=\"footer-places-privacy\"><a href=\"/eLinux.org:Privacy_policy\" title=\"eLinux.org:Privacy policy\">Privacy policy</a></li>\n\t\t\t\t\t\t\t\t<li id=\"footer-places-about\"><a href=\"/eLinux.org:About\" title=\"eLinux.org:About\">About eLinux.org</a></li>\n\t\t\t\t\t\t\t\t<li id=\"footer-places-disclaimer\"><a href=\"/eLinux.org:General_disclaimer\" title=\"eLinux.org:General disclaimer\">Disclaimers</a></li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<ul id=\"footer-icons\" class=\"noprint\">\n\t\t\t\t\t\t\t\t\t\t<li id=\"footer-copyrightico\">\n\t\t\t\t\t\t<a href=\"https://creativecommons.org/licenses/by-sa/3.0/\"><img src=\"https://i.creativecommons.org/l/by-sa/3.0/88x31.png\" alt=\"a Creative Commons Attribution-ShareAlike 3.0 Unported License\" width=\"88\" height=\"31\"/></a>\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t<li id=\"footer-poweredbyico\">\n\t\t\t\t\t\t<a href=\"//www.mediawiki.org/\"><img src=\"/resources/assets/poweredby_mediawiki_88x31.png\" alt=\"Powered by MediaWiki\" srcset=\"/resources/assets/poweredby_mediawiki_132x47.png 1.5x, /resources/assets/poweredby_mediawiki_176x62.png 2x\" width=\"88\" height=\"31\"/></a>\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t</"], "copyright__copyright__copyright": [" example motor speed control.\n\n\n4. Alpha-numeric 2x16 LCD Display\n\nControl via 4-wire data (total 6 GPIO) and also alternative 2-wire interface circuit.\n\n\nAdvanced Circuits\n\n1. Control Hardware Over The Internet\n\nImplement web control and monitoring of GPIO connected components.\n\n\nContributing to this tutorial\n\nThis is an open project so please feel welcome to add your own sections and improve its content.\n\nPlease see the Talk:RPi Tutorial Easy GPIO Hardware & Software page to discuss this page.", " example motor speed control.\n\n\n4. Alpha-numeric 2x16 LCD Display\n\nControl via 4-wire data (total 6 GPIO) and also alternative 2-wire interface circuit.\n\n\nAdvanced Circuits\n\n1. Control Hardware Over The Internet\n\nImplement web control and monitoring of GPIO connected components.\n\n\nContributing to this tutorial\n\nThis is an open project so please feel welcome to add your own sections and improve its content.\n\nPlease see the Talk:RPi Tutorial Easy GPIO Hardware & Software page to discuss this page."]}