Arduino Libraries: Finding, Installing, Managing
Library Manager (Preferred Method)
Sketch > Include Library > Manage Libraries. Search by name, check the author/description to confirm it's the right one (many popular sensors have 3-4 competing libraries — check star count and last-updated date as a rough quality signal), click Install. This handles dependency resolution automatically for libraries that declare their dependencies properly.
Manual Install (.zip Libraries)
For libraries not in the official index (GitHub-only projects, custom forks): download the repo as a .zip, then Sketch > Include Library > Add .ZIP Library. It extracts into your sketchbook's libraries/ folder automatically.
Where Libraries Actually Live
Default sketchbook location:
- Windows: Documents\Arduino\libraries\
- macOS: ~/Documents/Arduino/libraries/
- Linux: ~/Arduino/libraries/
You can drop a library folder directly here manually if the .zip method ever misbehaves — just make sure the folder structure has the .h/.cpp files directly inside it, not nested another level deep.
Version Pinning
Library Manager shows a version dropdown when you click on an already-installed library — useful when a tutorial specifically depends on an older API that a newer library version changed or removed. Pin to the version the tutorial was written against if you hit unexplained compile errors following an otherwise-correct guide.
Resolving Duplicate Definition Errors
If you see "multiple libraries found" warnings in the compile output, it means you have two versions or two different libraries claiming the same header name — check both your sketchbook libraries/ folder and any board-package-bundled libraries for a conflict, and remove the one you don't want.
Good Habits
- Check a library's examples (File > Examples > [LibraryName]) before writing your own code from scratch — most sensor libraries ship a working example that's 90% of what you need.
- Star/bookmark libraries you rely on for real projects — library authors do abandon projects, and knowing where the source lives means you can still find/fork it later if it disappears from Library Manager.
Related Guides
- How to Program Addressable LED Strips: WS2812B Patterns, Effects, and Power Design
- How to Use the ESP32-CAM: Video Streaming, Motion Detection, and Time-Lapse
- I2C vs SPI vs UART: How to Choose and Use Serial Communication Protocols
- How to Use Sensors with Arduino and ESP32: Temperature, Distance, Load, Current, and Hall Effect
- How to Control Motors with Arduino and ESP32: Stepper, DC, and Servo Drivers
- ESP32: Setting Up for Arduino IDE
- Arduino vs ESP32: Which Should You Use? A Practical Comparison
- Getting Started with ESP32: GPIO, WiFi, and Your First Project