SlideShare a Scribd company logo
Using Arduino and Raspberry Pi 
for Internet of Things 
Sudar Muthu (@sudarmuthu) 
http://hardwarefun.com/ 
http://github.com/sudar
Who am I? 
 Research Engineer by profession 
 I build robots as a hobby 
 Playing with Arduino for more than 4 years 
 Blogger about Arduino at http://hardwarefun.com 
 Moderator for Arduino India forum 
http://hardwarefun.com 2
Objective 
 Introduce Arduino 
 Introduce Raspberry Pi 
 Emphasis on IoT 
 See how both can be used for IoT 
http://hardwarefun.com 3
Arduino 
http://hardwarefun.com 4
What is Arduino? 
 Visual Basic for hardware 
 Includes both Hardware and software 
http://hardwarefun.com 5 
Photo credit Arduino team
Different Arduino types 
 Arduino Uno (The one I am going to use today) 
 Arduino Mega 
 Arduino Due 
 Lillypad 
 Arduino BT 
 Arduino Ethernet 
 .. and clones 
http://hardwarefun.com 6
Getting to know the Arduino 
http://hardwarefun.com 7
Specs (Uno, Leonardo) 
Type Value 
Microcontroller ATmega328 
Operating Voltage 5v 
Digital I/O Pins 14 (of which 6 provide PWM output) 
Analog Input Pins 6 
Flash Memory 32 KB (ATmega328) of which 0.5 KB used 
by bootloader 
SRAM 2 KB (ATmega328) 
EEPROM 1 KB (ATmega328) 
Clock Speed 16 MHz 
http://hardwarefun.com 8
Identify these components in 
 Microcontroller 
 Power jacket 
 USB jacket 
 Digital pins 
 Analog pins 
 Reset button 
Arduino 
http://hardwarefun.com 9
Identify these components in 
Arduino 
 Voltage Regulator 
 Power Pins (how many are there?) 
 Ground Pins (how many are there?) 
 Vin Pin 
 Rx and Tx Pins 
 ICSP Headers 
http://hardwarefun.com 10
Identify these components in 
 Power Led 
 Rx and Tx Led’s 
 Test Led 
 Crystal 
 Anything else? 
Arduino 
http://hardwarefun.com 11
Powering up Arduino 
http://hardwarefun.com 12
Different ways to power up Arduino 
 Using USB cable 
 Using DC power jacket 
 Giving voltage directly into Vin pin 
 Giving regulated voltage directly into 5V pin 
http://hardwarefun.com 13
Setting up Arduino 
http://hardwarefun.com 14
Testing the setup with a “Hello 
World” program 
http://hardwarefun.com 15
Blinking LED 
http://hardwarefun.com 16
Making a LED blink 
 Insert a LED in pin 13 
 Open File->Examples->Basics->Blink 
 Select Tools->Boards->Arduino Uno 
 Select File->Upload (or press ctrl+u) 
 You should get the message “Done upload” 
 Your Led should blink 
 Congrats you can program Arduino now  
http://hardwarefun.com 17
People with electronics background 
Did I miss anything? 
http://hardwarefun.com 18
People with electronics background 
Did I miss anything? 
Hint: Ohm’s Law 
http://hardwarefun.com 19
Anatomy of an Arduino sketch 
http://hardwarefun.com 20
Printing values through Serial 
 Uno has one UART hardware port, using which we 
can exchange information with computer 
 Very useful for debugging 
 Works at a specified baud rate 
 Use Serial Monitor to read values 
 SoftwareSerial is also available 
http://hardwarefun.com 21
Breadboard Basics 
http://hardwarefun.com 22
How to use a breadboard 
 The first two and the last two rows are connected 
 In all the other rows, columns are connected 
 Connect the first and last row to power 
 Connect the second and second last row to ground 
http://hardwarefun.com 23
Digital Input and Output 
http://hardwarefun.com 24
Digital Input 
http://hardwarefun.com 25
Digital Output 
The LED blink that we did at “setting up Arduino” is 
Digital output 
http://hardwarefun.com 26
Analog Input 
http://hardwarefun.com 27
Reading Analog values from sensors 
 Connect the LDR on pin A0 and Gnd 
 LDR’s resistance varies based on the amount of light 
present 
 Read the current value using analogRead() 
 Print the value in Serial Monitor 
http://hardwarefun.com 28
Control an LED based on light 
void setup(){ 
pinMode(13, OUTPUT); 
} 
void loop(){ 
int val = analogRead(A0); 
if (val > 50) { 
digitalWrite(13, HIGH); 
} else { 
digitalWrite(13, LOW); 
} 
} 
http://hardwarefun.com 29
Analog Output 
http://hardwarefun.com 30
Analog Output 
 What is PWM? 
 Analog like behavior using digital output 
 Works by switching the LED on and off regularly 
 Changing the brightness of a Led 
http://hardwarefun.com 31
This is just the tip of an 
iceberg 
http://hardwarefun.com 32 
There are tons of other 
features to Arduino which I 
have not talked about
Internet of Things 
http://hardwarefun.com 33
http://hardwarefun.com 34 
"Internet of Things" by Wilgengebroed on Flickr
LoT is an overloaded term 
But I like this definition… 
“The Internet of Things is the interconnection of 
uniquely identifiable embedded computing devices 
within the existing Internet infrastructure” 
http://hardwarefun.com 35
Connecting Arduino to Internet 
 Ethernet Shield 
 WIFI Shield 
 3G Shield 
 Using another intermediate component 
http://hardwarefun.com 36
Demo of network connectivity 
using Arduino 
http://hardwarefun.com 37
Let’s take a break  
http://hardwarefun.com 38
Raspberry Pi
Credit Card Sized 
Computer 
http://hardwarefun.com 40
GPIO Pins 
http://hardwarefun.com 41 http://learn.adafruit.com/assets/3052
Setup Python 
sudo apt-get install python-dev 
sudo apt-get install python-rpi.gpio 
http://hardwarefun.com 42
Set the status of GPIO Pins 
https://github.com/sudar/r http://hardwarefun.com asp4b3erry-pi-sketches/blob/master/led-blink/led-blink.py
Set the status of GPIO Pins 
import RPi.GPIO as GPIO 
import time 
GPIO.setmode(GPIO.BOARD) 
GPIO.setup(12, GPIO.OUT) 
try: 
while True: 
GPIO.output(12, GPIO.HIGH) 
time.sleep(1) 
GPIO.output(12, GPIO.LOW) 
time.sleep(1) 
finally: 
GPIO.cleanup() 
https://github.com/sudar/raspberry-http://hardwarefun.com 44 pi-sketches/blob/master/led-blink/led-blink.py
Demo 
Let there be Light 
https://github.com/sudar/r http://hardwarefun.com 45aspberry-pi-sketches/blob/master/led-blink/led-blink.py
Changing the brightness of the LED 
import RPi.GPIO as GPIO 
import time 
GPIO.setmode(GPIO.BOARD) 
GPIO.setup(12, GPIO.OUT) 
p = GPIO.PWM(12, 50) # channel=12 frequency=50Hz 
p.start(0) 
try: 
while True: 
for dc in range(0, 101, 5): 
p.ChangeDutyCycle(dc) 
time.sleep(0.1) 
for dc in range(100, -1, -5): 
p.ChangeDutyCycle(dc) 
time.sleep(0.1) 
finally: 
p.stop() 
GPIO.cleanup() 
http://hardwarefun.com 46 
https://github.com/sudar/raspberry-pi-sketches/blob/master/led-blink/pwm.py
Demo 
Can you see the brightness changing? 
https://github.com/sudar/raspberry-http://hardwarefun.com 47 pi-sketches/blob/master/led-blink/pwm.py
Reading the status of the Pin 
import RPi.GPIO as GPIO 
import time 
GPIO.setmode(GPIO.BOARD) 
GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) 
try: 
while True: 
if GPIO.input(11): 
print "Button is on" 
else: 
print "Button is off" 
time.sleep(0.1) 
finally: 
GPIO.cleanup() 
http://hardwarefun.com 48 
https://github.com/sudar/raspberry-pi-sketches/blob/master/button-input/button-input.py
Reading the status of the Pin 
http://hardwarefun.com 49 
https://github.com/sudar/raspberry-pi-sketches/blob/master/button-input/button-input.py
Demo 
What happens when the button is pressed? 
http://hardwarefun.com 50 
https://github.com/sudar/raspberry-pi-sketches/blob/master/button-input/button-input.py
Combining Input and Output 
import RPi.GPIO as GPIO 
import time 
GPIO.setmode(GPIO.BOARD) 
GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) 
GPIO.setup(12, GPIO.OUT) 
try: 
while True: 
if GPIO.input(11): 
print "Button is on" 
GPIO.output(12, 1) 
else: 
GPIO.output(12, 0) 
time.sleep(0.1) 
finally: 
GPIO.cleanup() 
http://hardwarefun.com 51 
https://github.com/sudar/raspberry-pi-sketches/blob/master/button-and-led/button-and-led.py
Combining Input and Output 
http://hardwarefun.com 52 
https://github.com/sudar/raspberry-pi-sketches/blob/master/button-and-led/button-and-led.py
Demo 
Let’s control the LED by pressing the button 
http://hardwarefun.com 53 
https://github.com/sudar/raspberry-pi-sketches/blob/master/button-and-led/button-and-led.py
What more can be done? 
http://hardwarefun.com 54
More protocols 
 I2C 
 SPI 
 Serial 
http://hardwarefun.com 55
Interacting with webcam 
 “PyGame” provides easy interface 
 Can get fancy using “opencv” 
 Both USB and GPIO interface are supported 
http://hardwarefun.com 56
Distributed Computing 
 Each Pi can be used as cheap node 
 Form grids using a cluster of Pi’s 
 Can share CPU, memory and disk space 
http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/ 
distributed-computing/ 
http://hardwarefun.com 57
Limitations 
 No built-in Analog to Digital support 
 Can’t run Inductive load (motors) 
 Is not real-time (CPU might be busy) 
 No “safe circuits” present 
 Operates at 3.3V and is not directly compatible with 
Arduino voltage 
http://hardwarefun.com 58
Arduino vs Raspberry Pi 
for IoT 
http://hardwarefun.com 59
Advantages of Raspberry Pi 
 Entire Linux software stack is available 
 It is very easy to connect to internet 
 Can be programmed using variety of programming 
languages 
http://hardwarefun.com 60
Disadvantage of Raspberry Pi 
 Accessing hardware is not real-time. If the CPU is 
busy, then interfacing with hardware can be delayed 
 No built-in Analog to Digital converter available 
 Does not have enough power to drive inductive loads 
 The hardware design is not open source. Even though 
it is not a big deal, for some people it might a deal 
breaker 
http://hardwarefun.com 61
Advantages of Arduino 
 Very easy to get started 
 Very easy to extend it and has tons of user 
contributed shields and libraries. Shields are available 
to do pretty much anything 
 Can be used to for real-time applications 
 Everything (both hardware, software and IDE) are 
open source 
 Not much programming knowledge needed to do 
basic stuff 
http://hardwarefun.com 62
Disadvantages of Arduino 
 Not very powerful when compared with Raspberry Pi 
(Micro processor vs Micro controller) 
 You need to program using either Arduino or C/C++ 
(or assembly if you really want to) 
 Connecting to internet is slightly difficult (you have 
shields and libraries, but is not straight forward), but 
not impossible. 
http://hardwarefun.com 63
In Short.. 
Feature Raspberry Pi Arduino 
Processor Speed 700 MHz 16 MHz 
Programming Language No limit Arduino, C/C++ 
Real-time Hardware No real-time In real-time 
Analog to Digital Convertor No Yes 
Hardware Design Closed source Open source 
Internet Connection Very easy Not easy, but doable 
http://hardwarefun.com 64
My Solution? 
http://hardwarefun.com 65
Use both together  
Best of both worlds 
http://hardwarefun.com 66 
http://learn.adafruit.com/assets/3199 http://learn.adafruit.com/assets/2123
Links 
 Source code - https://github.com/sudar/raspberry-pi-sketches/ 
 My blog - http://hardwarefun.com 
 Python GPIO - https://code.google.com/p/raspberry-gpio- 
python/ 
 Distributed computing using Pi - 
http://www.cl.cam.ac.uk/projects/raspberrypi/tutorial 
s/distributed-computing/ 
http://hardwarefun.com 67
Links 
 Arduino – http://arduino.cc 
 Asimi – A simple bot using Arduino 
http://hardwarefun.com/project/asimi 
 Getting started with hardware programming 
http://hardwarefun.com/tutorials/getting-started-with-hardware- 
programming 
 Getting started with Arduino 
http://hardwarefun.com/tutorials/getting-started-with-arduino- 
and-avr 
http://hardwarefun.com 68
Questions 
Thank You 
Sudar Muthu (@sudarmuthu) 
http://hardwarefun.com/ 
https://github.com/sudar/arduino-robotics-workshop 
https://github.com/sudar/raspberry-pi-sketches 
http://hardwarefun.com 69

More Related Content

What's hot (20)

Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
Pantech ProLabs India Pvt Ltd
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
Emmanuel Obot
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
 
Presentation on Raspberry pi
Presentation on Raspberry piPresentation on Raspberry pi
Presentation on Raspberry pi
OpenDev
 
Internet of things (IOT) Presentation-PPT
Internet of things (IOT) Presentation-PPTInternet of things (IOT) Presentation-PPT
Internet of things (IOT) Presentation-PPT
Charan Vimala
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
eddy royappa
 
FPGA
FPGAFPGA
FPGA
subin mathew
 
Home automation using internet of things
Home automation using internet of thingsHome automation using internet of things
Home automation using internet of things
Abhishek Bhadoria
 
Single Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi BasicsSingle Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi Basics
Eueung Mulyana
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
creatjet3d labs
 
Iot ppt
Iot pptIot ppt
Iot ppt
Bharathi chelladurai
 
IoT Networking
IoT NetworkingIoT Networking
IoT Networking
Hitesh Mohapatra
 
Components of IOT Implementation
Components of IOT ImplementationComponents of IOT Implementation
Components of IOT Implementation
Aashiq Ahamed N
 
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
Pradip Bhandari
 
Arduino vs Raspberry Pi
Arduino vs Raspberry PiArduino vs Raspberry Pi
Arduino vs Raspberry Pi
Jitendra Adhikari
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
Anija Nair
 
Internet of Things Using Arduino
Internet of Things Using ArduinoInternet of Things Using Arduino
Internet of Things Using Arduino
Pantech ProLabs India Pvt Ltd
 
connecting smart object in IoT.pptx
connecting smart object in IoT.pptxconnecting smart object in IoT.pptx
connecting smart object in IoT.pptx
AnisZahirahAzman
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Interfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the WorldInterfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the World
Omer Kilic
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
Emmanuel Obot
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
Vishnu
 
Presentation on Raspberry pi
Presentation on Raspberry piPresentation on Raspberry pi
Presentation on Raspberry pi
OpenDev
 
Internet of things (IOT) Presentation-PPT
Internet of things (IOT) Presentation-PPTInternet of things (IOT) Presentation-PPT
Internet of things (IOT) Presentation-PPT
Charan Vimala
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
eddy royappa
 
Home automation using internet of things
Home automation using internet of thingsHome automation using internet of things
Home automation using internet of things
Abhishek Bhadoria
 
Single Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi BasicsSingle Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi Basics
Eueung Mulyana
 
Components of IOT Implementation
Components of IOT ImplementationComponents of IOT Implementation
Components of IOT Implementation
Aashiq Ahamed N
 
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
Pradip Bhandari
 
connecting smart object in IoT.pptx
connecting smart object in IoT.pptxconnecting smart object in IoT.pptx
connecting smart object in IoT.pptx
AnisZahirahAzman
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Interfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the WorldInterfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the World
Omer Kilic
 

Similar to Using arduino and raspberry pi for internet of things (20)

Arduino - Learning.pdf
Arduino - Learning.pdfArduino - Learning.pdf
Arduino - Learning.pdf
KhalilSedki1
 
Arduino
ArduinoArduino
Arduino
Jerin John
 
Getting started with arduino workshop
Getting started with arduino workshopGetting started with arduino workshop
Getting started with arduino workshop
Sudar Muthu
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
Sudar Muthu
 
Getting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and ArduinoGetting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
M.Tech Internet of Things Unit - III.pptx
M.Tech Internet of Things Unit - III.pptxM.Tech Internet of Things Unit - III.pptx
M.Tech Internet of Things Unit - III.pptx
AvinashAvuthu2
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
mkarlin14
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
Arvind Singh
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
Felipe Belarmino
 
02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf
engsharaf2025
 
#startathon2.0 - Arduino
#startathon2.0 - Arduino#startathon2.0 - Arduino
#startathon2.0 - Arduino
sl2square
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011
ΚΔΑΠ Δήμου Θέρμης
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
DO!MAKERS
 
13223971.ppt
13223971.ppt13223971.ppt
13223971.ppt
SuYee13
 
Internet of Things prescribed by University
Internet of Things prescribed by UniversityInternet of Things prescribed by University
Internet of Things prescribed by University
Sanjay Kumar
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
Arduino, Raspberry Pi, and Making
Arduino, Raspberry Pi, and MakingArduino, Raspberry Pi, and Making
Arduino, Raspberry Pi, and Making
LeMasney Consulting
 
Introduction to Arduino Webinar
Introduction to Arduino WebinarIntroduction to Arduino Webinar
Introduction to Arduino Webinar
Fragiskos Fourlas
 
Arduino - Learning.pdf
Arduino - Learning.pdfArduino - Learning.pdf
Arduino - Learning.pdf
KhalilSedki1
 
Getting started with arduino workshop
Getting started with arduino workshopGetting started with arduino workshop
Getting started with arduino workshop
Sudar Muthu
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
Sudar Muthu
 
Getting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and ArduinoGetting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
M.Tech Internet of Things Unit - III.pptx
M.Tech Internet of Things Unit - III.pptxM.Tech Internet of Things Unit - III.pptx
M.Tech Internet of Things Unit - III.pptx
AvinashAvuthu2
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
mkarlin14
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
Felipe Belarmino
 
02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf02 Sensors and Actuators Understand .pdf
02 Sensors and Actuators Understand .pdf
engsharaf2025
 
#startathon2.0 - Arduino
#startathon2.0 - Arduino#startathon2.0 - Arduino
#startathon2.0 - Arduino
sl2square
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
DO!MAKERS
 
13223971.ppt
13223971.ppt13223971.ppt
13223971.ppt
SuYee13
 
Internet of Things prescribed by University
Internet of Things prescribed by UniversityInternet of Things prescribed by University
Internet of Things prescribed by University
Sanjay Kumar
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
Arduino, Raspberry Pi, and Making
Arduino, Raspberry Pi, and MakingArduino, Raspberry Pi, and Making
Arduino, Raspberry Pi, and Making
LeMasney Consulting
 
Introduction to Arduino Webinar
Introduction to Arduino WebinarIntroduction to Arduino Webinar
Introduction to Arduino Webinar
Fragiskos Fourlas
 
Ad

More from Sudar Muthu (20)

A quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress MeetupA quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress Meetup
Sudar Muthu
 
WordPress Developer tools
WordPress Developer toolsWordPress Developer tools
WordPress Developer tools
Sudar Muthu
 
WordPress Developer Tools to increase productivity
WordPress Developer Tools to increase productivityWordPress Developer Tools to increase productivity
WordPress Developer Tools to increase productivity
Sudar Muthu
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
Sudar Muthu
 
Unit testing in php
Unit testing in phpUnit testing in php
Unit testing in php
Sudar Muthu
 
How arduino helped me in life
How arduino helped me in lifeHow arduino helped me in life
How arduino helped me in life
Sudar Muthu
 
Having fun with hardware
Having fun with hardwareHaving fun with hardware
Having fun with hardware
Sudar Muthu
 
Python in raspberry pi
Python in raspberry piPython in raspberry pi
Python in raspberry pi
Sudar Muthu
 
Hack 101 at IIT Kanpur
Hack 101 at IIT KanpurHack 101 at IIT Kanpur
Hack 101 at IIT Kanpur
Sudar Muthu
 
PureCSS open hack 2013
PureCSS open hack 2013PureCSS open hack 2013
PureCSS open hack 2013
Sudar Muthu
 
Pig workshop
Pig workshopPig workshop
Pig workshop
Sudar Muthu
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2
Sudar Muthu
 
Hands on Hadoop and pig
Hands on Hadoop and pigHands on Hadoop and pig
Hands on Hadoop and pig
Sudar Muthu
 
Lets make robots
Lets make robotsLets make robots
Lets make robots
Sudar Muthu
 
Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)
Sudar Muthu
 
Controlling robots using javascript
Controlling robots using javascriptControlling robots using javascript
Controlling robots using javascript
Sudar Muthu
 
Picture perfect hacks with flickr API
Picture perfect hacks with flickr APIPicture perfect hacks with flickr API
Picture perfect hacks with flickr API
Sudar Muthu
 
Hacking 101
Hacking 101Hacking 101
Hacking 101
Sudar Muthu
 
Capabilities of Arduino
Capabilities of ArduinoCapabilities of Arduino
Capabilities of Arduino
Sudar Muthu
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
Sudar Muthu
 
A quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress MeetupA quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress Meetup
Sudar Muthu
 
WordPress Developer tools
WordPress Developer toolsWordPress Developer tools
WordPress Developer tools
Sudar Muthu
 
WordPress Developer Tools to increase productivity
WordPress Developer Tools to increase productivityWordPress Developer Tools to increase productivity
WordPress Developer Tools to increase productivity
Sudar Muthu
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
Sudar Muthu
 
Unit testing in php
Unit testing in phpUnit testing in php
Unit testing in php
Sudar Muthu
 
How arduino helped me in life
How arduino helped me in lifeHow arduino helped me in life
How arduino helped me in life
Sudar Muthu
 
Having fun with hardware
Having fun with hardwareHaving fun with hardware
Having fun with hardware
Sudar Muthu
 
Python in raspberry pi
Python in raspberry piPython in raspberry pi
Python in raspberry pi
Sudar Muthu
 
Hack 101 at IIT Kanpur
Hack 101 at IIT KanpurHack 101 at IIT Kanpur
Hack 101 at IIT Kanpur
Sudar Muthu
 
PureCSS open hack 2013
PureCSS open hack 2013PureCSS open hack 2013
PureCSS open hack 2013
Sudar Muthu
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2
Sudar Muthu
 
Hands on Hadoop and pig
Hands on Hadoop and pigHands on Hadoop and pig
Hands on Hadoop and pig
Sudar Muthu
 
Lets make robots
Lets make robotsLets make robots
Lets make robots
Sudar Muthu
 
Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)
Sudar Muthu
 
Controlling robots using javascript
Controlling robots using javascriptControlling robots using javascript
Controlling robots using javascript
Sudar Muthu
 
Picture perfect hacks with flickr API
Picture perfect hacks with flickr APIPicture perfect hacks with flickr API
Picture perfect hacks with flickr API
Sudar Muthu
 
Capabilities of Arduino
Capabilities of ArduinoCapabilities of Arduino
Capabilities of Arduino
Sudar Muthu
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
Sudar Muthu
 
Ad

Recently uploaded (20)

ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdfENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FMESupporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptxFIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptxFIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdfENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FMESupporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptxFIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptxFIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 

Using arduino and raspberry pi for internet of things

  • 1. Using Arduino and Raspberry Pi for Internet of Things Sudar Muthu (@sudarmuthu) http://hardwarefun.com/ http://github.com/sudar
  • 2. Who am I?  Research Engineer by profession  I build robots as a hobby  Playing with Arduino for more than 4 years  Blogger about Arduino at http://hardwarefun.com  Moderator for Arduino India forum http://hardwarefun.com 2
  • 3. Objective  Introduce Arduino  Introduce Raspberry Pi  Emphasis on IoT  See how both can be used for IoT http://hardwarefun.com 3
  • 5. What is Arduino?  Visual Basic for hardware  Includes both Hardware and software http://hardwarefun.com 5 Photo credit Arduino team
  • 6. Different Arduino types  Arduino Uno (The one I am going to use today)  Arduino Mega  Arduino Due  Lillypad  Arduino BT  Arduino Ethernet  .. and clones http://hardwarefun.com 6
  • 7. Getting to know the Arduino http://hardwarefun.com 7
  • 8. Specs (Uno, Leonardo) Type Value Microcontroller ATmega328 Operating Voltage 5v Digital I/O Pins 14 (of which 6 provide PWM output) Analog Input Pins 6 Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader SRAM 2 KB (ATmega328) EEPROM 1 KB (ATmega328) Clock Speed 16 MHz http://hardwarefun.com 8
  • 9. Identify these components in  Microcontroller  Power jacket  USB jacket  Digital pins  Analog pins  Reset button Arduino http://hardwarefun.com 9
  • 10. Identify these components in Arduino  Voltage Regulator  Power Pins (how many are there?)  Ground Pins (how many are there?)  Vin Pin  Rx and Tx Pins  ICSP Headers http://hardwarefun.com 10
  • 11. Identify these components in  Power Led  Rx and Tx Led’s  Test Led  Crystal  Anything else? Arduino http://hardwarefun.com 11
  • 12. Powering up Arduino http://hardwarefun.com 12
  • 13. Different ways to power up Arduino  Using USB cable  Using DC power jacket  Giving voltage directly into Vin pin  Giving regulated voltage directly into 5V pin http://hardwarefun.com 13
  • 14. Setting up Arduino http://hardwarefun.com 14
  • 15. Testing the setup with a “Hello World” program http://hardwarefun.com 15
  • 17. Making a LED blink  Insert a LED in pin 13  Open File->Examples->Basics->Blink  Select Tools->Boards->Arduino Uno  Select File->Upload (or press ctrl+u)  You should get the message “Done upload”  Your Led should blink  Congrats you can program Arduino now  http://hardwarefun.com 17
  • 18. People with electronics background Did I miss anything? http://hardwarefun.com 18
  • 19. People with electronics background Did I miss anything? Hint: Ohm’s Law http://hardwarefun.com 19
  • 20. Anatomy of an Arduino sketch http://hardwarefun.com 20
  • 21. Printing values through Serial  Uno has one UART hardware port, using which we can exchange information with computer  Very useful for debugging  Works at a specified baud rate  Use Serial Monitor to read values  SoftwareSerial is also available http://hardwarefun.com 21
  • 23. How to use a breadboard  The first two and the last two rows are connected  In all the other rows, columns are connected  Connect the first and last row to power  Connect the second and second last row to ground http://hardwarefun.com 23
  • 24. Digital Input and Output http://hardwarefun.com 24
  • 26. Digital Output The LED blink that we did at “setting up Arduino” is Digital output http://hardwarefun.com 26
  • 28. Reading Analog values from sensors  Connect the LDR on pin A0 and Gnd  LDR’s resistance varies based on the amount of light present  Read the current value using analogRead()  Print the value in Serial Monitor http://hardwarefun.com 28
  • 29. Control an LED based on light void setup(){ pinMode(13, OUTPUT); } void loop(){ int val = analogRead(A0); if (val > 50) { digitalWrite(13, HIGH); } else { digitalWrite(13, LOW); } } http://hardwarefun.com 29
  • 31. Analog Output  What is PWM?  Analog like behavior using digital output  Works by switching the LED on and off regularly  Changing the brightness of a Led http://hardwarefun.com 31
  • 32. This is just the tip of an iceberg http://hardwarefun.com 32 There are tons of other features to Arduino which I have not talked about
  • 33. Internet of Things http://hardwarefun.com 33
  • 34. http://hardwarefun.com 34 "Internet of Things" by Wilgengebroed on Flickr
  • 35. LoT is an overloaded term But I like this definition… “The Internet of Things is the interconnection of uniquely identifiable embedded computing devices within the existing Internet infrastructure” http://hardwarefun.com 35
  • 36. Connecting Arduino to Internet  Ethernet Shield  WIFI Shield  3G Shield  Using another intermediate component http://hardwarefun.com 36
  • 37. Demo of network connectivity using Arduino http://hardwarefun.com 37
  • 38. Let’s take a break  http://hardwarefun.com 38
  • 40. Credit Card Sized Computer http://hardwarefun.com 40
  • 41. GPIO Pins http://hardwarefun.com 41 http://learn.adafruit.com/assets/3052
  • 42. Setup Python sudo apt-get install python-dev sudo apt-get install python-rpi.gpio http://hardwarefun.com 42
  • 43. Set the status of GPIO Pins https://github.com/sudar/r http://hardwarefun.com asp4b3erry-pi-sketches/blob/master/led-blink/led-blink.py
  • 44. Set the status of GPIO Pins import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(12, GPIO.OUT) try: while True: GPIO.output(12, GPIO.HIGH) time.sleep(1) GPIO.output(12, GPIO.LOW) time.sleep(1) finally: GPIO.cleanup() https://github.com/sudar/raspberry-http://hardwarefun.com 44 pi-sketches/blob/master/led-blink/led-blink.py
  • 45. Demo Let there be Light https://github.com/sudar/r http://hardwarefun.com 45aspberry-pi-sketches/blob/master/led-blink/led-blink.py
  • 46. Changing the brightness of the LED import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(12, GPIO.OUT) p = GPIO.PWM(12, 50) # channel=12 frequency=50Hz p.start(0) try: while True: for dc in range(0, 101, 5): p.ChangeDutyCycle(dc) time.sleep(0.1) for dc in range(100, -1, -5): p.ChangeDutyCycle(dc) time.sleep(0.1) finally: p.stop() GPIO.cleanup() http://hardwarefun.com 46 https://github.com/sudar/raspberry-pi-sketches/blob/master/led-blink/pwm.py
  • 47. Demo Can you see the brightness changing? https://github.com/sudar/raspberry-http://hardwarefun.com 47 pi-sketches/blob/master/led-blink/pwm.py
  • 48. Reading the status of the Pin import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) try: while True: if GPIO.input(11): print "Button is on" else: print "Button is off" time.sleep(0.1) finally: GPIO.cleanup() http://hardwarefun.com 48 https://github.com/sudar/raspberry-pi-sketches/blob/master/button-input/button-input.py
  • 49. Reading the status of the Pin http://hardwarefun.com 49 https://github.com/sudar/raspberry-pi-sketches/blob/master/button-input/button-input.py
  • 50. Demo What happens when the button is pressed? http://hardwarefun.com 50 https://github.com/sudar/raspberry-pi-sketches/blob/master/button-input/button-input.py
  • 51. Combining Input and Output import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(12, GPIO.OUT) try: while True: if GPIO.input(11): print "Button is on" GPIO.output(12, 1) else: GPIO.output(12, 0) time.sleep(0.1) finally: GPIO.cleanup() http://hardwarefun.com 51 https://github.com/sudar/raspberry-pi-sketches/blob/master/button-and-led/button-and-led.py
  • 52. Combining Input and Output http://hardwarefun.com 52 https://github.com/sudar/raspberry-pi-sketches/blob/master/button-and-led/button-and-led.py
  • 53. Demo Let’s control the LED by pressing the button http://hardwarefun.com 53 https://github.com/sudar/raspberry-pi-sketches/blob/master/button-and-led/button-and-led.py
  • 54. What more can be done? http://hardwarefun.com 54
  • 55. More protocols  I2C  SPI  Serial http://hardwarefun.com 55
  • 56. Interacting with webcam  “PyGame” provides easy interface  Can get fancy using “opencv”  Both USB and GPIO interface are supported http://hardwarefun.com 56
  • 57. Distributed Computing  Each Pi can be used as cheap node  Form grids using a cluster of Pi’s  Can share CPU, memory and disk space http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/ distributed-computing/ http://hardwarefun.com 57
  • 58. Limitations  No built-in Analog to Digital support  Can’t run Inductive load (motors)  Is not real-time (CPU might be busy)  No “safe circuits” present  Operates at 3.3V and is not directly compatible with Arduino voltage http://hardwarefun.com 58
  • 59. Arduino vs Raspberry Pi for IoT http://hardwarefun.com 59
  • 60. Advantages of Raspberry Pi  Entire Linux software stack is available  It is very easy to connect to internet  Can be programmed using variety of programming languages http://hardwarefun.com 60
  • 61. Disadvantage of Raspberry Pi  Accessing hardware is not real-time. If the CPU is busy, then interfacing with hardware can be delayed  No built-in Analog to Digital converter available  Does not have enough power to drive inductive loads  The hardware design is not open source. Even though it is not a big deal, for some people it might a deal breaker http://hardwarefun.com 61
  • 62. Advantages of Arduino  Very easy to get started  Very easy to extend it and has tons of user contributed shields and libraries. Shields are available to do pretty much anything  Can be used to for real-time applications  Everything (both hardware, software and IDE) are open source  Not much programming knowledge needed to do basic stuff http://hardwarefun.com 62
  • 63. Disadvantages of Arduino  Not very powerful when compared with Raspberry Pi (Micro processor vs Micro controller)  You need to program using either Arduino or C/C++ (or assembly if you really want to)  Connecting to internet is slightly difficult (you have shields and libraries, but is not straight forward), but not impossible. http://hardwarefun.com 63
  • 64. In Short.. Feature Raspberry Pi Arduino Processor Speed 700 MHz 16 MHz Programming Language No limit Arduino, C/C++ Real-time Hardware No real-time In real-time Analog to Digital Convertor No Yes Hardware Design Closed source Open source Internet Connection Very easy Not easy, but doable http://hardwarefun.com 64
  • 66. Use both together  Best of both worlds http://hardwarefun.com 66 http://learn.adafruit.com/assets/3199 http://learn.adafruit.com/assets/2123
  • 67. Links  Source code - https://github.com/sudar/raspberry-pi-sketches/  My blog - http://hardwarefun.com  Python GPIO - https://code.google.com/p/raspberry-gpio- python/  Distributed computing using Pi - http://www.cl.cam.ac.uk/projects/raspberrypi/tutorial s/distributed-computing/ http://hardwarefun.com 67
  • 68. Links  Arduino – http://arduino.cc  Asimi – A simple bot using Arduino http://hardwarefun.com/project/asimi  Getting started with hardware programming http://hardwarefun.com/tutorials/getting-started-with-hardware- programming  Getting started with Arduino http://hardwarefun.com/tutorials/getting-started-with-arduino- and-avr http://hardwarefun.com 68
  • 69. Questions Thank You Sudar Muthu (@sudarmuthu) http://hardwarefun.com/ https://github.com/sudar/arduino-robotics-workshop https://github.com/sudar/raspberry-pi-sketches http://hardwarefun.com 69

Editor's Notes

  • #35: "Internet of Things" by Wilgengebroed on Flickr - Cropped and sign removed from Internet of things signed by the author.jpg. Licensed under Creative Commons Attribution 2.0 via Wikimedia Commons - http://commons.wikimedia.org/wiki/File:Internet_of_Things.jpg#mediaviewer/File:Internet_of_Things.jpg