TSL2561 Luminosity Sensor Hookup Guide

This Tutorial is Retired!

This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.

Pages
Contributors: MikeGrusin
Favorited Favorite 3

Installing the Arduino Library

Libraries are collections of software functions geared towards a single purpose, such as communicating with a specific device. Arduino comes with a number of built-in libraries that help you do advanced tasks. We've written an Arduino library called SFE_TSL2561 that allows you to easily talk to the TSL2561 sensor. This library is not included with the stock Arduino software, but don't worry, installing new libraries is easy.

If you'd like to interface the TSL2561 to a microcontroller other than an Arduino, the C++ source code in the library and the information in the datasheet may be helpful when writing your own code.

1. Install the Arduino IDE

If you don't already have the Arduino IDE (Integrated Development Environment) installed, download the version for your system (Windows, Mac, Linux) from http://arduino.cc/en/Main/Software and install it following the instructions on that site.

If you need help installing the IDE, check out our tutorial.

2. Install the SFE_TSL2561 library

User-installed libraries live in a "libraries" folder within your personal Arduino sketch folder. On Windows systems your personal sketch folder is located in "My Documents/Arduino". On Mac computers, it's "~/Documents/Arduino". On Linux it is usually "~/Arduino/sketchbook". Locate your personal Arduino sketch folder and open it so you can drag new files into it.

Now download the latest TSL2561 software archive from https://github.com/sparkfun/TSL2561_Luminosity_Sensor_BOB. Look for and click the "Download ZIP" button and save the file to your system.

alt text

When you open the .zip file you just downloaded (on most systems you should be able to double-click it to show the included files), you'll see several folders. Drag the "libraries" folder from the .zip folder into your personal Arduino sketch folder. If you get a warning that there is already a libraries folder there, that's fine. (It just means you've already installed some libraries, which is great!) Just tell your system to go ahead and overwrite them, which sounds alarming but will only add the new library to the existing folder.

alt text

That's it! Now restart the Arduino IDE and you should be ready to go.

If any of these instructions are unclear, you can find more detailed instructions in our installing an arduino library tutorial.