Physical computing - chaolunner/RaspberryPi GitHub Wiki

The Raspberry Pi is not just an exceptionally cheap computer. One of the main reasons the Raspberry Pi has become so popular is that it allows you to start exploring the world of physical computing.

What is physical computing?

The Raspberry Pi has two rows of pins called General-Purpose Input/Output pins, or GPIO pins. What's special about these pins is that you can control them using software. You can make some of the pins output around 3 volts, or have them detect when they're connected to around 3 volts. This may not sound very exciting until you realise that this simple command has a huge range of applications, from turning on LEDs and detecting button pushes, to creating remote-controlled robots and home automation systems.

Physical Computing with Python

What you will need

  • Hardware

    As well as a Raspberry Pi with an SD card and the usual peripherals, you’ll also need:

    ... ... ... ...
    1x Solderless breadboard Male-to-female jumper leads Female-to-female jumper leads Male-to-male jumper leads
    [https://github.com/chaolunner/RaspberryPi/wiki/images/breadboard.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/jumper-male-to-female.png) [https://github.com/chaolunner/RaspberryPi/wiki/images/jumper-female-to-female.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/jumper-male-to-male.png)
    1x Tactile button 3x LEDs Ultrasonic distance sensor Passive infrared motion sensor
    [https://github.com/chaolunner/RaspberryPi/wiki/images/tactile-push-button.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/led.png) [https://github.com/chaolunner/RaspberryPi/wiki/images/ultrasonic-distance-sensor.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/pir.png)
    Light Dependent Resistor 2x 5V Micro Metal Gearmotor 3x 330Ω Resistor 470Ω Resistor
    [https://github.com/chaolunner/RaspberryPi/wiki/images/ldr.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/motor.png) [https://github.com/chaolunner/RaspberryPi/wiki/images/resistor-330r.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/resistor-470r.png)
    1x 1μF Capacitor Buzzer Motor Controller Battery Pack
    [https://github.com/chaolunner/RaspberryPi/wiki/images/capacitor.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/piezo-buzzer.png) [https://github.com/chaolunner/RaspberryPi/wiki/images/motor-controller.png]] ](/chaolunner/RaspberryPi/wiki/[[https://github.com/chaolunner/RaspberryPi/wiki/images/battery-pack.png)
  • Software

    There are no additional software requirements for this resource beyond what is pre-installed in the current Raspbian image. To make sure your SD card is up-to-date, see the updating Raspbian guide.

GPIO in the Python language

GPIO in the C language

Advanced