tag:blogger.com,1999:blog-5009749739032040342.post1663633255846122188..comments2023-05-05T07:15:32.089-04:00Comments on Medic for Life: If it ain't broke...Statichttp://www.blogger.com/profile/10366235037249278451noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5009749739032040342.post-56983958018214716932015-10-15T14:48:44.388-04:002015-10-15T14:48:44.388-04:00What I'm building is a remote datalogger for s...What I'm building is a remote datalogger for several parameters; temperature, weight scale, humidity and IR for a prototype solar water evaporator. The chemistry of the evaporator depends on the mentioned variables. I'm using TMP36 for temp, I2C humidity sensor, strain gauge for sensing the output of the liquid and TSL2561 to sense how much IR that can be utilized in evaporation process is blocked by the poly-carbonate sheet used for housing the evaporator. <br /><br />The spec sheet for TSL2561 shows the sensing IR spectrum which has a peek of 8 um. Google research shows 8 -15 um as the thermal IR wavelength. Based on that I assumed this sensor would work for my application. Any thoughts/comments will be of lot of value.<br /><br />I'm not using any code from GitHub other than yours. Other sensors were fairly simple to integrate and Adafruit has sample codes for them on their site. Anonymoushttps://www.blogger.com/profile/08357604818145305981noreply@blogger.comtag:blogger.com,1999:blog-5009749739032040342.post-12344322838339041272015-10-15T10:34:05.802-04:002015-10-15T10:34:05.802-04:00I don't know if gain=0 is auto-gain. I'm ...I don't know if gain=0 is auto-gain. I'm going to work on getting my sensor system back up and running this weekend, so I can get things installed around the house over winter.<br /><br />One big thing, I'm not sure this IR is true thermal IR. It may be a poor measure of heat (in fact, I'm almost positive it is, I just can't point you to a specific discussion about it). If you're looking to measure heat, there are I2C non-contact thermometer sensors out there.<br /><br />Could you post up a link to the GitHub you're using?Statichttps://www.blogger.com/profile/10366235037249278451noreply@blogger.comtag:blogger.com,1999:blog-5009749739032040342.post-88577226887042928262015-10-15T09:48:01.435-04:002015-10-15T09:48:01.435-04:00Hello,
Thanks a bunch for your response; do appre...Hello,<br /><br />Thanks a bunch for your response; do appreciate it.<br /><br />I did review the thread link you sent on Adafruit forum. "huelke" had posted a revised code of yours, but when I compared it to your "TSL2561.py" posted on GitHub, it appeared to be the same except for he renamed the Class luxmeter and you call it TSL2561 and few other label differences. Also; looking at the dates, his post was on May, 2015 and you updated your code on GitHub in July, 2014; so your GitHub code may have have his corrections.<br /><br />I'm going to run your code again in a more systematic way to validate the results I'm getting. I'm really interested in the IR value as I'm looking to monitor thermal IR produced by solar for my evaporator application. I'm not a pro yet with Python so still trying to understand the code. From what I understand, if I want to place the sensor outdoors in the sun, I should use auto gain feature, do you recall if that is same as gain=0 ??<br /><br />I again want to thank you for your help and I may seek more while I try to make this work :)<br /><br />Greetings from Atlanta.<br /><br />JayAnonymoushttps://www.blogger.com/profile/08357604818145305981noreply@blogger.comtag:blogger.com,1999:blog-5009749739032040342.post-63212661388598610372015-10-14T10:16:18.598-04:002015-10-14T10:16:18.598-04:00Thanks for posting up!
It's been awhile since ...Thanks for posting up!<br />It's been awhile since I worked on this. I'm running down the documentation I did over on the Adafruit forums. It looks like we found a problem here:<br />http://forums.adafruit.com/viewtopic.php?f=8&t=34922&start=60<br /><br /><br />Unfortunately, I don't seem to have access to the GitHub page (bizarre). Could you provide me with a direct link?<br /><br />I can answer some of the code questions, though:<br />In Python, the __init__ method is automatically run whenever an object of the class is instantiated. You should never have to call it manually (I don't know what happens if you try to). The short answer: You do not need to call it, Python will do it for you at runtime.<br /><br />I believe that the readlux() method is using autogain. Further, there may be errors in the code that I was using. See the link above, that takes you to the Adafruit forums. If it doesn't take you directly to the page, go to Page Six, of TSL2561 and Raspberry Pi. The really good news is that there are some serious experts there that have addressed the code.<br /><br />I never explicitly tested the IR reading capability. In theory, you should just have to call tsl.readIR(), but I didn't have a steady IR source to test it out.<br /><br />The 'if __name__ == "main":' at the end of the code is to allow the code to either be used as a module, or to run independently. If the code is run independently (just telling python to run the code, as opposed to importing it into another code), then it sets the variable '__name__' to '__main__'. Then it will run the code within the code block. I use this as a code test during development. It lets me easily test the code while allowing me to write the code to be easily used by other programs. You can uncomment the lines with '#' in front of them, within that code block, to get the test program to report all of the values. There may be an issue with the auto-gain and integration times. Check the Adafruit link that I posted above.<br /><br />Good hearing from you, let me know if I can help.<br /><br /><br />Statichttps://www.blogger.com/profile/10366235037249278451noreply@blogger.comtag:blogger.com,1999:blog-5009749739032040342.post-7678694675599021882015-10-13T12:52:37.376-04:002015-10-13T12:52:37.376-04:00Hello,
I'm trying t use your code for TSL2561...Hello,<br /><br />I'm trying t use your code for TSL2561 that you posted on GitHub. I've downloaded the updated I2C Adafrurit and seem to be communicating with the sensor, but the reads comming back seem to be jumping all over the place. I'm not clear what calls I need to make to read the ambient and IR values. My datalogger will logging values of the ambient and IR level outdoor in the sunshine, so I would think I should be using auto gain ?? <br /><br />At end of of your code you have the following calls... <br /><br />if __name__ == "__main__":<br /> tsl=TSL2561()<br /> print tsl.readLux()<br />#print "LUX HIGH GAIN ", tsl.readLux(16)<br />#print "LUX LOW GAIN ", tsl.readLux(1)<br />#print "LUX AUTO GAIN ", tsl.readLux()<br /><br />Question:<br /><br />- In the example you just screen print tsl.readlux() and the rest of them are commented out. Is the readlux() call using auto gain ?<br /><br />- Do I need to first call __init__()<br /><br />- To read IR, do I just call the tsl.readIR() ??<br /><br />I tried doing the above, but the values change quite a bit from read to read.<br /><br />Any help would be greatly appreciated.<br /><br />Thanks,<br />Jay Anonymoushttps://www.blogger.com/profile/08357604818145305981noreply@blogger.com