Need help with TSL2540 light sensor libraries

I'm building a device to detect IR light using TSL2540. I looked for the libraries on internet but didn't find anything.
Is there any way around to modify the libraries of similar light sensors like TSL2591 to work for TSL2540?

Thank you in advance.

Hi, @tarun132
Welcome to the forum.

That sensor is I2C but it doesn't happen to be use on Arduino.

Can you please tell us your electronics, programming, arduino, hardware experience?

Tom.... :smiley: :+1: :coffee: :australia:

I'm using Arduino Due and used TSL2591 light sensor to detect IR light., everything works fine there, but I want to use TSL2540 instead of TSL2591 as it supports I2C but has smaller dimensions.

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

The TSL2540.h and TSL2540.cpp from here look like they would work:

Put them in Arduino/libraries/TSL2540 to make an Arduino library.

    unsigned short readVisible(void);
    unsigned short readIR(void);

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