SlideShare a Scribd company logo
1 of 13
ICT and Programming
Project 2:Buzzer
Alarm with Light
Mr Gee, Amir, Ms Siti
Science Educators
STEM INC
Science Centre Singapore
What do these things have in
common?
Objective
In this project, you will learn to use the Arduino to:
•Produce light in an LED and sound through a buzzer
What You Will Need
Breadboard Red LED
100 Ω resistor Jumper wires
Piezo buzzer
Setup
The Arduino Integrated
Development Environment (IDE)
Creating the sketch:
Step 1: Double click the icon to open up the IDE
Let’s get to coding!
Buzzer Alarm with Light
int ledPin = 13; // LED connected to pin 13
int tonePin = 8; // buzzer alarm connected
to pin 8
void setup()
{
pinMode(ledPin, OUTPUT); // sets the buzzer alarm as
output
}
Let’s get to coding!
void loop() // run over and over again forever
{
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the
voltage level)
tone (tonePin, 200, 250); // play a tone on tone pin with 200
Hz and 250 ms
delay(500); // wait for 0.5 s
digitalWrite(ledPin, LOW); // turn the LED off (LOW is the
voltage level)
tone (tonePin, 600, 250); // Play a tone on tone pin with 600
Hz and 250 ms
delay(500); // wait for 0.5 s
}
Uploading the Sketch
Step 1: Click the Verify/Compile button and check for errors in
the code.
Step 2: Click the Upload button.
Let’s think!
1. What happens in the circuit after the code was uploaded?
2. Change the value highlighted in yellow to a higher value, say
500. Compile/Verify the program before uploading the program
again. What happens?
3. Change the value highlighted in yellow to a lower value, say
100. Compile/Verify the program before uploading the program
again. What happens?
Let’s think!
1. Change the circled number to a lower value, say 100.
Compile/Verify the program before uploading the program
again. What happens?
The first beep is at lower pitch.
2. Try changing the underlined value to a higher value, say 600.
Compile/Verify the program before uploading the program
again. What happens?
The first beep remains on for a longer time.(600 ms)
Challenge
Listen to the alarm played by the educator. Can you create
something similar to that?
What have you learnt?
• The tone function in a sketch
• The function of the piezo buzzer
• Relationship between frequency and sound

More Related Content

Viewers also liked

Flourescent tube light
Flourescent tube lightFlourescent tube light
Flourescent tube lightwaqas ashraf
 
Basic Fire Alarm Systems
Basic Fire Alarm SystemsBasic Fire Alarm Systems
Basic Fire Alarm Systemsmalcolmfd
 
Fire alarm system (sistem penggera kebakaran)
Fire alarm system (sistem penggera kebakaran)Fire alarm system (sistem penggera kebakaran)
Fire alarm system (sistem penggera kebakaran)Nurul Husna
 
Intro to basic fire alarm technology
Intro to basic fire alarm technologyIntro to basic fire alarm technology
Intro to basic fire alarm technologyArman Nasar
 
Presentation on battery
Presentation on batteryPresentation on battery
Presentation on batterySheikh Aves
 
Lead-Acid Battery Simplified Simulink Model using MATLAB
Lead-Acid Battery Simplified Simulink Model using MATLAB Lead-Acid Battery Simplified Simulink Model using MATLAB
Lead-Acid Battery Simplified Simulink Model using MATLAB Tsuyoshi Horigome
 
Fire Detection and Alarm Systems
Fire Detection and Alarm SystemsFire Detection and Alarm Systems
Fire Detection and Alarm SystemsJ.T.A.JONES
 
Fire drill procedure
Fire drill procedureFire drill procedure
Fire drill procedureMaria Hidalgo
 
lead acid battery
lead acid batterylead acid battery
lead acid battery2461998
 
Characteristics Of Cell And Lead Acid Battery
Characteristics Of Cell And Lead Acid BatteryCharacteristics Of Cell And Lead Acid Battery
Characteristics Of Cell And Lead Acid BatteryDeepakreddy suram
 
Lecture on Lead Acid Battery
Lecture on Lead Acid BatteryLecture on Lead Acid Battery
Lecture on Lead Acid BatteryAniket Singh
 

Viewers also liked (15)

Back to Basics
Back to BasicsBack to Basics
Back to Basics
 
Fluorescent lamps
Fluorescent lampsFluorescent lamps
Fluorescent lamps
 
Flourescent tube light
Flourescent tube lightFlourescent tube light
Flourescent tube light
 
Basic Fire Alarm Systems
Basic Fire Alarm SystemsBasic Fire Alarm Systems
Basic Fire Alarm Systems
 
Fundamentals of Fire Alarm System
Fundamentals of Fire Alarm SystemFundamentals of Fire Alarm System
Fundamentals of Fire Alarm System
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Fire alarm system (sistem penggera kebakaran)
Fire alarm system (sistem penggera kebakaran)Fire alarm system (sistem penggera kebakaran)
Fire alarm system (sistem penggera kebakaran)
 
Intro to basic fire alarm technology
Intro to basic fire alarm technologyIntro to basic fire alarm technology
Intro to basic fire alarm technology
 
Presentation on battery
Presentation on batteryPresentation on battery
Presentation on battery
 
Lead-Acid Battery Simplified Simulink Model using MATLAB
Lead-Acid Battery Simplified Simulink Model using MATLAB Lead-Acid Battery Simplified Simulink Model using MATLAB
Lead-Acid Battery Simplified Simulink Model using MATLAB
 
Fire Detection and Alarm Systems
Fire Detection and Alarm SystemsFire Detection and Alarm Systems
Fire Detection and Alarm Systems
 
Fire drill procedure
Fire drill procedureFire drill procedure
Fire drill procedure
 
lead acid battery
lead acid batterylead acid battery
lead acid battery
 
Characteristics Of Cell And Lead Acid Battery
Characteristics Of Cell And Lead Acid BatteryCharacteristics Of Cell And Lead Acid Battery
Characteristics Of Cell And Lead Acid Battery
 
Lecture on Lead Acid Battery
Lecture on Lead Acid BatteryLecture on Lead Acid Battery
Lecture on Lead Acid Battery
 

Similar to Presentation

Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
Arduino frequency counter
Arduino frequency counterArduino frequency counter
Arduino frequency counternasyith_hananur
 
Exploring new ways to interact with the Internet of Things.
Exploring new ways to interact with the Internet of Things.Exploring new ways to interact with the Internet of Things.
Exploring new ways to interact with the Internet of Things.Kevin Rohling
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.pptZainIslam20
 
NSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoNSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoBrian Huang
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonGabriel Arnautu
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)Brian Huang
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
Blinking a Single LED
Blinking a Single LEDBlinking a Single LED
Blinking a Single LEDRihab Rahman
 
arduino
 arduino arduino
arduinojhcid
 
Fundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.pptFundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.pptansariparveen06
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfssuser0e9cc4
 
Display Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayDisplay Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayRihab Rahman
 
iPad communication apps - iTech
iPad communication apps - iTechiPad communication apps - iTech
iPad communication apps - iTechRedwoodAT
 

Similar to Presentation (20)

Beginning arduino
Beginning arduinoBeginning arduino
Beginning arduino
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Arduino frequency counter
Arduino frequency counterArduino frequency counter
Arduino frequency counter
 
Exploring new ways to interact with the Internet of Things.
Exploring new ways to interact with the Internet of Things.Exploring new ways to interact with the Internet of Things.
Exploring new ways to interact with the Internet of Things.
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
NSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and ArduinoNSTA 2013 Denver - ArduBlock and Arduino
NSTA 2013 Denver - ArduBlock and Arduino
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel Edison
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Blinking a Single LED
Blinking a Single LEDBlinking a Single LED
Blinking a Single LED
 
arduino
 arduino arduino
arduino
 
Fundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.pptFundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.ppt
 
Arduino wk2
Arduino wk2Arduino wk2
Arduino wk2
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
 
Display Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayDisplay Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment Display
 
Ks3 computing-l1
Ks3 computing-l1Ks3 computing-l1
Ks3 computing-l1
 
Ks3 computing-l1
Ks3 computing-l1Ks3 computing-l1
Ks3 computing-l1
 
iPad communication apps - iTech
iPad communication apps - iTechiPad communication apps - iTech
iPad communication apps - iTech
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

Presentation

  • 1. ICT and Programming Project 2:Buzzer Alarm with Light Mr Gee, Amir, Ms Siti Science Educators STEM INC Science Centre Singapore
  • 2. What do these things have in common?
  • 3. Objective In this project, you will learn to use the Arduino to: •Produce light in an LED and sound through a buzzer
  • 4. What You Will Need Breadboard Red LED 100 Ω resistor Jumper wires Piezo buzzer
  • 6. The Arduino Integrated Development Environment (IDE) Creating the sketch: Step 1: Double click the icon to open up the IDE
  • 7. Let’s get to coding! Buzzer Alarm with Light int ledPin = 13; // LED connected to pin 13 int tonePin = 8; // buzzer alarm connected to pin 8 void setup() { pinMode(ledPin, OUTPUT); // sets the buzzer alarm as output }
  • 8. Let’s get to coding! void loop() // run over and over again forever { digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) tone (tonePin, 200, 250); // play a tone on tone pin with 200 Hz and 250 ms delay(500); // wait for 0.5 s digitalWrite(ledPin, LOW); // turn the LED off (LOW is the voltage level) tone (tonePin, 600, 250); // Play a tone on tone pin with 600 Hz and 250 ms delay(500); // wait for 0.5 s }
  • 9. Uploading the Sketch Step 1: Click the Verify/Compile button and check for errors in the code. Step 2: Click the Upload button.
  • 10. Let’s think! 1. What happens in the circuit after the code was uploaded? 2. Change the value highlighted in yellow to a higher value, say 500. Compile/Verify the program before uploading the program again. What happens? 3. Change the value highlighted in yellow to a lower value, say 100. Compile/Verify the program before uploading the program again. What happens?
  • 11. Let’s think! 1. Change the circled number to a lower value, say 100. Compile/Verify the program before uploading the program again. What happens? The first beep is at lower pitch. 2. Try changing the underlined value to a higher value, say 600. Compile/Verify the program before uploading the program again. What happens? The first beep remains on for a longer time.(600 ms)
  • 12. Challenge Listen to the alarm played by the educator. Can you create something similar to that?
  • 13. What have you learnt? • The tone function in a sketch • The function of the piezo buzzer • Relationship between frequency and sound