SlideShare ist ein Scribd-Unternehmen logo
1 von 10
CLASSROOM CHALLENGE
HARDWARE HACKING AND ROBOTICS USING THE
RASPBERRY PI
In this lesson you will learn how to extend the Raspberry Pi’s capability by connecting it to other hardware components.
You will then be able to program the Raspberry Pi to control the additional hardware. The Raspberry Pi is a simple
microcomputer that presents exciting opportunities to design and build new systems. Experimenting with computers
and electronic components to extend their capabilities is termed“hardware hacking”. There are many examples of
interesting projects here: http://www.raspberrypi.org/archives/tag/hardware and here: http://www.tech-fruits.com/
archives/category/raspberry-pi-hardware.
By completing this activity you will be able to connect components to the Raspberry Pi to build a simple robotic buggy
and to program it to move using Scratch. In order to protect the Raspberry Pi from the higher voltages required to
operate the motors of the robotic buggy, you will connect an interface board such as the Piface, developed by the
University of Manchester School of Computer Science. You will learn how to ensure that the software recognises the
Piface hardware and is able to communicate with it. Once you have learned how to connect and use the input and
output ports of the Piface, you will be able to extend this activity to create other devices using your own ideas. More
Piface projects and information can be found at: http://piface.openlx.org.uk.
The stages of building the robotic buggy are:
•	 Setting up the basic hardware and using the emulator to check that the software and hardware can communicate
successfully.
•	 Adding and controlling simple components such as turning an LED on and off and adding a buzzer.
•	 Writing programs in Scratch to control inputs and outputs.
•	 Building a robotic buggy and writing a program in Scratch to control its movement.
RESOURCES NEEDED FOR THIS ACTIVITY
•	 Raspberry Pi
•	 Piface interface board
•	 Construction materials e.g. Lego to make a buggy with a base and wheels
•	 2 x motors to drive two front wheels
•	 Batteries and battery snaps/holders
•	 Breadboard, LEDs, buzzer, resistors, jump wires
TASK 1 – SETTING UP THE BASIC HARDWARE (10 minutes)
Set up the Raspberry Pi as shown below. You will also need an interface board to connect to your Pi to control
components such as motors as they require a higher current (and often a higher voltage) to operate. This provides
protection to the Raspberry Pi’s components by using a device called a relay to turn the motor on or off.
This image shows the Raspberry Pi’s GPIO (General Purpose Input
Output) connector. The Raspberry Pi operates at
5v DC and it is possible to connect components that do not draw a
large current e.g. LEDs (Light Emitting Diodes) without using an
interface board. However, you still need to ensure that you know the
voltage required so that you do not cause damage to the Raspberry Pi.
In this image, a Piface interface board has been connected to the
Raspberry Pi. This allows you to connect a wide range of hardware
components but also protects the Raspberry Pi. The operating system
installed onto the SD card is slightly different from the standard
Raspbian Wheezy Debian Linux image. It contains code to allow the
Piface to operate with Scratch and Python to write control programs.
The Piface connects to the Raspberry Pi’s GPIO connector. If you are
doing this, make sure that you are very gentle and that the rubber foot
sits on the Pi to keep the board level.
Below are steps for setting up the Raspberry Pi ready to use. You will need to repeat these steps every time you want to
use the Pi with the Piface:
1.	 Connect up a USB hub with a keyboard and mouse and plug in the power supply. Boot up the Pi and login using
the username pi and password raspberry unless a separate user account has been set up in which case your
teacher will tell you what to type in.
2.	 Enter startx at the raspberrypi$ prompt.
3.	 Click on the Scratch icon on the desktop. Do NOT click on the Scratch Piface Handler link!
4.	 Click and hold the Shift key on the keyboard and click on the Share menu item in Scratch and select Host 		
Mesh. You should see a pop up showing the IP address 127.0.0.1. Click OK.
5.	 Minimise Scratch and click on the LX terminal link on the desktop.
6.	 Type the following at the prompt:
					cd piface/scratch
					python scratch_handler.py 127.0.0.1
You should then see some output showing that the Piface is now connected.
Note:	 You will need to repeat step 4–6 each time you close Scratch or the LX terminal window. If you find that a 	 	
	 program appears not to be connecting to the Piface, run these steps just in case the connection has been lost.
Piface emulator
Scratch
LX Terminal
USING THE PIFACE EMULATOR
The Piface version of the Raspbian operating system also has an icon on the desktop to the Piface Emulator. This allows
you to check the connection with the device.
Click override enable.
Click on output with
Piface connected.
LED now indicates
output is on.
TASK 2 – CONNECTING SIMPLE COMPONENTS - CONTROLLING
AN LED (10 minutes)
The Piface has 8 LEDs connected to its output ports. These can easily be programmed to turn on and off. Output ports 1
and 2 are also connected to the two relays.
Firstly connect Scratch to the Piface as detailed in Task 1.
1.	 Click on Variables then Make a variable.
2.	 Name the variable piface-output1.
3.	 Repeat this until you have created variables for piface-outputs 2 to 8.
4.	 Create the program below. Each output can only have a value of 0 (off) or 1 (on).
Think about what the program will do before you run it. The space bar being pressed acts as input to begin the 	
program.
5.	 Change the program so that it turns the LEDs on and then off in sequence so that only one LED is lit at any 		
moment.
6.	 Write another program that turns on the odd number outputs (1,3,5,7) and then turns them off and turns the 		
even number LEDs on (2,4,6,8). This sequence should repeat 3 times.
The Piface also has 4 push button switches that can be used for input to trigger an output. The following program uses a
switch input.
7.	 Change the program so that piface-input1 switches on piface-output1 and piface-inputs 2, 3 and 4 switch on 	
the outputs with the same number.
TASK 3 – ADDING A BUZZER (10 minutes)
The Raspberry Pi or Piface are not supplied with any sound output devices however, it is possible to connect a
piezo buzzer like the one shown below.
1.	 Connect the buzzer as shown below. The rightmost port is the 5v output and you also need to connect the 		
negative wire of the buzzer to another output port.
TASK 4 – CONTROLLING MOTORS (10 minutes)
Another very useful output device is a motor. This allows us to create devices that move. To begin with, you will connect
a DC motor to an output port on the Piface. However, electric motors often draw more current than other devices and
may operate at a higher voltage that would damage the Raspberry Pi. To provide protection, the Piface has two relays
installed. A relay is an electrical switch that allows a low powered circuit to turn on a higher powered one. However, the
two circuits are isolated. Relays are also used to switch on a car starter motor (a high powered circuit) when the key is
turned in the ignition (a low powered circuit).
Each relay has three connecting pins. The centre pin is common. You should always connect to this port. The top pin of
the three is called Normally Closed you should connect to this pin when you want the relay to break the circuit when
it is activated. The bottom pin is Normally Open which will cause the relay to close the circuit when activated. Since we
wish to turn a motor on when the relay is switched, we need to connect one wire to the common and the other to the
Normally Open port.
5v connection
Output ports 1–8. In this
example, the buzzer has been
connected to output 8.
Buzzer
Normally Closed
Common
Normally Open
The motor illustrated comes from a Lego kit. Its operating voltage is 9v. This is being supplied by a 9v battery connected
in the circuit.
TASK 5 – BUILDING A ROBOT (30 minutes)
Using a construction kit or individual components, you are now going to create a robotic buggy controlled by the
Raspberry Pi with a fitted Piface. Your buggy will need four wheels with two being driven by motors each connected to a
relay on the Piface as shown here:
Battery
Motor
Common connection to relay 2
(connects to output 2)
Normally Open connection to relay
2 (connects to motor battery)
Common connection to relay 1
(connects to output 1)
Normally Open connection to relay 1
(connects to second motor battery)
TASK 6 – PROGRAMMING THE ROBOT (30 minutes)
1.	 Connect the robotic buggy to the Piface relays as outlined above.
2.	 Check that Scratch is connected to the Raspberry Pi as in Task 1.
3.	 Create a program to move the buggy by turning the motors on and off.
4.	 The above program moves the buggy in a straight line. Turning one motor off will cause the buggy to turn. Write
a program to move the buggy so that it moves and turns to effectively“draw”a square and return to its original
starting position.
The finished robot buggy.
TASK 7 – INVESTIGATING HOW ROBOTS ARE USED (30 minutes)
Through your investigation, you have learned that the robotic buggy is controlled by a program that switches the
relay driving the motor on and off as required. This can also be controlled by sensors as input devices. Robotic output
devices are called actuators. They may be motors but could also be pneumatic or hydraulic devices.
Robots are used in a number of different industries e.g. car manufacture, nuclear power plants, military applications,
space exploration and even medicine. There are advantages and disadvantages associated with their use. It is important
that robots are reliable as they are often used in safety-critical environments or in remote situations where maintenance
and repair would be very costly e.g. space.
In this task, you will investigate and research the use of robots. You should focus on:
•	 The uses of robots giving specific examples
•	 Why it is important that they are reliable
•	 What input and output devices are used in the examples that you have given
•	 Try to find information about how they are programmed
Create a presentation of your findings.
Here are some useful websites:
http://en.wikipedia.org/wiki/Robotics
http://www.nasa.gov/audience/foreducators/robotics/home/index.html
http://spectrum.ieee.org/robotics/

Weitere ähnliche Inhalte

Andere mochten auch

BSides DFW2016-Hack Mode Enabled
BSides DFW2016-Hack Mode EnabledBSides DFW2016-Hack Mode Enabled
BSides DFW2016-Hack Mode Enabledpricemcdonald
 
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKINGA BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKINGSilvio Cesare
 
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014Takeda Pharmaceuticals
 
Coders need to learn hardware hacking NOW
Coders need to learn hardware hacking NOWCoders need to learn hardware hacking NOW
Coders need to learn hardware hacking NOWMatt Biddulph
 
JTAG Interface (Intro)
JTAG Interface (Intro)JTAG Interface (Intro)
JTAG Interface (Intro)Nitesh Bhatia
 
Hardware Reverse Engineering: From Boot to Root
Hardware Reverse Engineering: From Boot to RootHardware Reverse Engineering: From Boot to Root
Hardware Reverse Engineering: From Boot to RootYashin Mehaboobe
 
PyTriage: A malware analysis framework
PyTriage: A malware analysis frameworkPyTriage: A malware analysis framework
PyTriage: A malware analysis frameworkYashin Mehaboobe
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblySam Bowne
 
FSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGFSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGDobrica Pavlinušić
 
Cheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerCheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerDobrica Pavlinušić
 
Raspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsRaspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsDobrica Pavlinušić
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software peopleDobrica Pavlinušić
 
Let's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionLet's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionDobrica Pavlinušić
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro Sam Bowne
 

Andere mochten auch (20)

Hardware Hacking Primer
Hardware Hacking PrimerHardware Hacking Primer
Hardware Hacking Primer
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
BSides DFW2016-Hack Mode Enabled
BSides DFW2016-Hack Mode EnabledBSides DFW2016-Hack Mode Enabled
BSides DFW2016-Hack Mode Enabled
 
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKINGA BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
 
Breaking Bad EACS Implementations
Breaking Bad EACS ImplementationsBreaking Bad EACS Implementations
Breaking Bad EACS Implementations
 
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
 
Coders need to learn hardware hacking NOW
Coders need to learn hardware hacking NOWCoders need to learn hardware hacking NOW
Coders need to learn hardware hacking NOW
 
Arduino Forensics
Arduino ForensicsArduino Forensics
Arduino Forensics
 
Router forensics
Router forensicsRouter forensics
Router forensics
 
JTAG Interface (Intro)
JTAG Interface (Intro)JTAG Interface (Intro)
JTAG Interface (Intro)
 
Hardware hacking 101
Hardware hacking 101Hardware hacking 101
Hardware hacking 101
 
Hardware Reverse Engineering: From Boot to Root
Hardware Reverse Engineering: From Boot to RootHardware Reverse Engineering: From Boot to Root
Hardware Reverse Engineering: From Boot to Root
 
PyTriage: A malware analysis framework
PyTriage: A malware analysis frameworkPyTriage: A malware analysis framework
PyTriage: A malware analysis framework
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 Disassembly
 
FSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGFSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAG
 
Cheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerCheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component tester
 
Raspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsRaspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needs
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software people
 
Let's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionLet's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 edition
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro CNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro
 

Ähnlich wie amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf

Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi Sanjay Kumar
 
Speech & Web based appliance control
Speech & Web based appliance controlSpeech & Web based appliance control
Speech & Web based appliance controlMohit Khatri
 
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorAdafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorStefan Oprea
 
ScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClipScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClipDavid Dryden
 
Presentation IOT Robot
Presentation IOT RobotPresentation IOT Robot
Presentation IOT RobotVatsal N Shah
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryRaspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryBrian Pichman
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreBenjamin Moore
 
Introduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin ControlIntroduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin ControlPradip Bhandari
 
Building your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry PiBuilding your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry PiJeff Prestes
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOKris Findlay
 
Raspberry pi-spectrum-analyzer-display-on-rgb-led-strip
Raspberry pi-spectrum-analyzer-display-on-rgb-led-stripRaspberry pi-spectrum-analyzer-display-on-rgb-led-strip
Raspberry pi-spectrum-analyzer-display-on-rgb-led-stripStefan Oprea
 
RMOUG QEW Family Coding Event- Raspberry PI
RMOUG QEW Family Coding Event-  Raspberry PIRMOUG QEW Family Coding Event-  Raspberry PI
RMOUG QEW Family Coding Event- Raspberry PIKellyn Pot'Vin-Gorman
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi boardThierry Gayet
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi Tomomi Imura
 
Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry PiAdafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry PiImad Rhali
 

Ähnlich wie amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf (20)

Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi
 
Speech & Web based appliance control
Speech & Web based appliance controlSpeech & Web based appliance control
Speech & Web based appliance control
 
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorAdafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
ScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClipScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClip
 
Presentation IOT Robot
Presentation IOT RobotPresentation IOT Robot
Presentation IOT Robot
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryRaspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMoore
 
Introduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin ControlIntroduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin Control
 
Building your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry PiBuilding your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry Pi
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIO
 
Raspberry pi-spectrum-analyzer-display-on-rgb-led-strip
Raspberry pi-spectrum-analyzer-display-on-rgb-led-stripRaspberry pi-spectrum-analyzer-display-on-rgb-led-strip
Raspberry pi-spectrum-analyzer-display-on-rgb-led-strip
 
Iot lab manual new
Iot lab manual newIot lab manual new
Iot lab manual new
 
RMOUG QEW Family Coding Event- Raspberry PI
RMOUG QEW Family Coding Event-  Raspberry PIRMOUG QEW Family Coding Event-  Raspberry PI
RMOUG QEW Family Coding Event- Raspberry PI
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi board
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
 
Raspberry-Pi
Raspberry-PiRaspberry-Pi
Raspberry-Pi
 
Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry PiAdafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
 
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptxRaspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
 
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptxRaspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
 

Mehr von amrapalibuildersreviews

amrapali builders@@@hacking d link routers with hnap.pdf
amrapali builders@@@hacking d link routers with hnap.pdfamrapali builders@@@hacking d link routers with hnap.pdf
amrapali builders@@@hacking d link routers with hnap.pdfamrapalibuildersreviews
 
Amrapali builders -- google cheatsheet.pdf
Amrapali builders -- google cheatsheet.pdfAmrapali builders -- google cheatsheet.pdf
Amrapali builders -- google cheatsheet.pdfamrapalibuildersreviews
 
amrapali builders -- maroochy water-services-case-study briefing.pdf
amrapali builders -- maroochy water-services-case-study briefing.pdfamrapali builders -- maroochy water-services-case-study briefing.pdf
amrapali builders -- maroochy water-services-case-study briefing.pdfamrapalibuildersreviews
 
amrapali builders -- hacking the genome.pdf
amrapali builders -- hacking the genome.pdfamrapali builders -- hacking the genome.pdf
amrapali builders -- hacking the genome.pdfamrapalibuildersreviews
 
amrapali builders @@ hacking with basic command.pdf
amrapali builders @@ hacking with basic command.pdfamrapali builders @@ hacking with basic command.pdf
amrapali builders @@ hacking with basic command.pdfamrapalibuildersreviews
 
amrapali builders @@ hacking challenges.pdf
amrapali builders @@ hacking challenges.pdfamrapali builders @@ hacking challenges.pdf
amrapali builders @@ hacking challenges.pdfamrapalibuildersreviews
 
amrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdfamrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdfamrapalibuildersreviews
 
amrapali builders@@@bluetooth hacking.pdf
amrapali builders@@@bluetooth hacking.pdfamrapali builders@@@bluetooth hacking.pdf
amrapali builders@@@bluetooth hacking.pdfamrapalibuildersreviews
 
amrapali builders@@@@hacking windows internals.pdf
amrapali builders@@@@hacking windows internals.pdfamrapali builders@@@@hacking windows internals.pdf
amrapali builders@@@@hacking windows internals.pdfamrapalibuildersreviews
 
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...amrapalibuildersreviews
 
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali GroupAmrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Groupamrapalibuildersreviews
 
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali GroupAmrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Groupamrapalibuildersreviews
 
Amrapali reviews(application form 4 t ech park g.noida)Amrapali Builders,Am...
Amrapali reviews(application form 4   t ech park g.noida)Amrapali Builders,Am...Amrapali reviews(application form 4   t ech park g.noida)Amrapali Builders,Am...
Amrapali reviews(application form 4 t ech park g.noida)Amrapali Builders,Am...amrapalibuildersreviews
 
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali GroupAmrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali Groupamrapalibuildersreviews
 
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali GroupAmrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali Groupamrapalibuildersreviews
 
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali Group
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali GroupAmrapali builders(terrace homes)Amrapali Reviews,Amrapali Group
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali Groupamrapalibuildersreviews
 

Mehr von amrapalibuildersreviews (20)

amrapali builders@@@hacking d link routers with hnap.pdf
amrapali builders@@@hacking d link routers with hnap.pdfamrapali builders@@@hacking d link routers with hnap.pdf
amrapali builders@@@hacking d link routers with hnap.pdf
 
Amrapali builders -- google cheatsheet.pdf
Amrapali builders -- google cheatsheet.pdfAmrapali builders -- google cheatsheet.pdf
Amrapali builders -- google cheatsheet.pdf
 
amrapali builders -- maroochy water-services-case-study briefing.pdf
amrapali builders -- maroochy water-services-case-study briefing.pdfamrapali builders -- maroochy water-services-case-study briefing.pdf
amrapali builders -- maroochy water-services-case-study briefing.pdf
 
amrapali builders -- hacking the genome.pdf
amrapali builders -- hacking the genome.pdfamrapali builders -- hacking the genome.pdf
amrapali builders -- hacking the genome.pdf
 
amrapali builders @@ hacking with basic command.pdf
amrapali builders @@ hacking with basic command.pdfamrapali builders @@ hacking with basic command.pdf
amrapali builders @@ hacking with basic command.pdf
 
amrapali builders @@ hacking challenges.pdf
amrapali builders @@ hacking challenges.pdfamrapali builders @@ hacking challenges.pdf
amrapali builders @@ hacking challenges.pdf
 
amrapali builders @@ google hacking.pdf
amrapali builders @@ google hacking.pdfamrapali builders @@ google hacking.pdf
amrapali builders @@ google hacking.pdf
 
amrapali builders @@hacking cctv.pdf
amrapali builders @@hacking cctv.pdfamrapali builders @@hacking cctv.pdf
amrapali builders @@hacking cctv.pdf
 
amrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdfamrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdf
 
amrapali builders@@@bluetooth hacking.pdf
amrapali builders@@@bluetooth hacking.pdfamrapali builders@@@bluetooth hacking.pdf
amrapali builders@@@bluetooth hacking.pdf
 
amrapali builders@@sub way hacking.pdf
amrapali builders@@sub way hacking.pdfamrapali builders@@sub way hacking.pdf
amrapali builders@@sub way hacking.pdf
 
amrapali builders@@hacking ciphers.pdf
amrapali builders@@hacking ciphers.pdfamrapali builders@@hacking ciphers.pdf
amrapali builders@@hacking ciphers.pdf
 
amrapali builders@@@@hacking windows internals.pdf
amrapali builders@@@@hacking windows internals.pdfamrapali builders@@@@hacking windows internals.pdf
amrapali builders@@@@hacking windows internals.pdf
 
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
 
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali GroupAmrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
 
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali GroupAmrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
 
Amrapali reviews(application form 4 t ech park g.noida)Amrapali Builders,Am...
Amrapali reviews(application form 4   t ech park g.noida)Amrapali Builders,Am...Amrapali reviews(application form 4   t ech park g.noida)Amrapali Builders,Am...
Amrapali reviews(application form 4 t ech park g.noida)Amrapali Builders,Am...
 
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali GroupAmrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
 
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali GroupAmrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
 
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali Group
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali GroupAmrapali builders(terrace homes)Amrapali Reviews,Amrapali Group
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali Group
 

Kürzlich hochgeladen

SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxHaritikaChhatwal1
 
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...KarteekMane1
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectBoston Institute of Analytics
 
Unveiling the Role of Social Media Suspect Investigators in Preventing Online...
Unveiling the Role of Social Media Suspect Investigators in Preventing Online...Unveiling the Role of Social Media Suspect Investigators in Preventing Online...
Unveiling the Role of Social Media Suspect Investigators in Preventing Online...Milind Agarwal
 
convolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfconvolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfSubhamKumar3239
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfblazblazml
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max PrincetonTimothy Spann
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxSimranPal17
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024Susanna-Assunta Sansone
 
Networking Case Study prepared by teacher.pptx
Networking Case Study prepared by teacher.pptxNetworking Case Study prepared by teacher.pptx
Networking Case Study prepared by teacher.pptxHimangsuNath
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksdeepakthakur548787
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxMike Bennett
 
INTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processingINTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processingsocarem879
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxTasha Penwell
 

Kürzlich hochgeladen (20)

SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptx
 
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis Project
 
Unveiling the Role of Social Media Suspect Investigators in Preventing Online...
Unveiling the Role of Social Media Suspect Investigators in Preventing Online...Unveiling the Role of Social Media Suspect Investigators in Preventing Online...
Unveiling the Role of Social Media Suspect Investigators in Preventing Online...
 
convolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfconvolutional neural network and its applications.pdf
convolutional neural network and its applications.pdf
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max Princeton
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptx
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
 
Networking Case Study prepared by teacher.pptx
Networking Case Study prepared by teacher.pptxNetworking Case Study prepared by teacher.pptx
Networking Case Study prepared by teacher.pptx
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing works
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptx
 
INTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processingINTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processing
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
 

amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf

  • 1. CLASSROOM CHALLENGE HARDWARE HACKING AND ROBOTICS USING THE RASPBERRY PI In this lesson you will learn how to extend the Raspberry Pi’s capability by connecting it to other hardware components. You will then be able to program the Raspberry Pi to control the additional hardware. The Raspberry Pi is a simple microcomputer that presents exciting opportunities to design and build new systems. Experimenting with computers and electronic components to extend their capabilities is termed“hardware hacking”. There are many examples of interesting projects here: http://www.raspberrypi.org/archives/tag/hardware and here: http://www.tech-fruits.com/ archives/category/raspberry-pi-hardware. By completing this activity you will be able to connect components to the Raspberry Pi to build a simple robotic buggy and to program it to move using Scratch. In order to protect the Raspberry Pi from the higher voltages required to operate the motors of the robotic buggy, you will connect an interface board such as the Piface, developed by the University of Manchester School of Computer Science. You will learn how to ensure that the software recognises the Piface hardware and is able to communicate with it. Once you have learned how to connect and use the input and output ports of the Piface, you will be able to extend this activity to create other devices using your own ideas. More Piface projects and information can be found at: http://piface.openlx.org.uk. The stages of building the robotic buggy are: • Setting up the basic hardware and using the emulator to check that the software and hardware can communicate successfully. • Adding and controlling simple components such as turning an LED on and off and adding a buzzer. • Writing programs in Scratch to control inputs and outputs. • Building a robotic buggy and writing a program in Scratch to control its movement. RESOURCES NEEDED FOR THIS ACTIVITY • Raspberry Pi • Piface interface board • Construction materials e.g. Lego to make a buggy with a base and wheels • 2 x motors to drive two front wheels • Batteries and battery snaps/holders • Breadboard, LEDs, buzzer, resistors, jump wires
  • 2. TASK 1 – SETTING UP THE BASIC HARDWARE (10 minutes) Set up the Raspberry Pi as shown below. You will also need an interface board to connect to your Pi to control components such as motors as they require a higher current (and often a higher voltage) to operate. This provides protection to the Raspberry Pi’s components by using a device called a relay to turn the motor on or off. This image shows the Raspberry Pi’s GPIO (General Purpose Input Output) connector. The Raspberry Pi operates at 5v DC and it is possible to connect components that do not draw a large current e.g. LEDs (Light Emitting Diodes) without using an interface board. However, you still need to ensure that you know the voltage required so that you do not cause damage to the Raspberry Pi. In this image, a Piface interface board has been connected to the Raspberry Pi. This allows you to connect a wide range of hardware components but also protects the Raspberry Pi. The operating system installed onto the SD card is slightly different from the standard Raspbian Wheezy Debian Linux image. It contains code to allow the Piface to operate with Scratch and Python to write control programs. The Piface connects to the Raspberry Pi’s GPIO connector. If you are doing this, make sure that you are very gentle and that the rubber foot sits on the Pi to keep the board level.
  • 3. Below are steps for setting up the Raspberry Pi ready to use. You will need to repeat these steps every time you want to use the Pi with the Piface: 1. Connect up a USB hub with a keyboard and mouse and plug in the power supply. Boot up the Pi and login using the username pi and password raspberry unless a separate user account has been set up in which case your teacher will tell you what to type in. 2. Enter startx at the raspberrypi$ prompt. 3. Click on the Scratch icon on the desktop. Do NOT click on the Scratch Piface Handler link! 4. Click and hold the Shift key on the keyboard and click on the Share menu item in Scratch and select Host Mesh. You should see a pop up showing the IP address 127.0.0.1. Click OK. 5. Minimise Scratch and click on the LX terminal link on the desktop. 6. Type the following at the prompt: cd piface/scratch python scratch_handler.py 127.0.0.1 You should then see some output showing that the Piface is now connected. Note: You will need to repeat step 4–6 each time you close Scratch or the LX terminal window. If you find that a program appears not to be connecting to the Piface, run these steps just in case the connection has been lost. Piface emulator Scratch LX Terminal
  • 4. USING THE PIFACE EMULATOR The Piface version of the Raspbian operating system also has an icon on the desktop to the Piface Emulator. This allows you to check the connection with the device. Click override enable. Click on output with Piface connected. LED now indicates output is on.
  • 5. TASK 2 – CONNECTING SIMPLE COMPONENTS - CONTROLLING AN LED (10 minutes) The Piface has 8 LEDs connected to its output ports. These can easily be programmed to turn on and off. Output ports 1 and 2 are also connected to the two relays. Firstly connect Scratch to the Piface as detailed in Task 1. 1. Click on Variables then Make a variable. 2. Name the variable piface-output1. 3. Repeat this until you have created variables for piface-outputs 2 to 8.
  • 6. 4. Create the program below. Each output can only have a value of 0 (off) or 1 (on). Think about what the program will do before you run it. The space bar being pressed acts as input to begin the program. 5. Change the program so that it turns the LEDs on and then off in sequence so that only one LED is lit at any moment. 6. Write another program that turns on the odd number outputs (1,3,5,7) and then turns them off and turns the even number LEDs on (2,4,6,8). This sequence should repeat 3 times. The Piface also has 4 push button switches that can be used for input to trigger an output. The following program uses a switch input. 7. Change the program so that piface-input1 switches on piface-output1 and piface-inputs 2, 3 and 4 switch on the outputs with the same number.
  • 7. TASK 3 – ADDING A BUZZER (10 minutes) The Raspberry Pi or Piface are not supplied with any sound output devices however, it is possible to connect a piezo buzzer like the one shown below. 1. Connect the buzzer as shown below. The rightmost port is the 5v output and you also need to connect the negative wire of the buzzer to another output port. TASK 4 – CONTROLLING MOTORS (10 minutes) Another very useful output device is a motor. This allows us to create devices that move. To begin with, you will connect a DC motor to an output port on the Piface. However, electric motors often draw more current than other devices and may operate at a higher voltage that would damage the Raspberry Pi. To provide protection, the Piface has two relays installed. A relay is an electrical switch that allows a low powered circuit to turn on a higher powered one. However, the two circuits are isolated. Relays are also used to switch on a car starter motor (a high powered circuit) when the key is turned in the ignition (a low powered circuit). Each relay has three connecting pins. The centre pin is common. You should always connect to this port. The top pin of the three is called Normally Closed you should connect to this pin when you want the relay to break the circuit when it is activated. The bottom pin is Normally Open which will cause the relay to close the circuit when activated. Since we wish to turn a motor on when the relay is switched, we need to connect one wire to the common and the other to the Normally Open port. 5v connection Output ports 1–8. In this example, the buzzer has been connected to output 8. Buzzer Normally Closed Common Normally Open
  • 8. The motor illustrated comes from a Lego kit. Its operating voltage is 9v. This is being supplied by a 9v battery connected in the circuit. TASK 5 – BUILDING A ROBOT (30 minutes) Using a construction kit or individual components, you are now going to create a robotic buggy controlled by the Raspberry Pi with a fitted Piface. Your buggy will need four wheels with two being driven by motors each connected to a relay on the Piface as shown here: Battery Motor Common connection to relay 2 (connects to output 2) Normally Open connection to relay 2 (connects to motor battery) Common connection to relay 1 (connects to output 1) Normally Open connection to relay 1 (connects to second motor battery)
  • 9. TASK 6 – PROGRAMMING THE ROBOT (30 minutes) 1. Connect the robotic buggy to the Piface relays as outlined above. 2. Check that Scratch is connected to the Raspberry Pi as in Task 1. 3. Create a program to move the buggy by turning the motors on and off. 4. The above program moves the buggy in a straight line. Turning one motor off will cause the buggy to turn. Write a program to move the buggy so that it moves and turns to effectively“draw”a square and return to its original starting position. The finished robot buggy.
  • 10. TASK 7 – INVESTIGATING HOW ROBOTS ARE USED (30 minutes) Through your investigation, you have learned that the robotic buggy is controlled by a program that switches the relay driving the motor on and off as required. This can also be controlled by sensors as input devices. Robotic output devices are called actuators. They may be motors but could also be pneumatic or hydraulic devices. Robots are used in a number of different industries e.g. car manufacture, nuclear power plants, military applications, space exploration and even medicine. There are advantages and disadvantages associated with their use. It is important that robots are reliable as they are often used in safety-critical environments or in remote situations where maintenance and repair would be very costly e.g. space. In this task, you will investigate and research the use of robots. You should focus on: • The uses of robots giving specific examples • Why it is important that they are reliable • What input and output devices are used in the examples that you have given • Try to find information about how they are programmed Create a presentation of your findings. Here are some useful websites: http://en.wikipedia.org/wiki/Robotics http://www.nasa.gov/audience/foreducators/robotics/home/index.html http://spectrum.ieee.org/robotics/