Raspberry Pi Inventions

RPi_page_bgIn this section I hope to include snippets of code, ideas from yourselves and some projects that our students have worked on. I will also link to things I find around the web that I think you (teachers & students) will use to help you better understand how to programme with the raspberry Pi.

The introduction of computer science into the curriculum is a great way to engage our students in developing independent thinking and problem solving skills which are transferable to other areas of life other than computing.

guru_tweet

The raspberry pi is a great way to learn programming and some electronics. With the ability to attach hardware that it can communicate with, this provides a great way to help foster creativity in kids to inspire their own ideas.

Without further delay, let’s start!

Learning PythonThe GPIO PinsCode Snippets for devices

 

Basics in Python

Before you start, you must have some basic knowledge in Python. Honestly you don’t need much experience but how to write basic instructions in Python with loops and conditions in simple form is enough. Head over to our webpage on Python basics or try some of these websites for a great way to learn the basics:

LearnICT Python tutorials

Code Academy (great interactive Python courses)

Data Camp (Great interactive Python learning site)

LearnPython.org (Now also interactive thanks to DataCamp!)

 

The GPIO pins

The RPi comes in many different versions now. While the earlier models had 26 pins, the newer models now have 40 pins that enable users to connect external hardware. This opens many possibilities for creativity. Have a look at this for example.

GPIO stands for General Purpose Input Output. The pins either receive or send a signal that is either high or low. Since computers really only understand 1 or 0, it regards high signals as 1 and low signals as 0. Quoting from The University of Cambridge website:

a GPIO pin can be set high (taking the value 1) by connecting it to a voltage supply, or set low (taking the value 0) by connecting it to ground. The Raspberry Pi can set the pin to take either value and treat it as an output, or it can detect the value of the pin and treat it as an input.

Of the 26/40 pins there are two 3.3v, two 5v and five ground pins.There are also quite a few GPIO pins which is what will detect or send out the high/low signal to external hardware. The other pins will probably not be used in our projects but a great interactive explanation of them has been shared by Pinout.xyz which is quite useful.

 

Early 26 pin RPis 40 Pin RPis

Taken from hifiduino.files.wordpress.com
Raspberry Pi GPIO Pins, RPi

Notice how the numbers of the pins and GPIO number are different.

 

Scroll down below to find out how to attach various hardware using the GPIO ports. (Click on bulleted points to expand)

 

Code Snippets for Devices You Can Connect

A big shout needs to go out to raspberrypi-spy.co.uk and raspberrypi.org. Some of the guides here are taken directly from them and some guides are linked to their great resources. My intention here is to simply put together a simple list of devices students can find in one place.

Raspberry Pi Devices

The most basic circuit that we will learn to wire is the LED light. The others are not much different and no harder in most cases.   LearnICT_LED_CheatSHeet Click here to download PDF version Click here to download code With LEDs its is important you use the correct resistor for the correct LED. Refer to wherever you have purchased the LED to be sure. Resistors
Taking the temperature can be complicated but with this code, it is easy to get a reading without much hassle. Download the temperature Sensor PDF Cheatsheet Download the code
This device is used for measuring distance and can also be used to calculate speed. Download the PDF Cheatsheet - Download the code
This seems to work with all USB cameras that I have tried... so far! RPi_Webcam_cheatsheet Click here to download code
The Pi Camera Module is great and easy to use with this simple guide. Pi Camera Module Cheatsheet Click here to download code
I will update this with a simple guide on how to bind buttons to Python functions soon. This links to 2 brilliant guides by Raspberry Pi spy and The University of Cambridge
    Adding PS3/Ps4 Controller Adding Bluetooth Adapter Humidity Sensor Running Motors

 

Easy Project Ideas that Students can follow

Here you can find project examples from around the web that students can use to build or to inspire them into making similar projects with the help of the examples here. All credit goes to the original authors.

(Library coming here soon)


Check out The LearnICT.it Github Repository for more coding examples and ideas.

https://github.com/learnICT/RPi-club

Get a copy of all the scripts we use in our raspberry pi club by creating a folder and typing the following code into terminal using your pi:

git clone git://github.com/learnICT/RPi-club.git

From time to time the scripts are updated. To get the latest update, open the scripts folder you created with terminal again and type in:

git pull

 

Posted in CS, slider and tagged , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *


*