The document provides an overview of topics related to interfacing sensors and actuators with Arduino microcontrollers. It discusses basic I/O components, sensor interfacing including ultrasonic, IR, temperature and motion sensors. It also covers actuators, motor control, LCD displays and programming concepts for Arduino like digital and analog I/O, PWM and interrupts. References for further reading on Arduino programming are also provided.
This document provides an overview of Arduino programming concepts including:
- Microcontrollers contain a CPU, memory, input/output pins and other peripherals on a single integrated circuit.
- Arduino is an open-source electronics platform with a microcontroller, pins to connect circuits, and software to program it.
- The core Arduino functions include setup(), loop(), pinMode(), digitalWrite(), digitalRead(), analogWrite(), analogRead(), and delay().
- Examples demonstrate blinking LEDs, reading input, using conditions and loops, arrays, LCD displays, and controlling servo motors.
- Arduino programming provides an accessible way to learn embedded systems and interact with circuits.
The document provides an overview of the Arduino Uno microcontroller board. It describes the main components of the board including 14 digital input/output pins, 6 analog inputs, a 16MHz crystal oscillator, a USB connection, a power jack, and a reset button. It also explains how to power the board using a USB cable connected to a computer or an external power supply. The document then introduces some basic Arduino programming concepts like functions, data types, control structures, and input/output functions.
The Arduino is an open source prototyping platform that uses flexible hardware and software. The setup function initializes variables and pin modes and runs once when the board is powered on, while the loop function contains the main program logic and runs continuously. Pins on the Arduino can be configured as inputs or outputs using pinMode, and their states can be set or read with digitalWrite and digitalRead. Analog signals are converted to digital values between 0-1023 for processing by the microcontroller.
This document provides an introduction to using Arduino boards. It discusses getting started with the Arduino IDE, programming basics like digital I/O and timing functions. Examples are provided to blink an LED, read a digital sensor, read an analog sensor with a potentiometer, and fade an LED using pulse width modulation. Terminology around bits, bytes and serial communication is also explained. The document aims to teach Arduino fundamentals and provide practice examples for learning.
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdfJayanthi Kannan MK
The document discusses the Arduino Uno microcontroller board. It provides details about the Arduino platform and describes the Arduino Uno board, which is based on the ATmega328P microcontroller. It lists the main components of the Arduino Uno board and explains the functions of pins and inputs/outputs. The document also provides an overview of the fundamentals of Arduino programming, including key functions, variables, conditions, and serial communication.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
The document provides an introduction and overview of Arduino boards and programming. It discusses:
- The different types of Arduino boards available.
- How to get started with the Arduino IDE and programming Arduino boards.
- Examples of common sensors and actuators that can be connected to Arduino boards like LEDs, buttons, temperature sensors.
- The basic structure of Arduino programs including setup(), loop(), and common functions like digitalRead(), digitalWrite(), and pinMode().
This document provides an overview and introduction to using Arduino boards for physical computing projects. It discusses installing the Arduino software, understanding analog and digital signals, basic programming concepts like inputs, outputs, and conditional statements. It also covers a sample "Blink" project to get started using Arduino boards and programming the onboard LED and buttons.
This document provides an overview of microprocessors and the Arduino development environment. It begins with definitions of a microprocessor as a tiny, inexpensive computer that can interact with the physical world through sensors and actuators. It then discusses what an Arduino is and provides instructions for a basic "blink" example project using an LED. The document covers Arduino software, hardware, and programming concepts like inputs, outputs, variables, and functions. It also explores modifying and debugging code and connecting additional hardware like buttons, sensors, and stepper motors.
I have prepared this presentation when I was studying at Western Region Campus. I along with some of my friends conducted training for junior students on Arduino. Its day-1 presentation.
This document provides an introduction to microcontrollers and electronics basics using Arduino and RedBoard microcontrollers. It covers topics such as Arduino and RedBoard overview, downloading the Arduino IDE, connecting boards to computers, installing drivers, selecting boards and serial devices in the IDE interface, and an overview of the key areas of the Arduino GUI. It also introduces basic electronics concepts like circuits, Ohm's Law, analog and digital signals. Several example circuits are presented to blink an LED, read input from a potentiometer to control blink rate, use a light sensor to control an LED, and read temperature from a sensor.
The document discusses the Arduino Nano development board. It provides an overview of the board's specifications including its microcontroller, operating voltage, analog and digital pins, memory, and communication interfaces. It also compares the Nano to the Arduino Uno and Arduino Mega boards, highlighting their differences in size, programming, and technical specifications. The document then provides instructions on how to power and program the Nano board using the Arduino IDE and examples.
Arduino simulators help you to get your plan on paper. You can easily verify how it is going to look, test your code up to an extent and then confidently go ahead with the hardware implementation.
This document is a project report submitted by four students to their professor for an Arduino-based Windows remote control project. The report includes an abstract, introduction to Arduino, details about the Arduino board and ATmega328 microcontroller, circuit diagram and working, software used, and testing conducted. It acknowledges the sources that helped in completing the project.
Mechatronics is a multidisciplinary field that refers to the skill sets needed in the contemporary, advanced automated manufacturing industry. At the intersection of mechanics, electronics, and computing, mechatronics specialists create simpler, smarter systems. Mechatronics is an essential foundation for the expected growth in automation and manufacturing.
Mechatronics deals with robotics, control systems, and electro-mechanical systems.
This laboratory manual introduces students to controlling systems using an Arduino microcontroller. Lab 1 covers basic input and output using LEDs and buttons. Lab 2 adds a photoresistor sensor and implements proportional and proportional-integral control of LED brightness. Lab 3 applies these same control techniques to a motor system using an encoder for position feedback. The labs provide circuit diagrams, code examples, and instructions to help students gather and analyze data on system responses under different control schemes.
This document provides an overview of an Arduino course covering embedded systems and programming. The summary includes:
- The course covers introduction to embedded systems including components, characteristics, and basic structure. It also covers introduction to computer programming concepts for Arduino like variables, operators, and control statements.
- The Arduino environment and programming is explained including the board, IDE, sensors, actuators and communication. Common electronic components and modules used with Arduino like LEDs, buttons, LCDs, ultrasonic sensors, and Bluetooth are described.
- The document concludes with a section on circuit diagrams for Arduino projects. Key concepts around pins, analog/digital input/output, pulse width modulation, delay, and
A spectrophotometer is an essential analytical instrument widely used in various scientific disciplines, including chemistry, biology, physics, environmental science, clinical diagnostics, and materials science, for the quantitative analysis of substances based on their interaction with light. At its core, a spectrophotometer measures the amount of light that a chemical substance absorbs by determining the intensity of light as a beam of light passes through the sample solution. The fundamental principle behind the spectrophotometer is the Beer-Lambert law, which relates the absorption of light to the properties of the material through which the light is traveling. According to this law, the absorbance is directly proportional to the concentration of the absorbing species in the material and the path length that the light travels through the sample. By exploiting this principle, a spectrophotometer provides a powerful, non-destructive means of identifying and quantifying substances in both qualitative and quantitative studies.
The construction of a spectrophotometer involves several key components, each playing a vital role in the overall functioning of the instrument. The first critical component is the light source. The choice of the light source depends on the range of wavelengths needed for analysis. For ultraviolet (UV) light, typically a deuterium lamp is used, while tungsten filament lamps are commonly used for the visible light range. In some advanced spectrophotometers, xenon lamps or other broad-spectrum sources may be used to cover a wider range of wavelengths. The light emitted from the source is then directed toward a monochromator, which isolates the desired wavelength of light from the full spectrum emitted by the lamp. Monochromators generally consist of a prism or a diffraction grating, which disperses the light into its component wavelengths. By rotating the monochromator, the instrument can select and pass a narrow band of wavelengths to the sample, ensuring that only light of the desired wavelength reaches the sample compartment.
The sample is typically held in a cuvette, a small transparent container made of quartz, glass, or plastic, depending on the wavelength range of interest. Quartz cuvettes are used for UV measurements since they do not absorb UV light, while plastic or glass cuvettes are sufficient for visible light applications. The path length of the cuvette, usually 1 cm, is a critical parameter because it influences the absorbance readings according to the Beer-Lambert law. Once the monochromatic light passes through the sample, it emerges with reduced intensity due to absorption by the sample. The transmitted light is then collected by a photodetector, which converts the light signal into an electrical signal. This electrical signal is proportional to the intensity of the transmitted light and is processed by the instrument’s electronics to calculate absorbance or transmittance values. These values are then give
Ad
More Related Content
Similar to INTRODUCTION TO ARDUINO and sensors for arduino.pptx (20)
This document provides an introduction to using Arduino boards. It discusses getting started with the Arduino IDE, programming basics like digital I/O and timing functions. Examples are provided to blink an LED, read a digital sensor, read an analog sensor with a potentiometer, and fade an LED using pulse width modulation. Terminology around bits, bytes and serial communication is also explained. The document aims to teach Arduino fundamentals and provide practice examples for learning.
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdfJayanthi Kannan MK
The document discusses the Arduino Uno microcontroller board. It provides details about the Arduino platform and describes the Arduino Uno board, which is based on the ATmega328P microcontroller. It lists the main components of the Arduino Uno board and explains the functions of pins and inputs/outputs. The document also provides an overview of the fundamentals of Arduino programming, including key functions, variables, conditions, and serial communication.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
The document provides an introduction and overview of Arduino boards and programming. It discusses:
- The different types of Arduino boards available.
- How to get started with the Arduino IDE and programming Arduino boards.
- Examples of common sensors and actuators that can be connected to Arduino boards like LEDs, buttons, temperature sensors.
- The basic structure of Arduino programs including setup(), loop(), and common functions like digitalRead(), digitalWrite(), and pinMode().
This document provides an overview and introduction to using Arduino boards for physical computing projects. It discusses installing the Arduino software, understanding analog and digital signals, basic programming concepts like inputs, outputs, and conditional statements. It also covers a sample "Blink" project to get started using Arduino boards and programming the onboard LED and buttons.
This document provides an overview of microprocessors and the Arduino development environment. It begins with definitions of a microprocessor as a tiny, inexpensive computer that can interact with the physical world through sensors and actuators. It then discusses what an Arduino is and provides instructions for a basic "blink" example project using an LED. The document covers Arduino software, hardware, and programming concepts like inputs, outputs, variables, and functions. It also explores modifying and debugging code and connecting additional hardware like buttons, sensors, and stepper motors.
I have prepared this presentation when I was studying at Western Region Campus. I along with some of my friends conducted training for junior students on Arduino. Its day-1 presentation.
This document provides an introduction to microcontrollers and electronics basics using Arduino and RedBoard microcontrollers. It covers topics such as Arduino and RedBoard overview, downloading the Arduino IDE, connecting boards to computers, installing drivers, selecting boards and serial devices in the IDE interface, and an overview of the key areas of the Arduino GUI. It also introduces basic electronics concepts like circuits, Ohm's Law, analog and digital signals. Several example circuits are presented to blink an LED, read input from a potentiometer to control blink rate, use a light sensor to control an LED, and read temperature from a sensor.
The document discusses the Arduino Nano development board. It provides an overview of the board's specifications including its microcontroller, operating voltage, analog and digital pins, memory, and communication interfaces. It also compares the Nano to the Arduino Uno and Arduino Mega boards, highlighting their differences in size, programming, and technical specifications. The document then provides instructions on how to power and program the Nano board using the Arduino IDE and examples.
Arduino simulators help you to get your plan on paper. You can easily verify how it is going to look, test your code up to an extent and then confidently go ahead with the hardware implementation.
This document is a project report submitted by four students to their professor for an Arduino-based Windows remote control project. The report includes an abstract, introduction to Arduino, details about the Arduino board and ATmega328 microcontroller, circuit diagram and working, software used, and testing conducted. It acknowledges the sources that helped in completing the project.
Mechatronics is a multidisciplinary field that refers to the skill sets needed in the contemporary, advanced automated manufacturing industry. At the intersection of mechanics, electronics, and computing, mechatronics specialists create simpler, smarter systems. Mechatronics is an essential foundation for the expected growth in automation and manufacturing.
Mechatronics deals with robotics, control systems, and electro-mechanical systems.
This laboratory manual introduces students to controlling systems using an Arduino microcontroller. Lab 1 covers basic input and output using LEDs and buttons. Lab 2 adds a photoresistor sensor and implements proportional and proportional-integral control of LED brightness. Lab 3 applies these same control techniques to a motor system using an encoder for position feedback. The labs provide circuit diagrams, code examples, and instructions to help students gather and analyze data on system responses under different control schemes.
This document provides an overview of an Arduino course covering embedded systems and programming. The summary includes:
- The course covers introduction to embedded systems including components, characteristics, and basic structure. It also covers introduction to computer programming concepts for Arduino like variables, operators, and control statements.
- The Arduino environment and programming is explained including the board, IDE, sensors, actuators and communication. Common electronic components and modules used with Arduino like LEDs, buttons, LCDs, ultrasonic sensors, and Bluetooth are described.
- The document concludes with a section on circuit diagrams for Arduino projects. Key concepts around pins, analog/digital input/output, pulse width modulation, delay, and
A spectrophotometer is an essential analytical instrument widely used in various scientific disciplines, including chemistry, biology, physics, environmental science, clinical diagnostics, and materials science, for the quantitative analysis of substances based on their interaction with light. At its core, a spectrophotometer measures the amount of light that a chemical substance absorbs by determining the intensity of light as a beam of light passes through the sample solution. The fundamental principle behind the spectrophotometer is the Beer-Lambert law, which relates the absorption of light to the properties of the material through which the light is traveling. According to this law, the absorbance is directly proportional to the concentration of the absorbing species in the material and the path length that the light travels through the sample. By exploiting this principle, a spectrophotometer provides a powerful, non-destructive means of identifying and quantifying substances in both qualitative and quantitative studies.
The construction of a spectrophotometer involves several key components, each playing a vital role in the overall functioning of the instrument. The first critical component is the light source. The choice of the light source depends on the range of wavelengths needed for analysis. For ultraviolet (UV) light, typically a deuterium lamp is used, while tungsten filament lamps are commonly used for the visible light range. In some advanced spectrophotometers, xenon lamps or other broad-spectrum sources may be used to cover a wider range of wavelengths. The light emitted from the source is then directed toward a monochromator, which isolates the desired wavelength of light from the full spectrum emitted by the lamp. Monochromators generally consist of a prism or a diffraction grating, which disperses the light into its component wavelengths. By rotating the monochromator, the instrument can select and pass a narrow band of wavelengths to the sample, ensuring that only light of the desired wavelength reaches the sample compartment.
The sample is typically held in a cuvette, a small transparent container made of quartz, glass, or plastic, depending on the wavelength range of interest. Quartz cuvettes are used for UV measurements since they do not absorb UV light, while plastic or glass cuvettes are sufficient for visible light applications. The path length of the cuvette, usually 1 cm, is a critical parameter because it influences the absorbance readings according to the Beer-Lambert law. Once the monochromatic light passes through the sample, it emerges with reduced intensity due to absorption by the sample. The transmitted light is then collected by a photodetector, which converts the light signal into an electrical signal. This electrical signal is proportional to the intensity of the transmitted light and is processed by the instrument’s electronics to calculate absorbance or transmittance values. These values are then give
A common structure is to start with an introduction that grabs their attention, states your purpose, and outlines your agenda. Then, you move on to the body of your presentation, where you explain your robotics project, its objectives, methods, results, and implications.14 Mar 2024
Auslogics File Recovery Professional 12.0.1 Crack New Version Latest 2025usmankhan66g66
⚡📣 Download Setup Here 😍💖💖https://crackedios.com/after-verification-click-go-to-download-page/
Auslogics File Recovery for Windows PC. It is an efficient and easy-to-use program for recovering accidentally deleted files and files lost due to viruses or system crashes. Mistakes happen – you may have cleared a folder you didn't mean to delete or lost important files due to a virus attack, a system crash, or another accident, whether work documents or precious photo memories; losing something so valuable is never fun.
THE SCANNING ELECTRON MICROSOPE (SEM)....RahulRajai
A scanning electron microscope is a type of electron microscope that produces images of a sample by scanning the surface with a focused beam of electrons. The electrons interact with atoms in the sample, producing various signals that contain information about the surface topography and composition of the sample.
How to Buy a Telegram Account_ Everything You Need to Know.pdfbuelljasonnn
Starting from scratch on any social media platform is tough, and Telegram is no different. It can take months of work to organically grow a decent amount of followers.
Clip Studio Paint EX Crack Download (Latest Version 2025)usmankhan66g66
⚡📣 Download Setup Here 😍💖💖https://crackedios.com/after-verification-click-go-to-download-page/
Clip Studio Paint EX, the successor to Manga Studio (Comic Studio), is an essential graphic software and app backed by manga creators, comics, and cartoons. This program is the world's leading comic and manga creation software and delivers powerful art tools for every manga and comic artist. It is designed for artists wishing to enhance and perfect their pen-and-paper illustrations and for artists wishing to complete the entire process of digitally creating manga and comics. Sketching, inking, and coloring your Comics and Manga has never been easier.
Windows Repair or Tweak Guide Powered by Yamicsoft Windows Manager.pdfyamicsoft458
Windows operating systems, like any complex software, can slow down, become unstable, or behave unpredictably over time. The Yamicsoft Windows Manager is an advanced all-in-one utility designed to repair, tweak, and optimize Windows systems for peak performance. For more visit web www.yamicsoft.com.
Pulmonary delivery of biologics (insulin, vaccines, mRNA)
Definition and Purpose
Pulmonary Delivery: Involves administering biologics directly to the lungs via inhalation.
Goal: To achieve rapid absorption into the bloodstream, enhance bioavailability, and improve therapeutic outcomes.
Types of Biologics
• Insulin: Used for diabetes management; inhaled insulin can provide a non-invasive alternative to injections.
• Vaccines: Pulmonary delivery of vaccines (e.g., mRNA vaccines) can stimulate local and systemic immune responses.
• mRNA Therapeutics: Inhalable mRNA formulations can be used for gene therapy and vaccination, allowing for direct delivery to lung cells.
Advantages
• Non-Invasive: Reduces the need for needles, improving patient comfort and compliance.
• Rapid Onset: Direct absorption through the alveolar membrane can lead to quicker therapeutic effects.
• Targeted Delivery: Focuses treatment on the lungs, which is beneficial for respiratory diseases.
Future Directions
• Personalized Medicine: Potential for tailored therapies based on individual patient needs and responses.
• Combination Therapies: Exploring the use of pulmonary delivery for combination therapies targeting multiple diseases.
Gene therapy via inhalation
Definition and Purpose
• Gene Therapy: A technique that involves introducing, removing, or altering genetic material within a patient’s cells to treat or prevent disease.
• Inhalation Delivery: Administering gene therapies directly to the lungs through inhalation, targeting respiratory diseases and conditions.
Mechanism of Action
• Aerosolized Vectors: Utilizes viral or non-viral vectors (e.g., liposomes, nanoparticles) to deliver therapeutic genes to lung cells.
• Cell Uptake: Once inhaled, the vectors penetrate the alveolar epithelium and deliver genetic material to target cells.
Advantages
• Localized Treatment: Direct delivery to the lungs can enhance therapeutic effects while minimizing systemic side effects.
• Non-Invasive: Inhalation is less invasive than traditional injection methods, improving patient compliance.
• Rapid Onset: Potential for quicker therapeutic effects due to direct absorption in the pulmonary system.
Personalized inhaler systems with sensors
• Smart Inhalers: Devices with sensors that track usage and technique.
• Real-Time Monitoring: Connect to apps for data on adherence and inhalation patterns.
• Tailored Treatment: Adjusts medication based on individual usage data.
• Patient Engagement: Provides feedback and reminders to empower self-management.
• Improved Outcomes: Enhances adherence and reduces exacerbations in respiratory conditions.
• Future Potential: May integrate with other health data and use AI for predictive insights.
Sustained-Release Nano Formulations
Definition: Nanoscale drug delivery systems that release therapeutic agents over an extended period.
Components: Made from polymers, lipids, or inorganic materials that encapsulate drugs.
Mechanism:
2. ARDUINO
Arduino is a prototype platform (open-source) based on an easy-
to-use hardware and software.
It consists of a circuit board, which can be programed (referred
to as a microcontroller) and a ready-made software called
Arduino IDE (Integrated Development Environment), which is
used to write and upload the computer code to the physical
board.
4. BOARD TYPES
Arduino boards have one thing in common: they are
programed through the Arduino IDE.
The differences are based on the number of inputs and
outputs (the number of sensors, LEDs, and buttons you can use
on a single board), speed, operating voltage, form factor etc.
Some boards are designed to be embedded and have no
programming interface (hardware), which you would need to
buy separately.
Some can run directly from a 3.7V battery, others need at least
5V.
12. 3 MAIN PARTS OF ARDUINO PROGRAM
Structure
Values (variables and constants)
Functions
13. TWO MAIN FUNCTIONS OF SOFTWARE
STRUCTURE
Setup( ) function
The setup() function is called when a sketch starts. Use it to
initialize the variables, pin modes, start using libraries, etc.
The setup function will only run once, after each power up
or reset of the Arduino board.
Loop( ) function
loop() function does precisely what its name suggests, and
loops consecutively, allowing your program to change
and respond. Use it to actively control the Arduino board.
17. pinMode() function
The pinMode() function is used to configure a specific pin to
behave either as an input or an output.
pinMode() Function Syntax
pinMode (pin , mode);
pin − the number of the pin whose mode you wish to
set
mode − INPUT, OUTPUT.
18. SAMPLE SKETCH
int button = 5 ; // button connected to pin 5
int LED = 6; // LED connected to pin 6
void setup () {
pinMode(button , INPUT);
// set the digital pin as input
pinMode(LED , OUTPUT);
// set the digital pin as output
}
19. digitalWrite() function
the digitalWrite() function is used to write a HIGH or a LOW
value to a digital pin.
If the pin has been configured as an OUTPUT with pinMode(),
its voltage will be set to the corresponding value: 5V (or 3.3V
on 3.3V boards) for HIGH, 0V (ground) for LOW.
If the pin is configured as an INPUT, digitalWrite() will enable
(HIGH) or disable (LOW) the internal pullup on the input pin.
21. SAMPLE SKETCH
void loop () {
If (digitalRead(button ) == LOW) // if button pressed {
digitalWrite(LED,HIGH); // turn on led
delay(500); // delay for 500 ms
digitalWrite(LED,LOW); // turn off led
delay(500); // delay for 500 ms
}
}
22. digitalRead() function
digitalRead is used to read the status of any digital Pin in Arduino.
Syntax
digitalRead(pin)
Parameters
pin: the Arduino pin number you want to read
Returns
HIGH or LOW
23. SAMPLE SKETCH
int button = 5 ; // button connected to pin 5
int LED = 6; // LED connected to pin 6
void setup () {
pinMode(button , INPUT);
// set the digital pin as input
pinMode(LED , OUTPUT);
// set the digital pin as output
}
void loop () {
X=digitalRead(7);
If (digitalRead(button ) == LOW) // if button pressed {
digitalWrite(LED,HIGH); // turn on led
delay(500); // delay for 500 ms
digitalWrite(LED,LOW); // turn off led
delay(500); // delay for 500 ms
}
}
24. analogRead( ) function
Arduino is able to detect whether there is a voltage applied to one of its pins and
report it through the digitalRead() function.
There is a difference between an on/off sensor (which detects the presence of an
object) and an analog sensor, whose value continuously changes.
In the lower-right part of the Arduino board, you will see six pins marked “Analog In”.
These special pins not only tell whether there is a voltage applied to them, but also
its value.
By using the analogRead() function, we can read the voltage applied to one of the
pins.
This function returns a number between 0 and 1023, which represents voltages
between 0 and 5 volts.
For example, if there is a voltage of 2.5 V applied to pin number 0, analogRead(0)
returns 512
25. analogRead() function syntax
analogRead(pin);
pin − the number of the analog input pin to read from (0
to 5 on most boards, 0 to 7 on the Mini and Nano, 0 to 15 on the
Mega)
26. SAMPLE SKETCH
int analogPin = 3;//potentiometer wiper (middle terminal)
// connected to analog pin 3
int val = 0; // variable to store the value read
void setup() {
Serial.begin(9600); // setup serial
}
void loop() {
val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
}
27. BLINKING LED
It is as simple as
turning a light on
and off.
Pin Configuration of
LED
29. SOURCE CODE
int LED_OUTPUT_PIN = 3;
void setup() {
pinMode(LED_OUTPUT_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_OUTPUT_PIN, HIGH); // turn LED on (output 5V)
delay(1000); // wait one second
digitalWrite(LED_OUTPUT_PIN, LOW); // turn LED off (output 0V)
delay(1000); // wait another second
}
31. WHAT IS A SENSOR?
A sensor is a device that detects and
responds to some type of input from the
physical environment.
The input can be light, heat, motion, moisture,
pressure or any number of other environmental
phenomena. The output is generally a signal that is
converted to a human-readable display at the
sensor location or transmitted electronically over a
network for reading or further processing.
34. CLASSIFICATION OF SENSOR
Analog Sensors produce an analog output i.e.,
a continuous output signal (usually voltage but
sometimes other quantities like Resistance
etc.) with respect to the quantity being
measured.
Digital Sensors work with discrete or digital
data. The data in digital sensors, which are
used for conversion and transmission, is digital
in nature.
35. SOIL MOISTURE SENSOR
The Soil Moisture Sensor measures soil moisture
grace to the changes in electrical conductivity
of the earth ( soil resistance increases with
drought ).
The electrical resistance is measured between
the two electrodes of the sensor. A comparator
activates a digital output when a adjustable
threshold is exceeded.
38. WATER LEVEL SENSOR
This sensor can be used to measure the water
level, monitor a sump pit, detect rainfall or
detect leakage.
The series of exposed parallel conductors,
together act as a variable resistor (just like a
potentiometer) whose resistance varies
according to the water level.
The change in resistance corresponds to the
distance from the top of the sensor to the surface
of the water.
40. ARDUINO SKETCH FOR WATER LEVEL
SENSOR
void setup() {
pinMode(sensorPower, OUTPUT);
digitalWrite(sensorPower, LOW);
Serial.begin(9600);
}
void loop() {
int level = readSensor();
Serial.print("Water level: ");
Serial.println(level);
}
41. FINAL ACTIVITY
Develop an Arduino program that monitors
the soil moisture level using a sensor. If the
measured soil moisture falls below the
threshold value of 25, the program should
activate a LED and make it blink five times.
Conversely, if the soil moisture reading is equal
to or above 25, the LED should remain off.