SlideShare a Scribd company logo
1 of 29
Download to read offline
standard Arduino workshop 2017
Hands-on Arduino: the next step
Tom Tobback
www.cassiopeia.hk
2018
standard Arduino workshop 2017
some of Tom’s projects
cassiopeia.hk/category/projects/
standard Arduino workshop 2017
Before we start… check the connection between your
Arduino board and your laptop:
● plugin your Arduino board USB cable into your laptop
● open Arduino IDE software (www.arduino.cc)
● open the Blink sketch from File>Examples>Basic
● pick the correct port from Tools>Serial Port
● pick the correct board type from Tools>Board “Uno”
● hit ‘upload’ to test the connection
● look for ‘Done uploading’ and check if the onboard LED
is blinking
standard Arduino workshop 2017
Introduction project
standard Arduino workshop 2017
Introduction project
COMMANDS
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
digitalWrite(13, LOW);
delay(1000);
pot_value = analogRead(A0);
tone(3, 1000);
noTone(3);
Serial.begin();
Serial.println(pot_value);
STRUCTURE
int pot_value;
void setup() {
}
void loop() {
}
standard Arduino workshop 2017
Warm-up: Servo
Using libraries: Servo
File > Examples > Servo > Sweep
#include <Servo.h>
Servo myservo;
myservo.attach(9);
myservo.write(90);
standard Arduino workshop 2017
Warm-up: Servo
File > Examples > Servo > Knob
potpin = A0
standard Arduino workshop 2017
Next step project
Using libraries:
LCD screen
DHT sensor
standard Arduino workshop 2017
Next step project
standard Arduino workshop 2017
standard Arduino workshop 2017
Arduino pin map ‘pinout’
GPIO: general purpose input/output
ADC: analog input
PWM: pulse width modulation
RX/TX: serial
SDA/SCL: I2C
MISO/MOSI/SCK: SPI
INT: interrupt
AREF: analog reference
Vin: input voltage
RESET
standard Arduino workshop 2017
Breadboard = connections
standard Arduino workshop 2017
Breadboard power rails
5V to red line
GND to blue line
Optional:
connect to other side
standard Arduino workshop 2017
Arduino libraries
Some common libraries
are already included in
the IDE
Other libraries have to
be added as you need
them:
● library manager
● add .zip file
● add manually in
library folder
standard Arduino workshop 2017
LCD library: LiquidCrystal
Already included in the IDE
Each library comes with examples: a good starting point
Go to File > Examples > LiquidCrystal > HelloWorld
standard Arduino workshop 2017
LCD wiring
Find the wiring details in the comments
or google ‘arduino lcd’ for images
standard Arduino workshop 2017
LCD coding
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(4,0);
lcd.print(“hello DSL”);
standard Arduino workshop 2017
DHT sensor
Temperature and Humidity sensor (not very accurate)
Vcc = 5V
Data
GND
One digital pin for data transfer (specific digital protocol)
standard Arduino workshop 2017
DHT library
Not included in IDE, need to add
Go to: Sketch > Include Library > Manage Libraries..
Search for ‘DHT’ and install the Adafruit library
in browser, search for ‘github adafruit unified sensor’
https://github.com/adafruit/Adafruit_Sensor
‘clone or download’ download ZIP
Go to: Sketch > Include Library >
Add .ZIP library
standard Arduino workshop 2017
DHT library
File > Examples > DHT sensor library > DHTtester
DHTPIN 6
DHTTYPE DHT11
Upload
Open Serial Monitor
standard Arduino workshop 2017
LCD + DHT sketch
Copy lines from DHT sketch into LCD sketch
in loop:
Read DHT sensor
Display temp and humidity on the LCD
Wait 2 seconds
standard Arduino workshop 2017
Add buzzer for temp alarm
in loop:
Read DHT sensor
Display temp and humidity on the LCD
If temp > 30deg: buzzer beeps
Wait 2 seconds
standard Arduino workshop 2017
Add pot for temp alarm
in loop:
Read DHT sensor
Read temp alarm pot
Display temp, alarm, hum on the LCD
If temp > alarm: buzzer beeps
Wait 2 seconds
standard Arduino workshop 2017
Add button for hum alarm
in loop:
Read DHT sensor
If button pressed: read hum alarm
else: read temp alarm
Display temp, hum, alarms on the LCD
If temp > alarm OR hum > alarm:
buzzer beeps
Wait 2 seconds
standard Arduino workshop 2017
Use timestamp instead of delay
in loop:
If button pressed: read hum alarm
else: read temp alarm
Display temp, hum, alarms on the LCD
If temp > alarm OR hum > alarm:
buzzer beeps
If 2 seconds passed:
read DHT sensor
standard Arduino workshop 2017
Use timestamp
unsigned long timestamp = 0;
void loop() {
[code here is executed every loop]
if (millis() - timestamp > 2000) {
[code here only every 2 seconds]
read sensor
timestamp = millis();
}
}
standard Arduino workshop 2017
Arduino: suppliers
ONLINE
➔ Official Arduino shop: http://arduino.cc/
great documentation, projects, forum
➔ Seeedstudio: http://www.seeedstudio.com/depot/
➔ Telesky: https://telesky.world.tmall.com/
➔ Adafruit: http://www.adafruit.com/ great documentation
IN HONG KONG - Apliu St
➔ WECL http://www.weclonline.com/wecl_eng/index.html
➔ Tell How http://tellhow-tech.com/
standard Arduino workshop 2017
Dimsum Labs
the hackerspace of HK www.dimsumlabs.com/
community of technology enthusiasts
space for creativity in Sheung Wan
Tuesday evening HackJam
www.facebook.com/groups/hackjamhk/
standard Arduino workshop 2017
Thank you
www.cassiopeia.hk
Happy tinkering!

More Related Content

Similar to Cassiopeia ltd Arduino follow-up workshop 2018

Embedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxEmbedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptx
aartis110
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay Sharma
 

Similar to Cassiopeia ltd Arduino follow-up workshop 2018 (20)

Up and running with Arduino
Up and running with Arduino Up and running with Arduino
Up and running with Arduino
 
What is arduino
What is arduinoWhat is arduino
What is arduino
 
Advanced View Arduino Projects List - Use Arduino for Projects.pdf
Advanced View Arduino Projects List - Use Arduino for Projects.pdfAdvanced View Arduino Projects List - Use Arduino for Projects.pdf
Advanced View Arduino Projects List - Use Arduino for Projects.pdf
 
Advanced view arduino projects list use arduino for projects
Advanced view arduino projects list   use arduino for projectsAdvanced view arduino projects list   use arduino for projects
Advanced view arduino projects list use arduino for projects
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Ardublock tutorial
Ardublock tutorialArdublock tutorial
Ardublock tutorial
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
ESP32 WiFi & Bluetooth Module - Getting Started Guide
ESP32 WiFi & Bluetooth Module - Getting Started GuideESP32 WiFi & Bluetooth Module - Getting Started Guide
ESP32 WiFi & Bluetooth Module - Getting Started Guide
 
Embedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptxEmbedded L1_notes_unit2_architecture.pptx
Embedded L1_notes_unit2_architecture.pptx
 
Using arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of thingsUsing arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of things
 
Ardu
ArduArdu
Ardu
 
Advanced View Arduino Projects List - Use Arduino for Projects-2.pdf
Advanced View Arduino Projects List - Use Arduino for Projects-2.pdfAdvanced View Arduino Projects List - Use Arduino for Projects-2.pdf
Advanced View Arduino Projects List - Use Arduino for Projects-2.pdf
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Es project sensor
Es project sensorEs project sensor
Es project sensor
 
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
 
Esp8266 v12
Esp8266 v12Esp8266 v12
Esp8266 v12
 
Audible Objects
Audible ObjectsAudible Objects
Audible Objects
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel Edison
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Cassiopeia ltd Arduino follow-up workshop 2018

  • 1. standard Arduino workshop 2017 Hands-on Arduino: the next step Tom Tobback www.cassiopeia.hk 2018
  • 2. standard Arduino workshop 2017 some of Tom’s projects cassiopeia.hk/category/projects/
  • 3. standard Arduino workshop 2017 Before we start… check the connection between your Arduino board and your laptop: ● plugin your Arduino board USB cable into your laptop ● open Arduino IDE software (www.arduino.cc) ● open the Blink sketch from File>Examples>Basic ● pick the correct port from Tools>Serial Port ● pick the correct board type from Tools>Board “Uno” ● hit ‘upload’ to test the connection ● look for ‘Done uploading’ and check if the onboard LED is blinking
  • 4. standard Arduino workshop 2017 Introduction project
  • 5. standard Arduino workshop 2017 Introduction project COMMANDS pinMode(13, OUTPUT); digitalWrite(13, HIGH); digitalWrite(13, LOW); delay(1000); pot_value = analogRead(A0); tone(3, 1000); noTone(3); Serial.begin(); Serial.println(pot_value); STRUCTURE int pot_value; void setup() { } void loop() { }
  • 6. standard Arduino workshop 2017 Warm-up: Servo Using libraries: Servo File > Examples > Servo > Sweep #include <Servo.h> Servo myservo; myservo.attach(9); myservo.write(90);
  • 7. standard Arduino workshop 2017 Warm-up: Servo File > Examples > Servo > Knob potpin = A0
  • 8. standard Arduino workshop 2017 Next step project Using libraries: LCD screen DHT sensor
  • 9. standard Arduino workshop 2017 Next step project
  • 11. standard Arduino workshop 2017 Arduino pin map ‘pinout’ GPIO: general purpose input/output ADC: analog input PWM: pulse width modulation RX/TX: serial SDA/SCL: I2C MISO/MOSI/SCK: SPI INT: interrupt AREF: analog reference Vin: input voltage RESET
  • 12. standard Arduino workshop 2017 Breadboard = connections
  • 13. standard Arduino workshop 2017 Breadboard power rails 5V to red line GND to blue line Optional: connect to other side
  • 14. standard Arduino workshop 2017 Arduino libraries Some common libraries are already included in the IDE Other libraries have to be added as you need them: ● library manager ● add .zip file ● add manually in library folder
  • 15. standard Arduino workshop 2017 LCD library: LiquidCrystal Already included in the IDE Each library comes with examples: a good starting point Go to File > Examples > LiquidCrystal > HelloWorld
  • 16. standard Arduino workshop 2017 LCD wiring Find the wiring details in the comments or google ‘arduino lcd’ for images
  • 17. standard Arduino workshop 2017 LCD coding lcd.begin(16,2); lcd.clear(); lcd.setCursor(4,0); lcd.print(“hello DSL”);
  • 18. standard Arduino workshop 2017 DHT sensor Temperature and Humidity sensor (not very accurate) Vcc = 5V Data GND One digital pin for data transfer (specific digital protocol)
  • 19. standard Arduino workshop 2017 DHT library Not included in IDE, need to add Go to: Sketch > Include Library > Manage Libraries.. Search for ‘DHT’ and install the Adafruit library in browser, search for ‘github adafruit unified sensor’ https://github.com/adafruit/Adafruit_Sensor ‘clone or download’ download ZIP Go to: Sketch > Include Library > Add .ZIP library
  • 20. standard Arduino workshop 2017 DHT library File > Examples > DHT sensor library > DHTtester DHTPIN 6 DHTTYPE DHT11 Upload Open Serial Monitor
  • 21. standard Arduino workshop 2017 LCD + DHT sketch Copy lines from DHT sketch into LCD sketch in loop: Read DHT sensor Display temp and humidity on the LCD Wait 2 seconds
  • 22. standard Arduino workshop 2017 Add buzzer for temp alarm in loop: Read DHT sensor Display temp and humidity on the LCD If temp > 30deg: buzzer beeps Wait 2 seconds
  • 23. standard Arduino workshop 2017 Add pot for temp alarm in loop: Read DHT sensor Read temp alarm pot Display temp, alarm, hum on the LCD If temp > alarm: buzzer beeps Wait 2 seconds
  • 24. standard Arduino workshop 2017 Add button for hum alarm in loop: Read DHT sensor If button pressed: read hum alarm else: read temp alarm Display temp, hum, alarms on the LCD If temp > alarm OR hum > alarm: buzzer beeps Wait 2 seconds
  • 25. standard Arduino workshop 2017 Use timestamp instead of delay in loop: If button pressed: read hum alarm else: read temp alarm Display temp, hum, alarms on the LCD If temp > alarm OR hum > alarm: buzzer beeps If 2 seconds passed: read DHT sensor
  • 26. standard Arduino workshop 2017 Use timestamp unsigned long timestamp = 0; void loop() { [code here is executed every loop] if (millis() - timestamp > 2000) { [code here only every 2 seconds] read sensor timestamp = millis(); } }
  • 27. standard Arduino workshop 2017 Arduino: suppliers ONLINE ➔ Official Arduino shop: http://arduino.cc/ great documentation, projects, forum ➔ Seeedstudio: http://www.seeedstudio.com/depot/ ➔ Telesky: https://telesky.world.tmall.com/ ➔ Adafruit: http://www.adafruit.com/ great documentation IN HONG KONG - Apliu St ➔ WECL http://www.weclonline.com/wecl_eng/index.html ➔ Tell How http://tellhow-tech.com/
  • 28. standard Arduino workshop 2017 Dimsum Labs the hackerspace of HK www.dimsumlabs.com/ community of technology enthusiasts space for creativity in Sheung Wan Tuesday evening HackJam www.facebook.com/groups/hackjamhk/
  • 29. standard Arduino workshop 2017 Thank you www.cassiopeia.hk Happy tinkering!