Programming and Interfacing with Arduino [1 ed.] 1032059850, 9781032059853

Programming and Interfacing with Arduino provides an in-depth understanding of the Arduino UNO board. It covers programm

740 153 13MB

English Pages 278 [279] Year 2021

Report DMCA / Copyright

DOWNLOAD FILE

Programming and Interfacing with Arduino [1 ed.]
 1032059850, 9781032059853

Table of contents :
Cover
Half Title
Title Page
Copyright Page
Table of Contents
Preface
Acknowledgments
Author
Abbreviations Used in This Book
Chapter 1 Introduction to Arduino UNO Board
Learning Outcomes
1.1 Features of Arduino UNO Board
1.2 Arduino IDE Software
1.2.1 Editor
1.2.2 Compiler
1.2.3 Linker
1.2.4 Locator
1.2.5 Hex Converter
1.2.6 Loader
1.3 Arduino IDE Download
1.4 Working with Arduino IDE
1.5 Introduction to ATmega 328
1.6 Serial Peripheral Interface (SPI) Communication Protocol
1.6.1 Steps of SPI Data Transmission – The Steps for Data Transmission in SPI Protocols are as Follows:
1.6.2 Advantages of SPI Data Transmission – The Advantages of Data Transmission in SPI Protocols are as Follows:
1.6.3 Disadvantages of SPI Data Transmission – The Disadvantages of Data Transmission in SPI Protocols are as Follows:
1.7 Inter-Integrated Circuit (I2C) Communication Protocol
Chapter 2 Arduino Programming Constructs
Learning Outcomes
2.1 Structure of Arduino Programming
2.1.1 Setup()
2.1.2 Loop()
2.1.3 Variables
2.1.4 Constant
2.1.5 Integer
2.2 Function
2.2.1 pinMode(pin, mode)
2.2.2 digitalWrite(pin, value)
2.2.3 digitalRead(pin)
2.2.4 analogRead(pin)
2.2.5 analogWrite(pin, value)
2.2.6 delay(value)
2.2.7 for loop
2.2.8 Serial.begin(rate)
2.2.9 Serial.print(“argument”)
2.2.10 Serial.println(“argument”)
2.2.11 if statement
2.2.11.1 Simple if
2.2.11.2 if/else
2.2.11.3 Multiple if/else
2.2.12 map function
Chapter 3 I/O Devices, Actuators, and Sensors
Learning Outcomes
3.1 Light-Emitting Diode (LED)
3.1.1 LED under Forward Bias
3.1.2 LED under Reverse Bias
3.1.3 Interfacing of LED with Arduino UNO
3.2 Switch
3.3 Seven-Segment Display
3.3.1 Common Cathode Seven-Segment Display (CC)
3.3.2 Common Anode Seven-Segment Display (CA)
3.4 LCD Module
3.5 Potentiometer
3.5.1 Internal Schematic of Potentiometer
3.5.2 Working of Potentiometer
3.6 Analog-to-Digital Converter (ADC)
3.6.1 Pin Description of ADC 804
3.6.2 Analog to the Digital Data Conversion Process in ADC 804
3.6.3 Important Terminology of ADC
3.6.4 Analog Inputs in Arduino UNO Board
3.7 Pulse Width Modulation (PWM)
3.7.1 Working of PWM Concept
3.7.2 Applications of PWM
3.7.3 PWM Pins in Arduino UNO Board
3.8 Temperature Sensor LM35
3.9 Humidity and Temperature Sensor DHT11
3.9.1 Pin Description of DHT11
3.9.2 General Features of DHT11
3.9.3 Working Principle of DHT11
3.9.4 Timing Diagram of DHT11
3.9.5 Data Format of DHT11
3.10 Motor Driver L293D
3.10.1 Pin Description of L293D
3.10.2 Working of L293D
3.10.3 Description of L293D Motor Driver Module
3.11 Relay
3.11.1 Pin Description of the Relay
3.11.2 Working of Relay
3.11.3 Interfacing of Relay
3.11.4 Relay Board
3.12 Light-Dependent Resistor (LDR)
3.12.1 Working Principle of LDR
3.12.2 Construction of LDR
3.12.3 Applications of LDR
3.13 Keypad Matrix
3.13.1 Single-Dimensional Interfacing Approach of Switches
3.13.2 Algorithm to Find Out Which Switch is Pressed in Single-Dimensional Interfacing Approach
3.13.3 Disadvantage of Single-Dimensional Interfacing Approach
3.13.4 Two-Dimensional Interfacing Approach of Switches
3.13.5 Algorithm to Find Out Which Switch is Pressed in Two-Dimensional Interfacing Approach (Key Matrix)
3.13.6 A 4 × 4 Keypad
3.14 Optical Sensor
3.14.1 Retro-Reflective Optical Sensor
3.14.2 Retro-Reflective Optical Sensor Module
3.15 Capacitive Touch Sensor
3.15.1 Capacitive Touch Sensor Working Principle
3.15.2 Capacitive Touch Sensor Module
3.16 Gas Sensor
3.16.1 Working of the Gas Sensor (MQ2)
3.16.2 Gas Sensor Module (MQ2)
3.16.3 Calibration of Gas Sensor (MQ2)Module
3.17 Rain Detector Sensor (FC-07)
3.17.1 Rain Board
3.17.2 Rain Sensor Control Board
3.17.3 Working of Rain Detector Sensor (FC-07)
3.18 Ultrasonic Sensor (HC-SR04)
3.18.1 Pin Description and Other Details of Ultrasonic Sensor Module (HC-SR04)
3.18.2 Working Principle of Ultrasonic Sensor Module (HC-SR04)
3.19 Bluetooth Module (HC-05)
3.19.1 Pin Description and Other Details of Bluetooth Module (HC-05)
3.20 GSM Module (SIM900A)
3.21 Soil Moisture Sensor (YL-69)
3.21.1 Moisture-Sensing Probe Module
3.21.2 Moisture-Sensing Control Module
3.21.3 Working of Moisture Sensor
Chapter 4 Interfacing and Programming with Arduino
Learning Outcomes
4.1 LED Interfacing and Programming
4.2 Display in Serial Monitor
4.3 Push-Button Interfacing and Programming
4.4 Seven-Segment Display Interfacing and Programming
4.5 Miscellaneous Programs Related to LED
4.6 LCD Interfacing and Programming
4.7 Potentiometer Interfacing and Programming
4.8 Arduino Programming Using PWM Techniques
4.9 Interfacing and Programming of Arduino with LM35
4.10 Interfacing and Programming of Arduino with Humidity and Temperature Sensor DHT11
4.11 Interfacing and Programming of Arduino with DC Motor
4.12 Interfacing and Programming of Arduino with High-Voltage Device and Relay
4.13 Interfacing and Programming of Arduino UNO with Light-Dependent Resistor (LDR)
4.14 Interfacing and Programming of Arduino UNO with 4 × 4 Keypad
4.15 Interfacing and Programming of Arduino UNO with Optical Sensor
4.16 Interfacing of Capacitive Touch Sensor with Arduino UNO
4.17 Interfacing and Programming of Arduino UNO with Smoke Detector Sensor
4.18 Interfacing and Programming of Arduino UNO with Rain Detector Sensor (FC-07)
4.19 Interfacing and Programming of Arduino UNO with Ultrasonic Sensor (HC-SR04)
4.20 Interfacing and Programming of Arduino UNO with Bluetooth Module (HC-05)
4.21 Interfacing and Programming of Arduino UNO with GSM Module (SIM900A)
4.22 Interfacing and Programming of Arduino UNO Using I2C Protocol
Chapter 5 Arduino-Based Projects
5.1 Arduino-Based Obstacle Detection and Warning System
5.2 Arduino-Based Gas Leakage Detection
5.3 Arduino-Based Burglar Detection
5.4 Arduino-Based Weather Monitoring System
5.5 Arduino-Based Mobile Phone-Controlled Light
5.6 Arduino-Based Plant Watering System
Appendix 1: Answers to Check Yourself
References
Index

Polecaj historie