SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
First-year Physical Geography Taster Sessions
Dr Thomas Smith
INTELLIGENT TWEETING SENSORS:
INTRODUCING ARDUINO MICROCONTROLLERS
THE BASICS OF ARDUINO MICROCONTROLLERS
• Open source hardware
• Open source development kit
• User community driven
WHAT DO THEY DO?
• Digital I/O (LEDs, switches)
• Analogue I/O (resistive sensor data)
• Serial connection (sensors, GPS, etc.)
• Programmable from your PC/Mac/Linux
• Your limit is only your creativity!!
TERMINOLOGY
• I/O Board – main microcontroller
• Shield – add-on boards
• Sketch – the program
• Sensor – components (thermistors, etc.)
• Modules – serial data (GPS module, etc.)
14 current boards
ARDUINO I/O BOARDS
SHIELDS
SHIELDS
Touchscreen Shield
Wave Shield
Datalogging Shield
COMMUNICATION SHIELDS
Ethernet Shield GSM Shield Wifi Shield
Gas Sensor Temp & Humidity
Flex Sensor
Fingerprint Scanner
Geiger Counter
SENSORS
Photo/thermistor, infared, force sensitive resistor, Hall effect,
Piezo, tilt sensor..
SENSORS
SKETCHES
Includes
Globals
void setup()
void loop()
HANDLING THE ARDUINO – HOW NOT TO DO IT!
Improper Handling - NEVER!!!
HANDLING THE ARDUINO – THE PROPER WAY
Proper Handling - by the edges!!!
TRY IT OUT 1: VERY SIMPLE LED BLINKING PROGRAM
int ledpin = 13;
int del = 2000;
void setup()
{
pinMode(ledpin, OUTPUT);
}
void loop()
{
digitalWrite(ledpin, HIGH);
delay(del);
digitalWrite(ledpin, LOW);
delay(del);
}
TRY IT OUT 1: VERY SIMPLE LED BLINKING PROGRAM
int ledpin = 13;
int del = 2000;
void setup()
{
pinMode(ledpin, OUTPUT);
}
void loop()
{
digitalWrite(ledpin, HIGH);
delay(del);
digitalWrite(ledpin, LOW);
delay(del);
}
Global variables
Tells the Arduino that the LED is on pin 13
Delay between blinks as 2000 milliseconds
Setup
Tells the Arduino that pin 13 should be set as
an output
Loop
Sets pin 13 to provide 5 volts (HIGH)
Delays for specified length of time (del)
Sets pin 13 to provide 0 volts (LOW)
Delays for specified length of time (del)
TRY IT OUT 1: VERY SIMPLE LED BLINKING PROGRAM
int ledpin = 13;
int del = 2000;
void setup()
{
pinMode(ledpin, OUTPUT);
}
void loop()
{
digitalWrite(ledpin, HIGH);
delay(del);
digitalWrite(ledpin, LOW);
delay(del);
}
TRY IT OUT 2: LIGHT DEPENDENT RESISTOR & LED
int LDR_Pin = A0;
void setup(){
Serial.begin(9600);
}
void loop(){
int LDRReading = analogRead(LDR_Pin);
Serial.println(LDRReading);
delay(500);
}
Serial
This is a way by which your Arduino can “speak”
with a computer
Serial.begin opens the communications channel
Serial.print/Serial.println will “print” a message
ADDING “IF” STATEMENTS
If/else
Try to make your LED turn on when the light drops below a
certain level… add this code to your sketch
if (LDRReading < 500)
{
digitalWrite(ledpin, HIGH);
}
else
{
digitalWrite(ledpin, LOW);
}
TWEETING SENSORS 1: “SOMEONE’S RAIDING THE FRIDGE!”
WEATHER SENSOR NETWORKS
SENSOR NETWORK EXAMPLE: BIRMINGHAM
• The primary focus of the Birmingham Urban Climate project is to
provide a series of demonstration sensor networks to measure air
temperature
• The design is a nested network of sensors:
• ~30 full weather stations [coarse array]
• 131 air temperature sensors located in schools [wide array]
• ~100 air temperature sensors in the CBD (approx 50 sensors
per square km) [fine array]
• Birmingham will become the most densely instrumented urban area
in the world.
• The coarse array consists
of ~30 full weather stations
located across Birmingham.
• Urban equipment will be
located in secure primary
electricity substations (schools
in areas without substations)
• Further 4 in
the surrounding rural areas
to record background
conditions (i.e. Sandwell park,
rural schools)
• Average spacing: 3km
N
COARSE ARRAY NETWORK
• A full suite of weather variables will be
measured (air temperature, humidity,
wind speed, wind direction,
barometric pressure, precipitation,
solar radiation).
• Data loggers (CR1000),
communications and mountings
(Campbell Scientific)
• Vaisala WXT520 – precipitation,
wind speed, wind direction,
temperature, relative humidity,
pressure
• SKYE SKS1110 pyranometer
• Data Communication: GSM/GPRS
EQUIPMENT: WEATHER STATIONS
WIDE AREA ARRAY NETWORK
• The wide area array consists
of 131 air temperature
sensors located in schools
• Plus a few in ‘rural’ schools
/parks/farms outside
conurbation
• One per ONS medium super
output area (MSOA)
• Average spacing: 1.5 km
• Data communication: WiFi
via BGfL
EQUIPMENT: AIR TEMPERATURE SENSORS
• The air temperature sensors
(thermistor) and radiation shield are
a bespoke design from Aginova,
USA.
• Small and inexpensive (approx. £87)
• Data is relayed via existing WiFi
networks
• Battery life is estimated at 3 years
(checked annually)
Aginova Micro
• ‘Low-Cost’ Thermistor Temperature
probe (-30 to 70 °C)
• Precision 0.1 °C
• Accuracy ± 0.3 °C (20 °C)
• Stores data when |ΔTt – ΔTt-1| ≥ 0.1 °C
• Ability to store approx. 10 days data
• Secure Wifi data transmission back to
server through school wireless network
• Server hosted software collects data
from whole network and stores in
database
TRY IT OUT 3: MINI WEATHER STATION
Open the “WeatherStation” sketch
Upload to the Arduino
Check out the “Serial Monitor”
TWEETING SENSORS 2: TEMPERATURE RECORDS
How could you use an “if” statement
and some extra variables to record
maximum and minimum
temperatures
How about printing these as
messages?
We could then tweet the messages
(to cheat, look at
weatherstation_minmax)
SOIL MOISTURE AND DROUGHT MONITORING NETWORKS
COMPONENTS OF A FAMINE EARLY WARNING SYSTEM
• Rainfall
• Soil moisture
• Crop condition
• Socio-economics
FEWS: RAINFALL
Global Telecommunication System
Rain-Gauge Network in Africa
-40
-20
0
20
40
-20 0 20 40 60
Longitude (deg)
Latitude(deg)
FEWS: RAINFALL
Spatial
Temporal
FEWS: VEGETATION CONDITION
FEWS: VEGETATION CONDITION
Spatial
Temporal
COMBINED DATASETS TO PREDICT FAMINE
Found at http://www.fews.net
SOIL MOISTURE FROM SPACE
TRY IT OUT 4: SOIL MOISTURE SENSOR
int delaySecs = 5;
void setup() {
Serial.begin(9600);
Serial.println("values: 0-1024 ");
}
void loop() {
int raw_value = analogRead(A0);
Serial.print(" ");
Serial.println(raw_value);
delay(1000*delaySecs);
}
TRY IT OUT 5: CALIBRATED SOIL MOISTURE
Convert raw output to voltage:
volt_value = raw_value/1024*5
Convert voltage into moisture:
moisture = (volt_value*4.44–0.5)/8.4*100
(to cheat, look at
thetaprobe_calibrated)
TWEETING SENSORS 3: “WATER ME!”
How could you use
an “if” statement
and some extra
variables to send a
message when the
soil is too dry?
THANK YOU
thomas.smith@kcl.ac.uk
@DrTELS
@KCLGEOGRAPHY
facebook.com/KCLGeography
K7.47
Office Hours:
Mondays 16:00–17:00
Fridays 15:00–16:00

Weitere ähnliche Inhalte

Was ist angesagt?

Connectivity for Smart Home IoT - Brad Kayton
Connectivity for Smart Home IoT - Brad KaytonConnectivity for Smart Home IoT - Brad Kayton
Connectivity for Smart Home IoT - Brad Kayton
WithTheBest
 

Was ist angesagt? (20)

Smart Meter Reader
Smart Meter ReaderSmart Meter Reader
Smart Meter Reader
 
Iot based fire alarm system
Iot based fire alarm systemIot based fire alarm system
Iot based fire alarm system
 
Connectivity for Smart Home IoT - Brad Kayton
Connectivity for Smart Home IoT - Brad KaytonConnectivity for Smart Home IoT - Brad Kayton
Connectivity for Smart Home IoT - Brad Kayton
 
Fire detection system using arduino
Fire detection system using arduino Fire detection system using arduino
Fire detection system using arduino
 
Track 4 session 3 - st dev con 2016 - pedestrian dead reckoning
Track 4   session 3 - st dev con 2016 - pedestrian dead reckoningTrack 4   session 3 - st dev con 2016 - pedestrian dead reckoning
Track 4 session 3 - st dev con 2016 - pedestrian dead reckoning
 
GSM Based SMS fire alert system
GSM Based SMS fire alert systemGSM Based SMS fire alert system
GSM Based SMS fire alert system
 
IoT Based Fire Alarm and Monitoring System
IoT Based Fire Alarm and Monitoring SystemIoT Based Fire Alarm and Monitoring System
IoT Based Fire Alarm and Monitoring System
 
SMART WIRELESS SENSOR
SMART WIRELESS SENSORSMART WIRELESS SENSOR
SMART WIRELESS SENSOR
 
Iot based fire department alerting system
Iot based fire department alerting systemIot based fire department alerting system
Iot based fire department alerting system
 
Internet of the land
Internet of the landInternet of the land
Internet of the land
 
DATA ACQUISITION (DAQ) IN LABVIEW
DATA  ACQUISITION (DAQ) IN LABVIEWDATA  ACQUISITION (DAQ) IN LABVIEW
DATA ACQUISITION (DAQ) IN LABVIEW
 
PIR sensing with arduino
PIR sensing  with  arduinoPIR sensing  with  arduino
PIR sensing with arduino
 
Design and Construction of GSM Based Fire Alarm System using PIC Microcontroller
Design and Construction of GSM Based Fire Alarm System using PIC MicrocontrollerDesign and Construction of GSM Based Fire Alarm System using PIC Microcontroller
Design and Construction of GSM Based Fire Alarm System using PIC Microcontroller
 
Analog vs digital
Analog vs digitalAnalog vs digital
Analog vs digital
 
Nimble Wireless Inc. Company Overview
Nimble Wireless Inc. Company OverviewNimble Wireless Inc. Company Overview
Nimble Wireless Inc. Company Overview
 
How physical sensors in IoT work, what they can do and what they cannot.
How physical sensors in IoT work, what they can do and what they cannot.How physical sensors in IoT work, what they can do and what they cannot.
How physical sensors in IoT work, what they can do and what they cannot.
 
Internet of Things Technology for Fire Monitoring System
Internet of Things Technology  for Fire Monitoring SystemInternet of Things Technology  for Fire Monitoring System
Internet of Things Technology for Fire Monitoring System
 
IoT Introduction
IoT Introduction IoT Introduction
IoT Introduction
 
IOT based Intelligence for Fire Emergency Response
IOT based Intelligence for Fire Emergency ResponseIOT based Intelligence for Fire Emergency Response
IOT based Intelligence for Fire Emergency Response
 
Presentation group 1
Presentation group 1Presentation group 1
Presentation group 1
 

Andere mochten auch

Gsm based lcd notice board display
Gsm based lcd notice board displayGsm based lcd notice board display
Gsm based lcd notice board display
Ravi M
 

Andere mochten auch (17)

Safe heart
Safe heartSafe heart
Safe heart
 
Building of heart beat rate monitor &amp; object detector by md syeduzzaman s...
Building of heart beat rate monitor &amp; object detector by md syeduzzaman s...Building of heart beat rate monitor &amp; object detector by md syeduzzaman s...
Building of heart beat rate monitor &amp; object detector by md syeduzzaman s...
 
HEART RATE MONITOR
HEART RATE MONITORHEART RATE MONITOR
HEART RATE MONITOR
 
Biomedical Instrumentation Presentation on Infrared Emitter-Detector and Ardu...
Biomedical Instrumentation Presentation on Infrared Emitter-Detector and Ardu...Biomedical Instrumentation Presentation on Infrared Emitter-Detector and Ardu...
Biomedical Instrumentation Presentation on Infrared Emitter-Detector and Ardu...
 
Smart Health & Arduino
Smart Health & ArduinoSmart Health & Arduino
Smart Health & Arduino
 
ICIECA 2014 Paper 03
ICIECA 2014 Paper 03ICIECA 2014 Paper 03
ICIECA 2014 Paper 03
 
GSM BASED FIRE ALARM SYSTEM
GSM BASED FIRE ALARM SYSTEMGSM BASED FIRE ALARM SYSTEM
GSM BASED FIRE ALARM SYSTEM
 
Arduino based health monitoring system
Arduino based health monitoring systemArduino based health monitoring system
Arduino based health monitoring system
 
automatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technologyautomatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technology
 
Continuous heart rate and body temperature monitoring system using arduino un...
Continuous heart rate and body temperature monitoring system using arduino un...Continuous heart rate and body temperature monitoring system using arduino un...
Continuous heart rate and body temperature monitoring system using arduino un...
 
Heart beat detector using arduino
Heart beat detector using arduinoHeart beat detector using arduino
Heart beat detector using arduino
 
Gsm based home automation
Gsm based home automationGsm based home automation
Gsm based home automation
 
Biomedical engineering (BME)
Biomedical engineering (BME)Biomedical engineering (BME)
Biomedical engineering (BME)
 
Biomedical instrumentation PPT
Biomedical instrumentation PPTBiomedical instrumentation PPT
Biomedical instrumentation PPT
 
Gsm based lcd notice board display
Gsm based lcd notice board displayGsm based lcd notice board display
Gsm based lcd notice board display
 
Heart beat monitor using AT89S52 microcontroller
Heart beat monitor using AT89S52 microcontrollerHeart beat monitor using AT89S52 microcontroller
Heart beat monitor using AT89S52 microcontroller
 
Full gsm overview (modified)
Full gsm overview  (modified)Full gsm overview  (modified)
Full gsm overview (modified)
 

Ähnlich wie Introduction to Arduinos for Environmental Applications

Data Acquisition System and Data loggers
Data Acquisition System and Data loggersData Acquisition System and Data loggers
Data Acquisition System and Data loggers
Swara Dave
 

Ähnlich wie Introduction to Arduinos for Environmental Applications (20)

weather monitoiring system.pptx
weather monitoiring system.pptxweather monitoiring system.pptx
weather monitoiring system.pptx
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)Microcontrollers (Rex St. John)
Microcontrollers (Rex St. John)
 
Tinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptxTinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptx
 
Iot for smart agriculture
Iot for smart agricultureIot for smart agriculture
Iot for smart agriculture
 
arduino introduction for vocational students
arduino introduction for vocational studentsarduino introduction for vocational students
arduino introduction for vocational students
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Data Acquisition System and Data loggers
Data Acquisition System and Data loggersData Acquisition System and Data loggers
Data Acquisition System and Data loggers
 
WiTS Final Poster
WiTS Final PosterWiTS Final Poster
WiTS Final Poster
 
International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)
 
Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...
 
B1_25Jan21.pptx
B1_25Jan21.pptxB1_25Jan21.pptx
B1_25Jan21.pptx
 
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
 
B41012015
B41012015B41012015
B41012015
 
Oop2018 tutorial-stal-mo2-io t-arduino-en
Oop2018 tutorial-stal-mo2-io t-arduino-enOop2018 tutorial-stal-mo2-io t-arduino-en
Oop2018 tutorial-stal-mo2-io t-arduino-en
 
Data acquisition system
Data acquisition systemData acquisition system
Data acquisition system
 
FIRE ALARM SYSTEM PPT.pptx
FIRE ALARM SYSTEM PPT.pptxFIRE ALARM SYSTEM PPT.pptx
FIRE ALARM SYSTEM PPT.pptx
 
Wireless sensors
Wireless sensorsWireless sensors
Wireless sensors
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

Introduction to Arduinos for Environmental Applications

  • 1. First-year Physical Geography Taster Sessions Dr Thomas Smith INTELLIGENT TWEETING SENSORS: INTRODUCING ARDUINO MICROCONTROLLERS
  • 2.
  • 3. THE BASICS OF ARDUINO MICROCONTROLLERS • Open source hardware • Open source development kit • User community driven
  • 4. WHAT DO THEY DO? • Digital I/O (LEDs, switches) • Analogue I/O (resistive sensor data) • Serial connection (sensors, GPS, etc.) • Programmable from your PC/Mac/Linux • Your limit is only your creativity!!
  • 5. TERMINOLOGY • I/O Board – main microcontroller • Shield – add-on boards • Sketch – the program • Sensor – components (thermistors, etc.) • Modules – serial data (GPS module, etc.)
  • 9. COMMUNICATION SHIELDS Ethernet Shield GSM Shield Wifi Shield
  • 10. Gas Sensor Temp & Humidity Flex Sensor Fingerprint Scanner Geiger Counter SENSORS
  • 11. Photo/thermistor, infared, force sensitive resistor, Hall effect, Piezo, tilt sensor.. SENSORS
  • 13. HANDLING THE ARDUINO – HOW NOT TO DO IT! Improper Handling - NEVER!!!
  • 14. HANDLING THE ARDUINO – THE PROPER WAY Proper Handling - by the edges!!!
  • 15. TRY IT OUT 1: VERY SIMPLE LED BLINKING PROGRAM int ledpin = 13; int del = 2000; void setup() { pinMode(ledpin, OUTPUT); } void loop() { digitalWrite(ledpin, HIGH); delay(del); digitalWrite(ledpin, LOW); delay(del); }
  • 16. TRY IT OUT 1: VERY SIMPLE LED BLINKING PROGRAM int ledpin = 13; int del = 2000; void setup() { pinMode(ledpin, OUTPUT); } void loop() { digitalWrite(ledpin, HIGH); delay(del); digitalWrite(ledpin, LOW); delay(del); } Global variables Tells the Arduino that the LED is on pin 13 Delay between blinks as 2000 milliseconds Setup Tells the Arduino that pin 13 should be set as an output Loop Sets pin 13 to provide 5 volts (HIGH) Delays for specified length of time (del) Sets pin 13 to provide 0 volts (LOW) Delays for specified length of time (del)
  • 17. TRY IT OUT 1: VERY SIMPLE LED BLINKING PROGRAM int ledpin = 13; int del = 2000; void setup() { pinMode(ledpin, OUTPUT); } void loop() { digitalWrite(ledpin, HIGH); delay(del); digitalWrite(ledpin, LOW); delay(del); }
  • 18. TRY IT OUT 2: LIGHT DEPENDENT RESISTOR & LED int LDR_Pin = A0; void setup(){ Serial.begin(9600); } void loop(){ int LDRReading = analogRead(LDR_Pin); Serial.println(LDRReading); delay(500); } Serial This is a way by which your Arduino can “speak” with a computer Serial.begin opens the communications channel Serial.print/Serial.println will “print” a message
  • 19. ADDING “IF” STATEMENTS If/else Try to make your LED turn on when the light drops below a certain level… add this code to your sketch if (LDRReading < 500) { digitalWrite(ledpin, HIGH); } else { digitalWrite(ledpin, LOW); }
  • 20. TWEETING SENSORS 1: “SOMEONE’S RAIDING THE FRIDGE!”
  • 22. SENSOR NETWORK EXAMPLE: BIRMINGHAM • The primary focus of the Birmingham Urban Climate project is to provide a series of demonstration sensor networks to measure air temperature • The design is a nested network of sensors: • ~30 full weather stations [coarse array] • 131 air temperature sensors located in schools [wide array] • ~100 air temperature sensors in the CBD (approx 50 sensors per square km) [fine array] • Birmingham will become the most densely instrumented urban area in the world.
  • 23. • The coarse array consists of ~30 full weather stations located across Birmingham. • Urban equipment will be located in secure primary electricity substations (schools in areas without substations) • Further 4 in the surrounding rural areas to record background conditions (i.e. Sandwell park, rural schools) • Average spacing: 3km N COARSE ARRAY NETWORK
  • 24. • A full suite of weather variables will be measured (air temperature, humidity, wind speed, wind direction, barometric pressure, precipitation, solar radiation). • Data loggers (CR1000), communications and mountings (Campbell Scientific) • Vaisala WXT520 – precipitation, wind speed, wind direction, temperature, relative humidity, pressure • SKYE SKS1110 pyranometer • Data Communication: GSM/GPRS EQUIPMENT: WEATHER STATIONS
  • 25. WIDE AREA ARRAY NETWORK • The wide area array consists of 131 air temperature sensors located in schools • Plus a few in ‘rural’ schools /parks/farms outside conurbation • One per ONS medium super output area (MSOA) • Average spacing: 1.5 km • Data communication: WiFi via BGfL
  • 26. EQUIPMENT: AIR TEMPERATURE SENSORS • The air temperature sensors (thermistor) and radiation shield are a bespoke design from Aginova, USA. • Small and inexpensive (approx. £87) • Data is relayed via existing WiFi networks • Battery life is estimated at 3 years (checked annually) Aginova Micro • ‘Low-Cost’ Thermistor Temperature probe (-30 to 70 °C) • Precision 0.1 °C • Accuracy ± 0.3 °C (20 °C) • Stores data when |ΔTt – ΔTt-1| ≥ 0.1 °C • Ability to store approx. 10 days data • Secure Wifi data transmission back to server through school wireless network • Server hosted software collects data from whole network and stores in database
  • 27. TRY IT OUT 3: MINI WEATHER STATION Open the “WeatherStation” sketch Upload to the Arduino Check out the “Serial Monitor”
  • 28. TWEETING SENSORS 2: TEMPERATURE RECORDS How could you use an “if” statement and some extra variables to record maximum and minimum temperatures How about printing these as messages? We could then tweet the messages (to cheat, look at weatherstation_minmax)
  • 29. SOIL MOISTURE AND DROUGHT MONITORING NETWORKS
  • 30. COMPONENTS OF A FAMINE EARLY WARNING SYSTEM • Rainfall • Soil moisture • Crop condition • Socio-economics
  • 31. FEWS: RAINFALL Global Telecommunication System Rain-Gauge Network in Africa -40 -20 0 20 40 -20 0 20 40 60 Longitude (deg) Latitude(deg)
  • 35. COMBINED DATASETS TO PREDICT FAMINE Found at http://www.fews.net
  • 37. TRY IT OUT 4: SOIL MOISTURE SENSOR int delaySecs = 5; void setup() { Serial.begin(9600); Serial.println("values: 0-1024 "); } void loop() { int raw_value = analogRead(A0); Serial.print(" "); Serial.println(raw_value); delay(1000*delaySecs); }
  • 38. TRY IT OUT 5: CALIBRATED SOIL MOISTURE Convert raw output to voltage: volt_value = raw_value/1024*5 Convert voltage into moisture: moisture = (volt_value*4.44–0.5)/8.4*100 (to cheat, look at thetaprobe_calibrated)
  • 39. TWEETING SENSORS 3: “WATER ME!” How could you use an “if” statement and some extra variables to send a message when the soil is too dry?