SlideShare a Scribd company logo
Arduino_Frequency_Counter -- Overview
Frequency Counting Using Arduino
Objectives:
After performing this lab exercise, learner will be able to:
Work with Arduino IDE
Program Arduino board as a simple frequency counter
Practice working with measuring equipment and laboratory tools
like digital oscilloscope and signal generator
Use digital oscilloscope to debug/analyze the circuit
Equipment:
To perform this lab experiment, learner will need:
Digital Storage Oscilloscope (TBS1000B-Edu from Tektronix or
any equivalent)
Signal generator (AFG1000 from Tektronix or equivalent) for
providing AC input to circuit
Arduino Uno or equivalent board (could be any other
openSource Arduino clone) with its USB cable
Electronic Components
Resistor (10K and 470 ohms)
Switche (Push-to-on)
LED
BNC cables
Breadboard and connecting wires
Theory / Key Concepts:
Before performing this lab experiment, it is important to learn
following concepts:
Arduino is a popular open-source microcontroller board that
support rapid prototyping of embedded systems.
Arduino also provide a custom, easy-to-use programming
environment (or IDE) for developing a program and flashing it on
the Arduino board. For more details, refer - www.arduino.cc
Arduino can be programmed as frequency counter:
Frequency input can be applied to pin # 2 of Arduino board.
This pin corresponds to interrupt 0 of the controller.
An Interrup Service Routine (ISR) can then be used to count
the number of pulses in a given time window.
Alternatively, we can find the period between successive
pulses and estimate frequency of the input signal.
A switch can be used to initiate 'counting' of the frequency
input applied to pin # 2.
The frequency estimated can be shown on the serial monitor.
Flowchart / Program:
Learner can understand the logic of frequency counter code using
given flowchart:
Arduino_Frequency_Counter -- Procedures
Step 1
Check Your Understanding:
Before performing this lab experiment, learners can check their
understanding of key concepts by answering these?
What is the command / instruction for enabling interrupt in
Arduino sketch (program)?
attachInterrupt
noInterrupts
yesInterrupts
interrrupts
For a pulse count of 12 in a measurement window of 10mS,
what will be the frequency of input signal?
12 Hz
120 Hz
1200 Hz
12000 Hz
What will happen to frequency counter if the signal input (pulse,
square wave or sinewave) has amplitude swing from 0 to 2V:
it will normal
it will report frequency as double of actual value
it will not work as signal amplitude is less than 2.5V
it will work intermittently
Step 2
Circuit diagram / Connection Details
Using the jumper / connecting wires prepare the circuit as
shown below - Choose Rpullup = 10K & RLED = 470 ohm.
Feed the output from AFG / Signal Generator to pin 2 of the
Arduino
Step 3
Experiment Setup
Make the arrangement as shown in figure below (Arduino clone is being
used here) -
PC is connected to Arduino via USB cable
Use AFG to generate a square wave and connect AFG output to
pin 2 of Arduino
Connect oscilloscope channel 1 to AFG output so that same
signal is viewable on oscilloscope (that is fed to Arduino)
Step 4
Make the Circuit Work
Flash the code on Arduino
Use signal from AFG/signal generator to feed at Pin 2 of Arduino
Set square wave from channel 1 of the AFG
amplitude = 0 - 3V
frequency = 1K Hz
Autoset the oscilloscope to see this waveforms
Press the button on Arduino pin 7 - You should see the
measurent LED getting ON for a moment and frequency value
appearing on Serial Monitor on PC.
Step 5
Taking the Measurements
Set input
Square wave, 0-3V peak-to-peak amplitude
100 Hz frequency
Continous mode (on AFG)
enable the channel 1 output on AFG
Autoset the oscilloscope to optimally see the signal
Set up following measurements:
On Ch1 - Frequency and Period
Keeping the amplitude of the square wave input fixed, vary its
frequency from 1Hz to 20kHz.
Measure frequency on oscilloscope
By pressing the push button, get measurements from Arduino,
for each input set.
Tabulate the measurements. You can also capture screenshot
for each measurement set.
Step 6
Analyzing the Result
The observation table would look like as shown below. Calculate
the % deviation of frequency measured by Arduino from actual.
Create a plot of Arduino Vs Actual frequency values
Plot the % deviation with respect to actual frequency values
Can you guess why the deviation increases to 4% for 20kHz
signal?
Step 7
Conclusion
The analysis of the observed results confirm that (As expected):
The Arduino can be used for frequency counter application
Frequency measured by Arduino system matches the actual
frequency value of the input
Deviation increases as the input frequency is increases beyond
10KHz
How to program Arduino?
STEP: 1. Obtain Arduino board (preferably Uno, Duemilanove or Leonardo model)
STEP: 2. Download the IDE from - http://arduino.cc/en/Main/Software - that is suitable for
your PC operating system (to program your Arduino board).
STEP: 3. Install the Arduino IDE software on your PC. This is how IDE would look like:
STEP: 4. Connect the Arduino board using USB cable provided to your PC. Wait till the
necessary drivers are installed and device is recognized as COM port.
STEP: 5. Select the correct Arduino Board type as show below: Tools > Board >
STEP: 6. Ensure that COM Port identified for your Arduino board is correct. You can also
change / select appropriate COM Port your Arduino is connected as from following
menu: Tools > Serial Port >
STEP: 7. Once the setting is complete, we are ready to download the program on Arduino
board. We can test the setup by programming Arduino bard with an example code
(sketch). Go to : File > Examples > 01.Basics > Blink
STEP: 8. Click on the Right Arrow button (highlighted in orange color in the image below) to
compile and upload the binary to Arduino board. Once the upload is done, you will see
‘orange LED’ on board flashing – on for 1 second and off for 1 second.
STEP: 9. Now that setup is successfully completed and tested, open the relevant program (.ino
file as specified by the lab experiment) using menu option – File > Open
STEP: 10. Using UPLOAD button (circular button with arrow pointing to right) we can compile
the program and upload the compiled binary file to Arduino board.
STEP: 11. Once the board is programmed, it will start generating signals at specified pins. The
board is ready to probe (or to connect external RC circuits) as per lab needs.

More Related Content

What's hot

CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
A B Shinde
 
M-TECH 4th SEM PRESENTATION
M-TECH 4th SEM PRESENTATIONM-TECH 4th SEM PRESENTATION
M-TECH 4th SEM PRESENTATION
Subhajit Shaw
 
Setup and hold time violation in flip-flops
Setup and hold time violation in flip-flopsSetup and hold time violation in flip-flops
Setup and hold time violation in flip-flops
Jong Hwan Shin
 
8. Valutare la usabilita'
8. Valutare la usabilita'8. Valutare la usabilita'
8. Valutare la usabilita'
Roberto Polillo
 
GUI for DRV fix in ICC2
GUI for DRV fix in ICC2GUI for DRV fix in ICC2
GUI for DRV fix in ICC2
Prashanth Chokkarapu
 
Arduino & NodeMcu
Arduino & NodeMcuArduino & NodeMcu
Arduino & NodeMcu
Guhan Ganesan
 
Vhdl 1 ppg
Vhdl 1 ppgVhdl 1 ppg
Vhdl 1 ppg
Akshay Nagpurkar
 
Introduction to 8051 Timer/Counter
Introduction to 8051 Timer/CounterIntroduction to 8051 Timer/Counter
Introduction to 8051 Timer/Counter
Sudhanshu Janwadkar
 
Bilbo 1
Bilbo 1Bilbo 1
Bilbo 1
Naveenkumar G
 
Scan insertion
Scan insertionScan insertion
Scan insertion
kumar gavanurmath
 
Develop a shadow sensor alarm using IC 741
Develop a shadow sensor alarm using IC 741Develop a shadow sensor alarm using IC 741
Develop a shadow sensor alarm using IC 741
Ashish Sadavarti
 
UVM Methodology Tutorial
UVM Methodology TutorialUVM Methodology Tutorial
UVM Methodology Tutorial
Arrow Devices
 
Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)
Usha Mehta
 
Code conversion using verilog code VHDL
Code conversion using verilog code VHDL Code conversion using verilog code VHDL
Code conversion using verilog code VHDL
Bharti Airtel Ltd.
 
Simple Metal Detector Circuit Diagram and Working
Simple Metal Detector Circuit Diagram and WorkingSimple Metal Detector Circuit Diagram and Working
Simple Metal Detector Circuit Diagram and Working
elprocus
 
Metal detector robot
Metal detector robotMetal detector robot
Metal detector robot
f114n
 
Standard-Cells.pdf
Standard-Cells.pdfStandard-Cells.pdf
Standard-Cells.pdf
Ahmed Abdelazeem
 
Automatic street light control system
Automatic street light control systemAutomatic street light control system
Automatic street light control system
ahsen nasim
 
Universal Serial Bus (USB)
Universal Serial Bus (USB)Universal Serial Bus (USB)
Universal Serial Bus (USB)
OECLIB Odisha Electronics Control Library
 
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTHAUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
Abhinav Maggu
 

What's hot (20)

CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
 
M-TECH 4th SEM PRESENTATION
M-TECH 4th SEM PRESENTATIONM-TECH 4th SEM PRESENTATION
M-TECH 4th SEM PRESENTATION
 
Setup and hold time violation in flip-flops
Setup and hold time violation in flip-flopsSetup and hold time violation in flip-flops
Setup and hold time violation in flip-flops
 
8. Valutare la usabilita'
8. Valutare la usabilita'8. Valutare la usabilita'
8. Valutare la usabilita'
 
GUI for DRV fix in ICC2
GUI for DRV fix in ICC2GUI for DRV fix in ICC2
GUI for DRV fix in ICC2
 
Arduino & NodeMcu
Arduino & NodeMcuArduino & NodeMcu
Arduino & NodeMcu
 
Vhdl 1 ppg
Vhdl 1 ppgVhdl 1 ppg
Vhdl 1 ppg
 
Introduction to 8051 Timer/Counter
Introduction to 8051 Timer/CounterIntroduction to 8051 Timer/Counter
Introduction to 8051 Timer/Counter
 
Bilbo 1
Bilbo 1Bilbo 1
Bilbo 1
 
Scan insertion
Scan insertionScan insertion
Scan insertion
 
Develop a shadow sensor alarm using IC 741
Develop a shadow sensor alarm using IC 741Develop a shadow sensor alarm using IC 741
Develop a shadow sensor alarm using IC 741
 
UVM Methodology Tutorial
UVM Methodology TutorialUVM Methodology Tutorial
UVM Methodology Tutorial
 
Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)
 
Code conversion using verilog code VHDL
Code conversion using verilog code VHDL Code conversion using verilog code VHDL
Code conversion using verilog code VHDL
 
Simple Metal Detector Circuit Diagram and Working
Simple Metal Detector Circuit Diagram and WorkingSimple Metal Detector Circuit Diagram and Working
Simple Metal Detector Circuit Diagram and Working
 
Metal detector robot
Metal detector robotMetal detector robot
Metal detector robot
 
Standard-Cells.pdf
Standard-Cells.pdfStandard-Cells.pdf
Standard-Cells.pdf
 
Automatic street light control system
Automatic street light control systemAutomatic street light control system
Automatic street light control system
 
Universal Serial Bus (USB)
Universal Serial Bus (USB)Universal Serial Bus (USB)
Universal Serial Bus (USB)
 
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTHAUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
AUTOMATED METAL DETECTOR ROBOTIC VEHICLE WITH MANUAL CONTROL USING BLUETOOTH
 

Similar to Arduino frequency counter

Arduino
ArduinoArduino
Arduino
Geet Patel
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
Ankita Tiwari
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino
MajdyShamasneh
 
IoT Platform
IoT PlatformIoT Platform
IoT Platform
Saurabh Singh
 
IoT Platform
IoT PlatformIoT Platform
IoT Platform
Saurabh Singh
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
Ravikumar Tiwari
 
arduino uno.pptx
arduino uno.pptxarduino uno.pptx
arduino uno.pptx
NeeladriBijayMisra
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
Elaf A.Saeed
 
publish manual
publish manualpublish manual
publish manual
John Webster
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
vishal choudhary
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
Dhruwank Vankawala
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorials
Anshu Pandey
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
mkarlin14
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
yosikit826
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
Amit Kumer Podder
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshop
tomtobback
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
Zhentao Xu
 
Smart Blind stick by using arduino uno and sensor
 Smart Blind stick  by using arduino  uno  and sensor Smart Blind stick  by using arduino  uno  and sensor
Smart Blind stick by using arduino uno and sensor
Mizoram University( A Central University)
 

Similar to Arduino frequency counter (20)

Arduino
ArduinoArduino
Arduino
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino
 
IoT Platform
IoT PlatformIoT Platform
IoT Platform
 
IoT Platform
IoT PlatformIoT Platform
IoT Platform
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
arduino uno.pptx
arduino uno.pptxarduino uno.pptx
arduino uno.pptx
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
publish manual
publish manualpublish manual
publish manual
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorials
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshop
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
Smart Blind stick by using arduino uno and sensor
 Smart Blind stick  by using arduino  uno  and sensor Smart Blind stick  by using arduino  uno  and sensor
Smart Blind stick by using arduino uno and sensor
 

Recently uploaded

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 

Recently uploaded (20)

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 

Arduino frequency counter

  • 1. Arduino_Frequency_Counter -- Overview Frequency Counting Using Arduino Objectives: After performing this lab exercise, learner will be able to: Work with Arduino IDE Program Arduino board as a simple frequency counter Practice working with measuring equipment and laboratory tools like digital oscilloscope and signal generator Use digital oscilloscope to debug/analyze the circuit Equipment: To perform this lab experiment, learner will need: Digital Storage Oscilloscope (TBS1000B-Edu from Tektronix or any equivalent) Signal generator (AFG1000 from Tektronix or equivalent) for providing AC input to circuit Arduino Uno or equivalent board (could be any other openSource Arduino clone) with its USB cable Electronic Components Resistor (10K and 470 ohms) Switche (Push-to-on) LED BNC cables Breadboard and connecting wires
  • 2. Theory / Key Concepts: Before performing this lab experiment, it is important to learn following concepts: Arduino is a popular open-source microcontroller board that support rapid prototyping of embedded systems. Arduino also provide a custom, easy-to-use programming environment (or IDE) for developing a program and flashing it on the Arduino board. For more details, refer - www.arduino.cc Arduino can be programmed as frequency counter: Frequency input can be applied to pin # 2 of Arduino board. This pin corresponds to interrupt 0 of the controller. An Interrup Service Routine (ISR) can then be used to count the number of pulses in a given time window. Alternatively, we can find the period between successive pulses and estimate frequency of the input signal. A switch can be used to initiate 'counting' of the frequency input applied to pin # 2. The frequency estimated can be shown on the serial monitor. Flowchart / Program: Learner can understand the logic of frequency counter code using given flowchart:
  • 3. Arduino_Frequency_Counter -- Procedures Step 1 Check Your Understanding: Before performing this lab experiment, learners can check their understanding of key concepts by answering these? What is the command / instruction for enabling interrupt in Arduino sketch (program)? attachInterrupt noInterrupts yesInterrupts interrrupts For a pulse count of 12 in a measurement window of 10mS, what will be the frequency of input signal? 12 Hz 120 Hz 1200 Hz 12000 Hz What will happen to frequency counter if the signal input (pulse, square wave or sinewave) has amplitude swing from 0 to 2V: it will normal it will report frequency as double of actual value it will not work as signal amplitude is less than 2.5V it will work intermittently Step 2
  • 4. Circuit diagram / Connection Details Using the jumper / connecting wires prepare the circuit as shown below - Choose Rpullup = 10K & RLED = 470 ohm. Feed the output from AFG / Signal Generator to pin 2 of the Arduino Step 3 Experiment Setup Make the arrangement as shown in figure below (Arduino clone is being used here) -
  • 5. PC is connected to Arduino via USB cable Use AFG to generate a square wave and connect AFG output to pin 2 of Arduino Connect oscilloscope channel 1 to AFG output so that same signal is viewable on oscilloscope (that is fed to Arduino) Step 4 Make the Circuit Work Flash the code on Arduino Use signal from AFG/signal generator to feed at Pin 2 of Arduino Set square wave from channel 1 of the AFG amplitude = 0 - 3V frequency = 1K Hz Autoset the oscilloscope to see this waveforms Press the button on Arduino pin 7 - You should see the measurent LED getting ON for a moment and frequency value appearing on Serial Monitor on PC. Step 5 Taking the Measurements Set input Square wave, 0-3V peak-to-peak amplitude 100 Hz frequency Continous mode (on AFG) enable the channel 1 output on AFG Autoset the oscilloscope to optimally see the signal Set up following measurements: On Ch1 - Frequency and Period Keeping the amplitude of the square wave input fixed, vary its frequency from 1Hz to 20kHz. Measure frequency on oscilloscope By pressing the push button, get measurements from Arduino, for each input set. Tabulate the measurements. You can also capture screenshot
  • 6. for each measurement set. Step 6 Analyzing the Result The observation table would look like as shown below. Calculate the % deviation of frequency measured by Arduino from actual. Create a plot of Arduino Vs Actual frequency values
  • 7. Plot the % deviation with respect to actual frequency values Can you guess why the deviation increases to 4% for 20kHz signal? Step 7 Conclusion The analysis of the observed results confirm that (As expected): The Arduino can be used for frequency counter application Frequency measured by Arduino system matches the actual frequency value of the input Deviation increases as the input frequency is increases beyond 10KHz
  • 8. How to program Arduino? STEP: 1. Obtain Arduino board (preferably Uno, Duemilanove or Leonardo model) STEP: 2. Download the IDE from - http://arduino.cc/en/Main/Software - that is suitable for your PC operating system (to program your Arduino board). STEP: 3. Install the Arduino IDE software on your PC. This is how IDE would look like:
  • 9. STEP: 4. Connect the Arduino board using USB cable provided to your PC. Wait till the necessary drivers are installed and device is recognized as COM port. STEP: 5. Select the correct Arduino Board type as show below: Tools > Board >
  • 10. STEP: 6. Ensure that COM Port identified for your Arduino board is correct. You can also change / select appropriate COM Port your Arduino is connected as from following menu: Tools > Serial Port > STEP: 7. Once the setting is complete, we are ready to download the program on Arduino board. We can test the setup by programming Arduino bard with an example code (sketch). Go to : File > Examples > 01.Basics > Blink
  • 11. STEP: 8. Click on the Right Arrow button (highlighted in orange color in the image below) to compile and upload the binary to Arduino board. Once the upload is done, you will see ‘orange LED’ on board flashing – on for 1 second and off for 1 second. STEP: 9. Now that setup is successfully completed and tested, open the relevant program (.ino file as specified by the lab experiment) using menu option – File > Open STEP: 10. Using UPLOAD button (circular button with arrow pointing to right) we can compile the program and upload the compiled binary file to Arduino board. STEP: 11. Once the board is programmed, it will start generating signals at specified pins. The board is ready to probe (or to connect external RC circuits) as per lab needs.