Arduino Libraries and How To Install Them

Arduino libraries are like cheat sheets for building cool projects. They let you borrow code someone else made, so you don’t have to start from zero but can make your things quickly with your Arduino. Also, because lots of people use them, it’s easier to get help and tips.

In this guide, you’ll learn how to install Arduino libraries. There are two ways to install Arduino libraries; manually or using the library manager in Arduino IDE.

Installing Arduino Libraries with the Arduino IDE

The easiest way to install a library is by using the library manager in Arduino IDE.

Installing arduino libraries with the library manager

Here’s how you do it:

  • Open the Arduino IDE.
  • Go to Sketch > Include Library > Manage Libraries…
  • The Library Manager will open and you can search for the library you want to install.
  • Once you find it, click on it to select it and then click on “Install”.

That’s it!

Unfortunately, not all libraries can be found in the library manager. If that’s the case for the library you want to install, you need to install it manually.

Installing an Arduino Library Manually

If you need to install a library manually, don’t worry, it’s pretty straightforward. Here’s how you do it:

  • Download the library as a ZIP file.
  • Open the Arduino IDE.
  • Go to Sketch > Include Library > Add .ZIP Library…
  • Navigate to where you downloaded the ZIP file and select it.
  • The IDE will install the library and you should be able to use it in your projects.
Installing an arduino library manually

Including Libraries in Your Code

Once you’ve installed the library you want to use, don’t forget to actually include it in your code. To do this, you need to use the #include statement. For example

#include <Wire.h>

This includes the Wire library, which is used for I2C communication.

Most Common Arduino Libraries

There are a lot of libraries available for you to use. The most common Arduino libraries used for a wide array of projects are:

  1. Wire – for communicating with I2C / TWI devices.
  2. SPI – for communicating with devices that use the Serial Peripheral Interface (SPI) Bus.
  3. EEPROM – for reading and writing to the permanent storage.
  4. Servo – for controlling servo motors.
  5. Stepper – for controlling stepper motors.
  6. LiquidCrystal – for interfacing with LCD screens.
  7. SD – for reading and writing on SD cards.
  8. WiFi – for connecting to the internet using the Arduino WiFi shield.
  9. Ethernet – for network connectivity through the Ethernet shield.
  10. GSM – for cellular communication using the GSM shield.
  11. Adafruit_Sensor – basis for many of Adafruit’s sensor libraries.
  12. NeoPixel – for controlling Adafruit NeoPixels LED.
  13. FastLED – for controlling LEDs and LED strips with high-performance patterns and effects.
  14. PubSubClient – for implementing MQTT protocol to connect to IoT servers.
  15. DHT sensor library – for reading temperature and humidity from DHT sensors.
  16. OneWire – for devices that use one-wire protocol especially DS18B20 temperature sensors.
  17. IRremote – for sending and receiving infrared signals with an IR remote.
  18. AccelStepper – for controlling multiple stepper motors with high precision.
  19. RTClib – for interfacing with Real Time Clock modules.

Note that some libraries are included with the Arduino IDE by default, such as Wire and SPI, and don’t need a separate installation.

More Arduino Tutorials

Leave a Comment