-->
Page 1 of 2

AMS / TAOS TSL2561 Light / Lux Sensor code

PostPosted: Wed Jul 08, 2015 6:59 am
by metalphreak
https://github.com/MetalPhreak/ESP8266_TSL2561

Finished this off today. Code provides access to all the registers via i2c and provides a function to convert the raw data into Lux units.

https://www.sparkfun.com/products/12055
http://www.adafruit.com/products/439
http://www.aliexpress.com/item/TSL2561- ... 85740.html

I ordered mine from Aliexpress and it arrived within a couple of weeks.

Enjoy!

Re: AMS / TAOS TSL2561 Light / Lux Sensor code

PostPosted: Thu Jul 09, 2015 4:51 am
by metalphreak
https://thingspeak.com/channels/46061

Up and running for a day with no issues :D

Re: AMS / TAOS TSL2561 Light / Lux Sensor code

PostPosted: Thu Jul 09, 2015 9:38 am
by eriksl
Please note that a proper Lux calculation of this device requires the use of the powf() function, which needs a LOT of iram memory. Space that I haven't got in my firmware. How did you resolve this?

Re: AMS / TAOS TSL2561 Light / Lux Sensor code

PostPosted: Fri Jul 10, 2015 5:44 am
by metalphreak
Have a look at the datasheet for the TSL2561. They provide all the necessary code for use in microcontrollers using scaling and bitshifting. This is what the adafruit arduino library is based on, and is the efficient way of doing it. The sparkfun library uses the pow() function and floating point math... not so great!

http://ams.com/eng/content/download/250 ... 485/142937