Programming and Interfacing with Arduino
eBook - ePub

Programming and Interfacing with Arduino

Yogesh Misra

Share book
  1. 304 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Programming and Interfacing with Arduino

Yogesh Misra

Book details
Book preview
Table of contents
Citations

About This Book

Programming and Interfacing with Arduino provides an in-depth understanding of the Arduino UNO board. It covers programming concepts, working and interfacing of sensors, input/output devices, communication modules, and actuators with Arduino UNO board. This book contains a large number of programming examples along with the description and interfacing details of hardware with Arduino UNO board.

It discusses important topics, including SPI communication protocol, I2C communication protocol, light-emitting diode, potentiometer, analog-to-digital converter, pulse width modulation, temperature sensor LM35, humidity and temperature sensor DHT11, motor driver L293D, LED interfacing and programming, and push-button interfacing and programming.

Aimed at senior undergraduate students and professionals in areas such as electrical engineering, electronics, and communication engineering, this text:

  • Discusses construction and working of sensors, including ultrasonic sensor, temperature sensor, and optical sensor.


  • Covers construction, working, programming, and interfacing of IO devices.


  • Discusses programming, interfacing construction, and working of relay with the Arduino board for controlling high-voltage devices.


  • Covers interfacing diagram of devices with the Arduino board.


  • Provides videos demonstrating the implementation of programs on the Arduino board.


Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Programming and Interfacing with Arduino an online PDF/ePUB?
Yes, you can access Programming and Interfacing with Arduino by Yogesh Misra in PDF and/or ePUB format, as well as other popular books in Technology & Engineering & Electrical Engineering & Telecommunications. We have over one million books available in our catalogue for you to explore.

1 Introduction to Arduino UNO Board

Learning Outcomes

After completing this chapter, learners will be able to:
  1. Understand various hardware features of the Arduino UNO board.
  2. Understand various features of Integrated Development Environment (IDE) used for the development of software.
  3. Understand how to download and use the Arduino IDE for the development of software.
  4. Understand pin configuration and features of ATmega 328 microcontroller, which is the Arduino UNO board’s main brain.
  5. Understand Serial Peripheral Interface (SPI) and Inter-Integrated Circuit (I2C) serial communication protocols.

1.1 Features of Arduino UNO Board

Arduino is open-source hardware that can be used to develop embedded systems with open-source software. Arduino has gained massive popularity among students and hobbyists for making a working model. The reasons behind the popularity of Arduino are its low cost, availability of software, and easy-to-interface possibility. This book has used the Arduino UNO board’s code because it is the most popular board in the Arduino family. The Arduino UNO is a microcontroller-based board having an ATmega328 microcontroller from ATmega (now MicrochipTM). Most of the Arduino boards have the majority of components, as shown in Figure 1.1. The input voltage range required for the Arduino UNO board’s operation is 6–20 V, but the recommended input voltage range is 7–12 V. If the input voltage is less than 7 V, the digital output pins may supply less than 5 V, and the board may be unstable. The output current from each pin of Arduino UNO is 40 mA.
The components mounted on the Arduino UNO board are labeled from 1 to 17.
FIGURE 1.1 Arduino UNO board. (Courtesy Arduino.)
Power USB (Label 1): Arduino board can be powered on by connecting it to the computer at the USB socket using USB cable as shown in Label 1.
Power Connector (Label 2): Arduino board can be powered on by connecting it to 220 V AC by an adapter at Power Connector as shown as Label 2.
Voltage Regulator (Label 3): The voltage regulator shown in Label 3 is used to regulate the Arduino board’s DC voltage.
Crystal Oscillator (Label 4): A crystal oscillator of 16 MHz is used in the Arduino UNO board to synchronize the microcontroller’s various operations of ATmega 328 and Arduino UNO board.
Reset (Label 5): Sometimes, a program may be stuck at some instruction. In such cases, we have to reset our Arduino board so that the program’s execution should start from the beginning. If a 0 V is applied at the reset pin as shown in Label 5, the Arduino board will reset. An alternate way to reset the Arduino board is by pressing the reset button, as shown in Label 17.
3.3 V (Label 6): The 3.3V output is available at the pin as shown in Label 6.
5 V (Label 7): The 5V output is available at the pin as shown in Label 7.
GND (Label 8): In the Arduino board, three GND (ground) pins are available. Users can use any available ground pin while building their circuit. The two GND (ground) pins are available at the pins, as shown in Label 8. The third GND (ground) pin is available at the right-side pin, as shown in Label 16.
Vin (Label 9): Arduino board can be powered on by connecting a DC voltage in the range of 7–20 V at Vin pin, as shown in Label 9.
Analog Input (Label 10): The Arduino UNO board contains six analog pins named A0, A1, A2, A3, A4, and A5. Internally, these analog pins are connected to a six-channel 10-bit analog-to-digital converter. The allowable analog input voltage range at each analog input pin is 0–5 V. Since each analog input pin is connected to a 10-bit analog-to-digital converter, 0–5 V is divided into 1,024 steps ranging from 0 to 1,023. The six analog pins are shown in Label 10.
ATmega328 (Label 11): The ATmega328 microcontroller is used to perform various arithmetic and logical operations. The ATmega328 microcontroller is manufactured by Atmel Company and shown in Label 11.
ICSP (Label 12): It is a small programming header for the Arduino consisting of MOSI (Master Output Slave Input), MISO (Master Input Slave Output), SCLK (System Clock), RESET, VCC, and GND.
Power LED (Label 13): When the Arduino board is power on, the power LED turns on. The Power LED is shown in Label 13.
Tx and Rx LEDs (Label 14): When the Arduino board transmits data serially from the Arduino board through Pin 1 of the Arduino board, Tx (Transmit) LED blinks.
When the Arduino board receives data serially through Pin 0 of the Arduino board, Rx (Receive) LED blinks. The Tx and Rx LEDs are shown in Label 14.
Digital I/O (Label 15): The Arduino UNO board has 14 digital I/O (input/output) pins. Each of these pins can be c...

Table of contents