Adafruit SI1145 UV/Visible Light/Infrared Sensor - Arduino and LCD

by cucmq in Circuits > Arduino

3583 Views, 3 Favorites, 0 Comments

Adafruit SI1145 UV/Visible Light/Infrared Sensor - Arduino and LCD

Adafruit SI1145 UV Sensor on Arduino, Displaying on LCD Screen

This project uses an Adafruit SI1145 UV/Visible Light/Infrared sensor to calculate the current UV rating. UV isn’t sensed directly. Rather, it is calculated as a function of the visible light and infrared readings. When I tested it outside, it was accurate based on the the UV reading from weather.com. I envisioned the project with a "steampunk" theme - a device that an airship captain would need when the UV exposure on the deck would require application or reapplication of sunblock.

Gather Necessary Materials

Hardware/Software Required

Configuration of Hardware

IMG_1187.jpg

Solder UV sensor
Connect Arduino to USB port on computer

Connect LCD display to Arduino

  • LCD RS pin – digital pin 12
  • LCD Enable pin – digital pin 11
  • LCD D4 – digital pin 5
  • LCD D5 pin – digital pin 4
  • LCD D6 pin – digital pin 3
  • LCD D7 pin – digital pin 2

Connect UV sensor module to Arduino. (Adafruit's page on the sensor includes a nice tutorial including wiring pics).

  • VIN to power supply – 5V or 3V. I set the sensor to use 3.3V so that the 5V can be used by the LCD screen
  • GND to ground.
  • SCL on sensor to SCL on Arduino - pin A5.
  • SDA on sensor to SDA on Arduino – pin A4.

Wire a 10k potentiometer to +5V and Ground with output to LCD pin 3

Wire a 220 ohm resister to power the backlight of the display, pin 15 to 5V and Pin 16 to Ground.

Add Code to Arduino to Take UV Readings

The attached file includes the code for the Arduino which will initialize the sensor and take UV readings.

Troubleshooting (if Necessary)

I used battery packs to power the Arduino because a 5V power adapter gave it too much power - the display became distorted.

You can view the initialization of the sensor from the serial display in the Arduino. A minor tweak in the code can allow you to check readings on the serial display as well. Change "lcd.print" to "serial.print."

Enjoy!