introduction to arduinos for environmental applications
DESCRIPTION
Introduction to open-source Arduino hardware and software for environmental/geographical applicationsTRANSCRIPT
![Page 1: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/1.jpg)
First-year Physical Geography Taster Sessions Dr Thomas Smith
INTELLIGENT TWEETING SENSORS: INTRODUCING ARDUINO MICROCONTROLLERS
![Page 2: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/2.jpg)
![Page 3: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/3.jpg)
THE BASICS OF ARDUINO MICROCONTROLLERS
• Open source hardware
• Open source development kit
• User community driven
![Page 4: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/4.jpg)
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!!
![Page 5: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/5.jpg)
TERMINOLOGY
• I/O Board – main microcontroller
• Shield – add-on boards
• Sketch – the program
• Sensor – components (thermistors, etc.)
• Modules – serial data (GPS module, etc.)
![Page 6: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/6.jpg)
14 current boards
ARDUINO I/O BOARDS
![Page 7: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/7.jpg)
SHIELDS
![Page 8: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/8.jpg)
SHIELDS
Touchscreen Shield
Wave Shield
Datalogging Shield
![Page 9: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/9.jpg)
COMMUNICATION SHIELDS
Ethernet Shield GSM Shield Wifi Shield
![Page 10: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/10.jpg)
Gas Sensor Temp & Humidity
Flex Sensor
Fingerprint Scanner
Geiger Counter
SENSORS
![Page 11: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/11.jpg)
Photo/thermistor, infared, force sensitive resistor, Hall effect, Piezo, tilt sensor..
SENSORS
![Page 12: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/12.jpg)
SKETCHES
Includes
Globals
void setup()
void loop()
![Page 13: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/13.jpg)
HANDLING THE ARDUINO – HOW NOT TO DO IT!
Improper Handling - NEVER!!!
![Page 14: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/14.jpg)
HANDLING THE ARDUINO – THE PROPER WAY
Proper Handling - by the edges!!!
![Page 15: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/15.jpg)
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); }
![Page 16: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/16.jpg)
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)
![Page 17: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/17.jpg)
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); }
![Page 18: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/18.jpg)
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
![Page 19: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/19.jpg)
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); }
![Page 20: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/20.jpg)
TWEETING SENSORS 1: “SOMEONE’S RAIDING THE FRIDGE!”
![Page 21: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/21.jpg)
WEATHER SENSOR NETWORKS
![Page 22: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/22.jpg)
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.
![Page 23: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/23.jpg)
• 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
![Page 24: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/24.jpg)
• 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
![Page 25: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/25.jpg)
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
![Page 26: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/26.jpg)
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
![Page 27: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/27.jpg)
TRY IT OUT 3: MINI WEATHER STATION
Open the “WeatherStation” sketch Upload to the Arduino Check out the “Serial Monitor”
![Page 28: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/28.jpg)
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)
![Page 29: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/29.jpg)
SOIL MOISTURE AND DROUGHT MONITORING NETWORKS
![Page 30: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/30.jpg)
COMPONENTS OF A FAMINE EARLY WARNING SYSTEM
• Rainfall
• Soil moisture
• Crop condition
• Socio-economics
![Page 31: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/31.jpg)
FEWS: RAINFALL
Global Telecommunication System
Rain-Gauge Network in Africa
-40
-20
0
20
40
-20 0 20 40 60
Longitude (deg)
Lati
tud
e (
deg
)
![Page 32: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/32.jpg)
FEWS: RAINFALL
Spatial
Temporal
![Page 33: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/33.jpg)
FEWS: VEGETATION CONDITION
![Page 34: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/34.jpg)
FEWS: VEGETATION CONDITION
Spatial
Temporal
![Page 35: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/35.jpg)
COMBINED DATASETS TO PREDICT FAMINE
Found at http://www.fews.net
![Page 36: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/36.jpg)
SOIL MOISTURE FROM SPACE
![Page 37: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/37.jpg)
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); }
![Page 38: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/38.jpg)
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)
![Page 39: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/39.jpg)
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?
![Page 40: Introduction to Arduinos for Environmental Applications](https://reader034.vdocument.in/reader034/viewer/2022042714/5552c185b4c90581158b47e0/html5/thumbnails/40.jpg)
THANK YOU
[email protected] @DrTELS @KCLGEOGRAPHY facebook.com/KCLGeography K7.47 Office Hours: Mondays 16:00–17:00 Fridays 15:00–16:00