Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

TSL2561 lux sensor


  • Please log in to reply
4 replies to this topic

#1 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 29 October 2011 - 06:12 PM

Hi,

I am working on connecting a TSL2561 lux sensor to a Netduino. It is an i2c device.

Can you please take a look at the Arduino wiring diagram and let me know if I can do the same wiring to a Netduino?

Do I need to add any pull-up resistors or can I wire as shown and expect it to work?

#2 Spork

Spork

    Advanced Member

  • Members
  • PipPipPip
  • 105 posts

Posted 29 October 2011 - 07:12 PM

The wiring diagram looks good to me, for Netduino. Note that the two small black surface mount devices labeled "103" are 10K resistors. These seem common as pull up resistors on i2c breakouts. The schematics for the product are available, but you'll need Eagle to view them. I've included a screenshot, below. Note that the 10K resistors are being used as pullups for SDA and SCL.

Posted Image

#3 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 29 October 2011 - 07:28 PM

The wiring diagram looks good to me, for Netduino. Note that the two small black surface mount devices labeled "103" are 10K resistors. These seem common as pull up resistors on i2c breakouts. The schematics for the product are available, but you'll need Eagle to view them. I've included a screenshot, below. Note that the 10K resistors are being used as pullups for SDA and SCL.


Thanks Spork. I figured the pull-ups might be in there already, but didn't notice that there were Eagle schematics available.

Now I just need to convert the C++ code to C# :blink: :D

#4 Spork

Spork

    Advanced Member

  • Members
  • PipPipPip
  • 105 posts

Posted 29 October 2011 - 10:51 PM

Coincidentally, I just finished reading the "High resolution light measurement" thread. Glad you decided to go with the i2c lux sensor. Netduino + i2c has kept me pretty happy and I always lean toward i2c options when shopping. The MinM is another example of super-convenient micro-controller/i2c overkill. :) It combines LEDs and an ATtiny85 micro-controller on one little board. I bought three for a project and it was ridiculously easy to interface and control them via i2c. Sure, my silly little project ended up with a total of 4 microprocessors, but it was orders of magnitude easier than trying to do everything directly with the Netduino.

Anyway, that thread was a good read. I think I might actually try out TI's "MSP430 LaunchPad Value Line Development Kit" mentioned in one of the posts. There is at least one thing I've wanted to build on top of Netduino that would benefit from offloading some of the high frequency work onto an auxiliary controller.

One other thing... You might want to check out the I2CBus classes by FusionWare and Phantom Typist -- they're in other threads in these forums. If you write your TSL2561 code as a "driver" for one of these bus classes, it might save you a little bit of time and also help if you ever want to hook up another i2c device at the same time as the TSL2561. Others have posted I2CBus compatible code back to the forums for others to benefit from, which was a huge help for me when I was starting with Netduino and i2c.

Good luck with the project.

#5 monewwq1

monewwq1

    Advanced Member

  • Members
  • PipPipPip
  • 104 posts

Posted 29 October 2011 - 11:08 PM

Coincidentally, I just finished reading the "High resolution light measurement" thread. Glad you decided to go with the i2c lux sensor. Netduino + i2c has kept me pretty happy and I always lean toward i2c options when shopping. The MinM is another example of super-convenient micro-controller/i2c overkill. :) It combines LEDs and an ATtiny85 micro-controller on one little board. I bought three for a project and it was ridiculously easy to interface and control them via i2c. Sure, my silly little project ended up with a total of 4 microprocessors, but it was orders of magnitude easier than trying to do everything directly with the Netduino.

Anyway, that thread was a good read. I think I might actually try out TI's "MSP430 LaunchPad Value Line Development Kit" mentioned in one of the posts. There is at least one thing I've wanted to build on top of Netduino that would benefit from offloading some of the high frequency work onto an auxiliary controller.

One other thing... You might want to check out the I2CBus classes by FusionWare and Phantom Typist -- they're in other threads in these forums. If you write your TSL2561 code as a "driver" for one of these bus classes, it might save you a little bit of time and also help if you ever want to hook up another i2c device at the same time as the TSL2561. Others have posted I2CBus compatible code back to the forums for others to benefit from, which was a huge help for me when I was starting with Netduino and i2c.

Good luck with the project.


I am still on a quest to build an accurate lux/foot-candle meter using off-the-shelf components. While it was frustrating at times, the high frequency light measurement project was a great learning experience for me, and now I understand that it is not bad practice to use additional chips in my projects. I have that TSL235R sensor working fine now. To get it working, I ended up writing a frequency counter for a PIC18F252 and then sending the measurements from the PIC18 to the Netduino via UART. I compared the PIC18 frequency readings against measurements right from the sensor using a high-quality o'scope, and my frequency counts prove correct.

The current problem is that the TSL235 sensors measure outside the visible light spectrum and there is no simple way to calculate the intensity of only the visible spectrum. The TSL2561 presumably solves this by providing a way to "subtract" the non-visible spectrum so that I am only looking at the intensity of the visible spectrum.

My intro to microcontrollers began with an Arduino and BlinkM i2c RGB LEDs. You're right, not to mention being really expensive, those LEDs are i2c overkill, but for me they served as a great intro to i2c communications.

I'll be checking the forums for those I2CBus classes.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.