How to Install Arduino Libraries
2018-02-21 | By Maker.io Staff
The Arduino IDE provides several libraries that can be used to make many projects, but, sometimes, specialized hardware or software is needed. In this tutorial, we will learn how to install extra libraries for our project!
Installing Arduino libraries can be done in three different ways: manually installing the files, importing a ZIP file, and using the library manager. Two of these methods can be done with menu options. But for manual installation, you have to locate the library’s files and place them into the Arduino “libraries” folder.
Using the Library Manager
The first method that we will look at is the library manager, which can be loaded by navigating to Sketch > Include Library > Manage Libraries.
Manage Libraries
Once loaded, you should see a window that looks similar to this:
From here, we can search for commonly used libraries and have the IDE automatically download and install them. In our case, we will install an ESP8266 library so that we can connect our Arduino to an ESP8266 device. Start by searching for “ESP8266” in the upper right box. Then wait for the results to appear in the window.
Search results complete
Select the library and then click the “Install” button.
Now we will install the ESP8266 library
While the installation takes place, we should see the bottom progress bar changing and displaying messages such as “Downloading”.
Installation taking place
Once completed, close the library manager, open the IDE window, click Sketch > Include Library, and then look for “Arduino Uno WiFi Dev Ed Library”. Click this option, and the IDE will automatically insert the header file into our project. And that’s it!
The new library in our library list!
Importing ZIP Libraries
Libraries can be imported from ZIP files that are often found online. First, find the library that you want to include. In this case, I will be getting an SD card read/write library, which can be found on GitHub.
https://github.com/arduino-libraries/SD
First, download the library as a ZIP, which is done by clicking the green “Clone or download” button and then clicking “Download ZIP”.
Downloading the ZIP file
Once downloaded, go to the Arduino IDE and click Sketch > Include Library > Add .zip Library.
Adding a ZIP library
In the file dialogue windows that opens, locate your downloaded ZIP file. For me, this file was downloaded to … you guessed it …. “Downloads”.
The downloads folder
Once opened, the IDE will freeze for a second or two. Afterward, you should receive a “Library Added” message just above the debug window.
The library has been added!
Finally, check that the installation was successful. To do this, navigate to Sketch > Include Library and look for the installed library.
The Manual Way
Like the previous steps, we first need to find a library that we want to manually install. For this example, we will install the Arduino sound library which can be found on GitHub.
https://github.com/arduino-libraries/Audio
The first step is to download the library as a ZIP, which is done by clicking the green “Clone or download” button and then clicking “Download ZIP”.
GitHub Download for the Arduino Sound library
Once downloaded, open the ZIP file and in a separate window and navigate to your Arduino folder. This is usually found in your “Documents”, folder and in my example, it is located at C:\Users\RobinLaptop\Documents\Arduino.
Both windows side by side
In the Arduino folder, open the “Libraries” folder and then drag the “Audio-master” folder into the libraries folder.
Drag the library folder into the Arduino library folder
Restart the Arduino IDE and then check to see if the library has been detected by navigating to Sketch > Include Library.
Checking for the Audio library
Conclusion
Installing libraries on the Arduino IDE is incredibly easy, which means expanding your projects should be hassle-free. Many of these libraries also come with examples and explanations, so you should have no trouble using them!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum