Using a UVC-sensor with Arduino Uno

Hello,

I have zero programming skills and would need some help. I need to measure the irradiance in mW/cm² of a 254nm-UVC-light-source.

I have an Arduino Uno at home and recently bought this UVC-sensor. Now, it seems Mikroelektronika does not provide code/libraries for Arduino. I would expect it to be fairly easy to make the sensor work with an Arduino Uno - but I have not the slightest clue how to do this.

In case this is a 5min-job: Would any good Samaritan write me the code I need to compile? :slight_smile:

I assume all the necessary information is provided in the link I mentioned above.

Kind regards :slight_smile:

In case this is a 5min-job

No, it is not.

The same basic sensor can be purchased from Adafruit, and comes with a library and application examples for Arduino. Beware: many of the look-alike sensors on eBay and Aliexpress are not compatible with the Adafruit library.

you could have found all you needed yourself! :slight_smile:

from the link to for the board:

Light intensity is converted in digital value by using MCP3221 a successive approximation A/D converter (ADC) with a 12-bit resolution.
Output responsivity of 0.6mV/nW (at 254nm)
Interface : Analog, I2C

and if you looked up MCP3221 there is actually an arduino library with examples for it!

so in summary, either

  1. use the MCP3221 library to get started (if you're not sure of the board's I2C addr you can always find that out using an I2C scanner)
    or
  2. use the analog output from the board directly to you arduino analog input (bear in mind that the uno ADC resolution is 10 bit)

whatever you choose, once you have the ADC readout, you can then do the conversion to determine the corresponding the light intensity

happy coding! :metal:

Dear sherzaad, thank you, this did help a lot! <3

I was connecting all pins mentioned on the website (except the AN-pin) to my arduino, uploaded one of the MCP3221-library-examples and was getting reasonable voltage-readings.

Just two little questions: Is it correct to use all indicated pins except the AN-pin? And should I just ignore the VCC-SEL-thing?

IMHO the only board/arbuino connections for I2C communication would be

12 SCL I2C Clock
11 SDA I2C Data
10 5V Power Supply
7 3.3V Power Supply
9 GND Ground

According to the board's schematic, only matters if you want to use 5V for the I2C pullup resistors (in which case the would be not need to connect pin 7 on the board).

hope that helps...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.