Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Practical 2: Add Libraries in Arduino and Setup Arduino IDE

Lesson 2 of 10 in the free Internet of Things (IoT) Lab notes on Siksha Sarovar, written by Rohit Jangra.

Program Statement

Write the steps to add libraries in Arduino and setup of Arduino IDE for programming.

CO Mapping

CO2, CO3

Objective

To learn how to add external libraries to Arduino IDE and configure the IDE for programming a board.

Part A: Adding Libraries in Arduino IDE

There are three methods to add libraries:

---

Method 1: Using the Library Manager (Recommended)

  1. Open Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries... (or press Ctrl + Shift + I).
  3. The Library Manager window opens.
  4. In the search box, type the name of the library (e.g., DHT sensor library).
  5. Select the desired library from the list.
  6. Click the "Install" button.
  7. Once installed, the library appears in Sketch > Include Library menu.

---

Method 2: Installing a .zip Library

  1. Download the library as a .zip file from GitHub or another source.
  2. In Arduino IDE, go to Sketch > Include Library > Add .ZIP Library...
  3. Browse to the downloaded .zip file and click "Open".
  4. The library is installed and available immediately.

---

Method 3: Manual Installation

  1. Download and extract the library folder.
  2. Copy the extracted folder to the Arduino libraries directory:
  • Windows: C:\Users\<YourName>\Documents\Arduino\libraries\
  • macOS/Linux: ~/Documents/Arduino/libraries/
  1. Restart the Arduino IDE.
  2. The library will now appear in Sketch > Include Library.

---

Part B: Arduino IDE Setup for Programming

Step 1: Connect the Arduino Board

  1. Connect the Arduino board to the computer using a USB cable.

Step 2: Select the Correct Board

  1. Go to Tools > Board > Arduino AVR Boards.
  2. Select your board (e.g., Arduino Uno).

Step 3: Select the Correct Port

  1. Go to Tools > Port.
  2. Select the COM port that corresponds to your Arduino (e.g., COM3 on Windows or /dev/ttyUSB0 on Linux).

Step 4: Verify a Test Sketch

  1. Go to File > Examples > 01.Basics > Blink.
  2. Click the Verify (✓) button to compile.
  3. Click the Upload (→) button to upload to the board.
  4. The onboard LED should start blinking — confirming the setup is correct.

Step 5: Use Serial Monitor

  1. Go to Tools > Serial Monitor (or press Ctrl + Shift + M).
  2. Set the baud rate to match Serial.begin(9600) in your code.
  3. Use it to print debug messages from your Arduino program.

Result

Libraries have been successfully added and Arduino IDE has been configured for programming.