Help!.
I bought this brightness sensor to be able to detect 1/10 of lux, but in fact it would seem that the minimum resolution is 1lux !. Does anyone know the code for ARDUINO to detect a brightness of 0.1lux? if YES, can you share it with the whole forum? if NO, adafruit does not produce another sensor able to have that resolution of brightness?
Any help will be greatly appreciated !.
Thank you
Gerbelli M.
TSL2561 lux sensor - resolution 0.1lx
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: TSL2561 lux sensor - resolution 0.1lx
I don't know what code you are running. Try setting this in your code.
Code: Select all
// tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); /* 16-bit data but slowest conversions */
- gerbelli
- Posts: 6
- Joined: Tue Nov 28, 2017 4:24 pm
Re: TSL2561 lux sensor - resolution 0.1lx
tsl.setGain(TSL2561_GAIN_16X); /* 16x gain ... use in low light to boost sensitivity */
tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); /* 16-bit data but slowest conversions */
I supposte that the problem is the resolution of the variable lux that it's a integer and not a decimal (float) number!.
See also the result in the attached image: the resolution is 1.00 lux and not 0.10lux !,
Below I enclose the code used:
Code: Select all
#include <Adafruit_TSL2561_U.h>
#include <pgmspace.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#include <SPI.h>
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);
void setup() {
Serial.begin(9600);
Serial.println("Light Sensor Test");
Serial.println("");
if(!tsl.begin())
{
Serial.print("Ooops, no TSL2561 detected ... Check your wiring or I2C ADDR!");
while(1);
}
tsl.setGain(TSL2561_GAIN_16X); /* 16x gain ... use in low light to boost sensitivity */
tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); /* 16-bit data but slowest conversions */
sensor_t sensor;
tsl.getSensor(&sensor);
Serial.println("------------------------------------");
Serial.print ("Sensor: "); Serial.println(sensor.name);
Serial.print ("Driver Ver: "); Serial.print(sensor.version); Serial.println(TSL2561_LUX_LUXSCALE); //(sensor.version);
Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id);
Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" lux");
Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" lux");
Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" lux");
Serial.println("------------------------------------");
Serial.println("");
delay(500);
}
void loop() {
sensors_event_t event;
tsl.getEvent(&event);
/* Display the results (light is measured in lux) */
if (event.light)
{
Serial.print(event.light); Serial.println(" lux");
}
else
{
Serial.println("Sensor overload");
}
delay(250);
}
Last edited by Franklin97355 on Fri Dec 01, 2017 5:58 pm, edited 1 time in total.
Reason: Added missing code tags.
Reason: Added missing code tags.
- gerbelli
- Posts: 6
- Joined: Tue Nov 28, 2017 4:24 pm
Re: TSL2561 lux sensor - resolution 0.1lx
So, nobody is able to modify the TSL2561 shield library to increase the brightness reading resolution to 0.1lux?
I am very sorry for this ...
I am always listening if someone has found the solution ....
Marcello
I am very sorry for this ...
I am always listening if someone has found the solution ....
Marcello
- gerbelli
- Posts: 6
- Joined: Tue Nov 28, 2017 4:24 pm
Re: TSL2561 lux sensor - resolution 0.1lx
Honestly I thought that an Adafruit technician would explain me why it is indicated that the sensor has a sensibility of 0.1 lux but in the reality this is limited with a resolution of 1lux !. Perhaps it was better that this limitation on the website was better specified.
The same also applies to the TSL2591 board! (it's indicate that the sensor detect light ranges from 188 uLux up to 88,000 Lux on the fly, it's wrong!. the resolution is always 1 lux!.)
Thanks anyway.
Gerbelli
The same also applies to the TSL2591 board! (it's indicate that the sensor detect light ranges from 188 uLux up to 88,000 Lux on the fly, it's wrong!. the resolution is always 1 lux!.)
Thanks anyway.
Gerbelli
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: TSL2561 lux sensor - resolution 0.1lx
Sorry. If you're concerned about that reported output, don't be. It's unfortunately a red herring. It's just hardwired to 1.0 and nothing changes it:
https://github.com/adafruit/Adafruit_TS ... U.cpp#L536
Calling tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); should configure it properly:
https://github.com/adafruit/Adafruit_TS ... U.cpp#L246
https://github.com/adafruit/Adafruit_TS ... U.cpp#L536
Calling tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); should configure it properly:
https://github.com/adafruit/Adafruit_TS ... U.cpp#L246
- ktownsend
- Posts: 1447
- Joined: Thu Nov 05, 2009 2:18 am
Re: TSL2561 lux sensor - resolution 0.1lx
The issue here is that the driver is based on integer math, which obviously necessitates steps of 1 lux. This code and the algorithm used to convert to lux is based on the app notes from the manufacturer, and is the only information we have to go on unfortunately: https://github.com/adafruit/Adafruit_TS ... U.cpp#L379
- gerbelli
- Posts: 6
- Joined: Tue Nov 28, 2017 4:24 pm
Re: TSL2561 lux sensor - resolution 0.1lx
Thanks for the answers, but I was looking for a luxmeter with a resolution of 0.1 ° C and not 1 ° C !.
Please be positive and constructive with your questions and comments.