Sie sind auf Seite 1von 18

Raspberry Pi vs Arduino

plus some other stuff thrown in for good measure

Gary Quinn

School of Computing
Teesside University

G.Quinn@tees.ac.uk
What is Raspberry Pi ?
A computer with CPU, GPU, RAM, some I/O ports

Programs and (Linux) OS are stored on SD card. They “survive”


on the card when power is removed.

GPU = “Graphics Processing Unit”. Like having an OpenGL


graphics card, except that it's built into the same chip as the
CPU.

Approximately equal processing speed to a


300MHz P2. http://www.raspberrypi.org/faqs
What is Pi good for ?
Autonomous, embedded, not so CPU intensive t+asks.

Data Collection example: Pi + Air Quality Monitor.

Python script collects data from the Dylos and


records particulate matter levels
one record per minute, one file per day.
What is Pi good for ?
Video wall example: Simon McKeown is a lecturer at Teesside University. Also a fine
artist, regularly exhibiting work internationally.

Developed a video sequence of Motion-Captured,


CG Rendered video commentary from a number
of disabled people. Three videos to be played
across 3 screens with video synchronised.

Wired network connects 3 Pi's


which use Python scripts to
synchronise using TCP/IP
data packets to communicate.

https://www.facebook.com/SimonMckeownArtist
Pi projects on the web...

Loads of examples (ask Google)

Remote control Car, Light Painting,


http://www.linuxuser.co.uk/features/amazing-raspberry-pi-projects-part-1

Audio Player, Brewery Control, Near-Space Photography


http://www.linuxuser.co.uk/features/amazing-raspberry-pi-projects-part-2

Coffee Table Arcade Game, Kindle Look-alike,


Weather Station Data Collector
http://www.theregister.co.uk/2013/03/14/feature_ten_raspberry_pi_projects/
Pi is not so good for...
CPU intensive tasks.

I/O intensive apps. Can do some real world interfacing through GPIO port, but not
natively as extensive as Arduino.

Real-time clock (no, I didn't believe it either !). Pi has to be connected to a


network, or be fitted with a clock module to get the current date/time. It loses the
date/time when switched off, and has to be set manually

M$ Windoze lovers, this is real computing :-)


What is Arduino ?

A computer with CPU, RAM, EEPROM, lots of I/O ports

Programmable via USB. Use the Arduino IDE on a PC.

Programs are stored in EEPROM. They “survive” on the board when power is
removed, and start automatically when power is restored.

Arduino gets power from USB, but can be powered from battery or mains adaptor.

Can run without a connection to a PC – but would need an alternative power


supply.
What is Arduino good for ?

Prototyping combined software and electronic hardware projects.

Good for people with software and electronics knowledge.

Tons of Open Source example programs and circuits.

Loads of I/O ports, A to D, D to A, digital.

Lots of third party add-on boards “Shields”.


Game Controller with Arduino
Project still at “experimental” stage

Arduino communicates with PC,


sending Rotation and Translation data
from an IMU (Integrated Motion Unit).

http://www.hobbytronics.co.uk/arduino-adxl345-imu3000
Robot Arm Controller with Arduino

Project is in early development stage.

“pick and place” small objects.

Uses Inverse Kinematics to calculate


joint positions,
given an object's location.

Object location determined with a webcam (OpenCV on PC, not on Arduino)


Arduino on the web...

Hundreds of examples (ask Google)...

Start at Arduino's web site


http://arduino.cc/en/Tutorial/HomePage.

Circuit diagrams usually produced with “Fritzing”


http://fritzing.org/download/
Arduino is not so good for...

CPU intensive tasks.

Graphical apps. Text over a serial port is all you get !

Data collection, unless communicating with other devices. Limited non-volatile


storage (1k on Mega).

Python fans :-(


The board has to be programmed with its own C/C++ variant or assembly language.

Python can be used on PC/Pi to communicate with Arduino.


I want it all !

What if I want the best bits of Raspberry Pi


and the best bits of Arduino ?
You have (at least) two choices...
UDOO Use a USB cable

http://www.kickstarter.com/ http://blog.oscarliang.net/
projects/435742530/udoo-android- connect-raspberry-pi-and-arduino-
linux-arduino-in-a-tiny-single-board usb-cable/
Python
OOP language (you can ignore the OO Subtle differences between version 2
if you prefer). and version 3 :-(

Installed with “Wheezy”. General recommendation: write new


Downloadable for Windows. programs in version 3.

Well supported, with loads of Specific recommendation:


examples on the web. http://wiki.python.org/moin/Python2
orPython3

Great for learning because it can be Not too difficult to convert version 2
used to write games :-) programs to version 3.
Python 2 vs Python 3 example difference
● Python 2 ● Python 3

result = 2 / 4 result = 2 / 4

print result print ( result )


Python 2 vs Python 3 example difference
● Python 2 ● Python 3

result = 2 / 4 result = 2 / 4

print result print ( result )

● Numbers are integer, so ● Division is f.p. result is 0.5.


result is integer 0.

Use decimals for f.p. Use double slash for integer division.

result = 2.0 / 4.0 result = 2 // 4


Software used in the making of
● Arduino IDE http://www.arduino.cc/en/Main/software
● Fritzing http://fritzing.org/
Great for publishing circuit diagrams

● Debian Linux “Wheezy” http://www.raspberrypi.org/downloads


Linux OS for Raspberry Pi

● Python http://www.python.org/getit/windows/
Scripting language

● Credit to Coursera https://www.coursera.org/ for the course “An


Introduction to Interactive Programming in Python”.
● “My Blackberry is not working”. Two Ronnies on Youtube.
http://www.youtube.com/watch?v=6dmhF1rqaZk

Das könnte Ihnen auch gefallen