How to install Arduino libraries

Arduino libraries are collections of code that are designed to provide additional, reusable functionality or to simplify using external electronic modules.

Libraries typically come with examples of how to use them. The library developer usually provides online documentation and explains how it possibly relates to what you are trying to achieve.

Installing a library

There are three different ways to install libraries; we'll show you each of them.

Arduino Library Manager

The simplest method of installing libraries is using the Library Manager built into the Arduino IDE.

You can access the Library Manager from the menu bar:

Screenshot: Arduino app highlighting Sketch > Include Library > Manage Libraries...

A new window will open:

Screenshot: Arduino app with the Library Manager open

From here you can search for libraries to use in your code. Only a few libraries are currently available this way, as this feature is relatively new. You will often have to manually download and install a library, following the other two processes.

ZIP library

Locate and download a library you wish to use. Sometimes the library will download as a *.zip archive, which can sometimes be installed directly without restarting the Arduino IDE.

Similar to the Library Manager, this option is in the menu bar:

Screenshot: Arduino app highlighting Sketch > Include Library > Add .ZIP Library..

Use the file dialog to locate and select the zip file from your Downloads folder. You will be notified if the installation has been successful – otherwise you'll need to install manually.

Manually adding libraries

This is the original method of adding libraries.

  1. Locate the Arduino folder inside your Documents directory.
  2. Open the libraries folder. If not found, create a new folder with that name (must be lowercase).
  3. Unzip the library archive that you wish to install.
  4. Inside the archive you should find a folder bearing the name of the library – for example 'MPR121'.
  5. Copy this entire folder (named 'MPR121' in our example) into the Arduino's libraries folder.
  6. Restart the Arduino IDE.
  7. In the menu bar, select Sketch > Include Library. You should now see that your library is listed:

Screenshot: Arduino app highlighting Sketch > Include Library > Add .ZIP Library...


Revision #4
Created 10 July 2021 22:40:04 by Tom Lynch
Updated 31 December 2023 15:25:31 by Tom Lynch