Hardware Reference
In-Depth Information
Example Application
For this example, you will import a third-party library to use a piece of hardware.
The Si1145 from Silicon Labs is a digital UV sensor. Targeted for the wearable
market, it is compact, light, and ultra-low-powered. It is a highly professional
solution, but like most professional solutions, it does come at a price. That price is
coni guration. This device is not like the LM35 temperature sensor that requires
a simple analog read; it requires a little bit of coni guration before you can use it.
When set up, it provides a highly reliable readout. It doesn't just read UV; it can
read visible light, infrared light, and when used with an infrared LED, it is also
a proximity sensor. All in all, a highly advanced sensor that is great fun to use.
The Si1145 is difi cult to use on a typical Arduino project. The component
is surface-mounted , meaning it cannot be placed directly on a breadboard. It is
designed to be as small as possible to keep electronic projects small, and as such,
it is difi cult to solder the component to a board by using household equipment.
It takes some skill and a good setup to solder this component by hand. Also, it
is powered by 3.3 V, not the 5 V that an Arduino typically uses. To make this
device easier to use, Adafruit has developed a breakout board for the Si1145
sensor, adding standard-sized pins, allowing it to be used on a breadboard, and
voltage shifters, making it compatible with 5-volt Arduinos. To make it even
easier to use, Adafruit has also created a nicely designed and easy-to-use library.
The i rst thing you require is the Adafruit Si1145 library. You can i nd the
Si1145 breakout board information page here:
https://learn.adafruit.com/adafruit-si1145-breakout-board-uv-ir-visible-
sensor/ overview
From that page, you can visit the “Wiring and Test” link where you will i nd
a link to Adafruit's GitHub repository:
https://github.com/adafruit/Adafruit_SI1145_Library
On that page, there are a few things to note. Figure 24-4 displays the webpage.
Repositories can be in a constant state of change; developers can add, change,
or delete portions of code, and although some projects are updated daily, others
may be updated hourly. You can see the contents of the repository, the i lenames,
folders, and the last time they were updated. At the bottom, the contents of
README.txt are displayed, giving some important information on the project.
To the right, there is some statistical information, the number of bug reports,
and different ways to connect to the server to retrieve the source code. Some
of these involve using the Git software package, but the easiest way is to click
the Download Zip button on the bottom right. This takes a snapshot of the
current project, compresses it into a Zip i le, and downloads the compressed
i le to your computer.
 
Search WWH ::




Custom Search