9781649510105 Flipbook PDF


3 downloads 100 Views 15MB Size

Recommend Stories


Porque. PDF Created with deskpdf PDF Writer - Trial ::
Porque tu hogar empieza desde adentro. www.avilainteriores.com PDF Created with deskPDF PDF Writer - Trial :: http://www.docudesk.com Avila Interi

EMPRESAS HEADHUNTERS CHILE PDF
Get Instant Access to eBook Empresas Headhunters Chile PDF at Our Huge Library EMPRESAS HEADHUNTERS CHILE PDF ==> Download: EMPRESAS HEADHUNTERS CHIL

Story Transcript

Open Source Programming & Embedded System Design Using Arduino IDE

ABUBEKER K M Dr. S BASKAR

XpressPublishing An imprint of Notion Press

Open Source Programming & Embedded System Design Using Arduino IDE

ABUBEKER K M Dr. S BASKAR

XpressPublishing An imprint of Notion Press

Old No. 38, New No. 6 McNichols Road, Chetpet Chennai - 600 031 First Published by Notion Press 2020 Copyright © Abubeker K M 2020 All Rights Reserved. ISBN-10: 1649510101 ISBN-13: 978-1649510105 This book has been published with all efforts taken to make the material error free after the consent of the author. However, the author and the publisher do not assume and hereby disclaim any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from negligence, accident, or any other cause. While every effort has been made to avoid any mistake or omission, this publication is being sold on the condition and understanding that neither the author nor the publishers or printers would be liable in any manner to any person by reason of any mistake or omission in this publication or for any action taken or omitted to be taken or advice rendered or accepted on the basis of this work. For any defect in printing or binding the publishers will be liable only to replace the defective copy by another copy of this work then available.

Author’s Profile Abubeker K M Abubeker K M has been an author, developer, programmer, and a leading professor for a long time and is currently working at ECE Department at Amal Jyothi College of Engineering, Kerala. He is a good entrepreneur and has extensive experience in building Real-Time Embedded products, Internet of Things, AI, ML, Biomedical Image Processing, Robotics, LabVIEW, and Computer Vision. He has published several research papers and academic books. One of his textbooks, ‘80C51 µCEmbedded C & ALP Programming- ISBN: 9781648921216’, has been approved by APJ Abdul Kalam Technological University Kerala and included in B Tech IT course in 2020. His recent works ‘Fundamentals of C Programming- ISBN: 978-1648925528’, and ‘Hands-On Programming with MASM Assembler: For Intel 8086 Microprocessor’- ISBN: 978-1684875030 has received significant recognition. In 2020, he was inducted into the India Book of Records and World Book of Record to publish ‘Maximum number of textbooks with ISBN with a minimum period during Covid’19 lockdown period in India’. Abubeker obtained his M. Tech in Embedded Systems & Technology from SRM University Chennai. He is a research scholar at Karpagam Academy of Higher Education, Coimbatore. One of his research papers, “Maximum likelihood Decoding of Convolutional Encoder using Viterbi Algorithm with improved Error Correction Capability,” is included in the Syllabus of Algebraic Coding Theory (M Tech CE) in APJ Abdul Kalam Technological University Kerala in 2016. His IEEE paper “IoT based Real-Time Patient Monitoring and Analysis using Raspberry Pi 3” has been added to the new course structure of M.Sc. Computer Science Syllabus of Mahatma Gandhi University, Kerala, in 2019.

Author’s Profile Dr. S Baskar Dr. S. Baskar, Assistant Professor in the Department of Electronics and Communication Engineering/Center for Interdisciplinary Research, Karpagam Academy of Higher Education, Coimbatore, Tamilnadu, India. He worked as a Research Associate in the departments of Nano Science and Technology and Pervasive Computing Technology. His research interests include Wireless sensor networks, Low power VLSI, IoT, Material Science. He published more than 33 research articles in international journals, book chapters and Conferences. So far, he guided 20 M.E/M. Tech/B. E projects. He is a reviewer for referred journals like wireless sensor networks, IEEE Access, Inderscience and IEEE transactions on vehicular technology. He is a Young Scientist Awardee by the Department of Science and Technology, Government of India

Dedicated to Our Parents

Contents Chapter 1. Arduino IDE 1.1 Introduction 1.3 Arduino Nano 1.4 Arduino Programming Language 1.4.1 Arduino Serial Port 1.4.2 Arduino Digital I/O functions 1.4.3 Arduino Time delay functions 1.4.4 Arduino Constants. 1.4.5 Arduino Control Structure. 1.5 LED Interfacing 1.6 Switch Interfacing 1.7 PIR Sensor Interfacing Chapter 2. Analog I/O Introduction 2.1 Analog I/O Functions 2.1.1 PWM O/P on Arduino IDE 2.2 LDR interacting 2.3 230V Automatic Street Light System 2.4 230V Intelligent Street Light System 2.5 Analog Temperature Sensors 2.5.1 Thermocouple 2.5.2 Thermostat 2.5.3 Thermistor- NTC 5D-11 and MZ5 2.5.4 1N 4148- PN Junction temperature sensor 2.5.5 LM35 Temperature sensor Chapter 3. Display Interfacing 3.1 Seven Segment Display Interfacing 3.1.1 Multiplexed Seven Segment Display 3.2 Liquid Crystal Display Interfacing 3.2.1 16x2 LCD Display 3.2.2 Liquid Crystal Library 3.3 16*2 LCD Interfacing (4-bit Mode) Chapter 4. Analog Sensors Introduction 4.1 DHT 11 Sensor Interfacing 4.2 MQ-xx Gas Sensor 4.2.1 MQ2 Sensor 4.2.2 MQ2 digital sensor circuit using LM358 comparator i

1 1 11 12 14 17 20 22 24 28 29 33 41 41 41 43 45 48 52 54 54 55 56 60 61 63 63 68 72 72 75 78 81 81 81 84 86 89

4.3 Hall Effect Sensor 4.3.1 Hall Effect Magnetic Sensor 4.3.2 OH 137 Interfacing Chapter 5. Interrupts 5.1 Introduction 5.2 Interrupt Service Routines - ISR 5.2.1 Interrupt Functions 5.3 Object counter using Interrupt Chapter 6. Distance & Speed Measurements Techniques 6.1 Introduction 6.2 Ultrasonic Sensor 6.2.1 Ultrasonic sensor module HC-SR04 6.3 Speed Measurement Using IR Sensor Chapter 7. Real Time Clock -RTC DS1307 7.1 Introduction 7.2 Real Time Clock Interfacing Chapter 8. Sensor Interfacing 8.1 Matrix Keyboard 8.1.1 4*4 Keyboard Interfacing without Library Functions 8.1.2 4*4 Keyboard Interfacing with Library Functions 8.2 Weight Measurement Techniques 8.2.1 Strain Gauge 8.2.2 Strain Gauges Rosettes 8.2.2 Strain Gauge Load Cells 8.3 Magnetic Switches 8.3.1 Reed Switch 8.4 Tilt Sensor 8.4.1 SW-520D Tilt Sensor Chapter 9. Motor Interfacing Introduction 9.1 DC Motor 9.1.1 Direction control of a DC Motor Driving using H Bridge 9.1.2 L293D Motor Driver 9.1.3 Speed control of Geared DC motor using PWM signal 9.2 Servomotor 9.3 Stepper Motor Chapter 10. Custom Library for Arduino IDE Introduction 10.1 Open Source Programming and Hardware 10.2 Write Our Own Arduino Library for LM 35 ii

92 93 97 99 99 100 101 105 107 107 109 109 115 119 119 121 123 123 123 127 128 128 130 131 135 135 139 140 145 145 145 146 148 151 152 156 165 165 165 166

10.2.1 LM 35 Custom Sketch 10.3 MLX90614 Thermopile- Contactless Temperature Sensor 10.3.1 Introduction 10.3.2 MLX90614 Single and Dual Zone Infra-Red Thermometer 10.3.3 Signal processing principle 10.4 Thermal sensor using MLX90614 Chapter 11. Global System for Mobile Communications 11.1 Introduction 11.2 Interfacing GSM SIM900A with Arduino 11.3 Real time temperature monitoring system using GSM

iii

170 171 171 175 176 177 185 185 186 190

iv

List of Figures Figure 1. Photographs of various entry level Arduino IDEs. Figure 2. Photographs of various enhance level Arduino IDEs. Figure 3. Photographs of various Arduino IDEs Used for IoT. Figure 4. Layout of Arduino Uno board. Figure 5. Layout of Arduino Nano board. Figure 8. LED interfacing with Arduino Uno. Figure 9. LED interfcaing with Arduino Nano. Figure 10. Switch interfacing without Pull-Up resistor. Figure 11. Switch connection to Arduino without pull-up resistor. Figure 12. Switch connection to Arduino without pull-up resistor. Figure 13. Switch interfacing with Pull-Up resistor. Figure 14. Layout of HCSR 501 PIR Sensor. Figure 15. Timing diagram of Repeatable (H) & Non- Repeatable (L) Mode. Figure 16. PIR sensor circuit and working principle. Figure 17. Sensor amplifier in HC-SR 501. Figure 18. Constructional view of sensor element in HC-SR501. Figure 19. PIR senor interfcaing with Arduino Nano. Figure 20. Photograph and circuit representation of potentiometer Figure 21. Analog I/O operations using potentiometer and LED. Figure 22. Photograph, basic structure and circuit symbol of LDR. Figure 23. LDR interfacing with Arduino Nano. Figure 24. Relay interfacing circuit. Figure 25. Types of relays. Figure 26. Modified Relay interfacing circuit using multi stage switching network. Figure 27. Automatic street light system using Arduino Nano. Figure 28. Intelligent street light system using Arduino Nano. Figure 29. Construction of a thermocouple. Figure 30. Construction of a thermostat. Figure 31. Voltage divider arrangement of NTC. Figure 32. Bead, Disk, Glass encapsulated type NTCs Figure 33. PTC interfacing with Arduino Nano Figure 34. Interfacing diagram of 1N4148. Figure 35. Block diagram and Pin configuration of LM 35. Figure 36. LM 35 Temperature sensor interfacing with Arduino Nano. Figure 37. Common Anode seven segment display. Figure 38. Common anode seven segment display in decimal format. v

4 5 6 7 11 19 28 30 30 31 32 35 37 37 38 38 39 44 45 46 47 48 49 51 52 54 55 56 56 57 59 61 62 62 63 64

Get in touch

Social

© Copyright 2013 - 2024 MYDOKUMENT.COM - All rights reserved.