Skip to content
artmg edited this page Jun 28, 2015 · 20 revisions

components

As well as the usual Raspberry Pi, this is the additional equipment we used for electronics experiments. Don't worry if you don't understand what any of these mean or do, we'll explain these as we go along.

  • Vilros RasberryPi Cobbler breakout
  • Vilros Breadboard
  • Sintron Ultimate 37 in 1 Sensor modules (for Arduino)

The first two were part of a Vilros starter kit, which also included some common electronic components, like resistors, LEDs and button switches.

basics

electronic components

Components are the individual little pieces used in electronic devices. Different kinds have different shapes or colours but they all have silver metal leads (sometimes called legs or pins)

electronic circuits

A circuit is a combination of components put together to do a particular thing.

Electricity flows when it has a way to go around. When simple electrical components are connected to each other 'all the way round in a circle' they form a simple 'circuit'.

When you look at pictures of circuits, you might see photos of green boards with gold lines and lots of little coloured pieces attached - these are actual circuits. Or you may see black and white diagrams with lots of pictorial symbols in an interconnected framework - this is a circuit diagram which makes it clear what is connected to what.

soldering

To create permanent circuits, use a hot soldering iron to melt solder and fix components in place

https://www.youtube.com/watch?v=H3-TfdZVBCc

Breadboard

We don't want to solder permanent circuits, we just want to put together experiments, so we use a breadboard

Have a look at the video at: https://www.youtube.com/watch?v=oiqNaSPTI7w

To make connections easily from the breadboard to the Pi we use the Vilros Cobbler breakout module https://www.vilros.com/raspberry-pi/rasp-pi-acc/raspberry-pi-cobbler.html

see also https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/breadboard/

GPIO

GPIO stands for General Purpose Input Output, and is the parallel rows of pins on one long side of the Pi.

It gives the connections (sometimes called an Interface) that the Raspberry Pi uses to connect to external electronics, to read signals (input) or send them (output).

For pictures and explanations see https://www.raspberrypi.org/documentation/usage/gpio/

The pins are numbered from 1, starting at the end where the ribbon cable has a red stripe, and alternating sides: 1 & 2 are at one end, then 3 & 4, 5 & 6, etc. A 'pinout' is a list of the pin numbers, saying what each of them does - see http://pi.gadgetoid.com/pinout

Light Emitting Diode (LED)

These are often used as indicator lights in electronic circuits, as they are cheap and use very little power. They must be connected the right way round as the "Diode" part of the name means 'only lets electricity pass one way'.

Sensors

The "Sintron Ultimate 37 in 1 Sensor Modules Kit" is sold as being for the Arduino, another popular experimental computer board. However, they are simply electronic components, so they may of course be used with the Pi, or any other electronic experiments you would like to make. To find out more see http://www.sintron-hk.com/Ultimate-37-in-1-Sensor-Modules-Kit-for-Arduino-MCU-Education-User-P3112448.aspx or to look at the list of sensors try http://www.amazon.co.uk/Sintron-Raspberry-Education-Documents-Available/dp/B00DU2IQ10#productDetails and for documentation and code (albeit arduino C programmes rather than Pi Python) download from https://www.dropbox.com/s/oitqcijo9za7j9w/37%20in%201%20sensor%20pdf%20files.zip

preparing your Pi

software installs

Python GPIO library

make sure this library is installed, from the command

sudo apt-get update sudo apt-get -y install python-rpi.gpio

if you use Python 3 then install...

sudo apt-get -y install python3-rpi.gpio

configuration

When you first install RPi.GPIO it uses something called /dev/mem, which is the name for a system memory device. Because this is an important part of your system, only the 'root' user can normally access it, using sudo.

So write your code, save it, then run it using

sudo python myprog.py

NEED TO CHECK if using one of the install methods from the project page avoids needing root - see https://pythonhosted.org/RPIO/#installation

alternatively see https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=26934

You could use a gpio group which has the relevant rights - see https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=7370

pigpio uses a daemon (program which is always running) to avoid needing to http://abyz.co.uk/rpi/pigpio/python.html

projects

getting started

simple LED

There is a simple to follow steps to light an LED at http://www.thirdeyevis.com/pi-page-2.php

This does not use a breadboard, but is simple to understand. If you still feel unsure, have a look at the pictures in the next project

button and LED

On the other hand you might want to see something being done on a breadboard, so you could check out this simple button and led, also bi-colour led http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/turing-machine/two.html

light detector

To recognise the components we will use, see the photos in http://www.ninjagecko.co.uk/how-to-measure-the-amount-of-light-in-a-room-using-a-light-dependent-resistor/

not used

Gordon Drogon's projects are visually simple, and use a breadboard, but do not use the breakout and the coding is in C - https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/3-more-leds-and-a-button/

doing more

more buttons and LEDs

This project shows a circuit with more buttons and LEDs, and uses Python. It is not as clear and step-by-step, but gives useful ideas http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/217-getting-started-with-raspberry-pi-gpio-and-python

sensing temperature

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing

to check out

Clone this wiki locally