Shop OBEX P1 Docs P2 Docs Learn Events
Temperature effects on Photo Resistor - Page 2 — Parallax Forums

Temperature effects on Photo Resistor

2»

Comments

  • doggiedocdoggiedoc Posts: 2,242
    edited 2012-10-12 09:18
    Thank you Tracey Allen!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-12 11:09
    I suppose that you could take Two of these Cadium Sulfide photocells and have one go to the plus on a comparator or op amp and the other to the minus. Then cover one so that it merely works as a temperature sensor that adjusts to resistance drift, and the other operate in the normal fashion. The output might remain reasonably consistent.

    But knowing that there are dark days and bright days, I suspect that using a RTC and having it enabled on a sunrise/sunset calculation with some allowance for the chickens to get settled would make the whole thing a lot easier.

    And frankly, if you have the solar panel there as a huge light sensor, why are you using a CdS cell at all?
  • doggiedocdoggiedoc Posts: 2,242
    edited 2012-10-12 13:25
    I suppose that you could take Two of these Cadium Sulfide photocells and have one go to the plus on a comparator or op amp and the other to the minus. Then cover one so that it merely works as a temperature sensor that adjusts to resistance drift, and the other operate in the normal fashion. The output might remain reasonably consistent.
    Interesting idea... I might have to experiment with it some.
    And frankly, if you have the solar panel there as a huge light sensor, why are you using a CdS cell at all?
    Haven't thought of that, but I've stored the panels until I can build another for the array to get the voltage up to where I need it for charging.
  • Prophead100Prophead100 Posts: 192
    edited 2012-10-12 18:55
    doggiedoc wrote: »
    Thanks Prophead100 - should I assume the solar object you speak of is in the OBEX?

    Yes. You can get it from either the post or the OBEX. The twilights directly correspond to light levels. Civil twilight is basically when one can still see well enough to work, nautical twilight is when you can see silhouettes and astronomical is when you can get a good view of the stars. Part of the reason I wrote the object was related to biology work with a couple species where the position of the sun relative to a roost was important for behavioral thermoregulation. I also use it on a propclock to help me schedule outdoor activities.

    As a side note, If your coup temperature is affected by solar insolation and your managing ventilation or want to match behavior to heat, there is an additional method I have in draft that I was planning to add to the object that estimates the rough energy in kW/m2 based the thickness of the atmosphere, time, location, and elevation. [clouds not withstanding] ( Meinel AB, Meinel MP. Applied Solar Energy.; 1976 p. .) Let me know if you need it.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-13 23:12
    If you really are into trying using two and a compartor, use a slow, cheap comparator. And you may need to add a bit of hystersis via a feedback resistor. The PDF has examples.

    I have been looking at the LM339 for instance.
  • doggiedocdoggiedoc Posts: 2,242
    edited 2012-10-14 04:24
    I have a multitude of op amps in my bin to choose from: LM339, LM2901, LM358, TL082, TL070, LM741, LM2904, LM393, TLC272 - and I'm sure there are others... :D

    I've got so many of the TL070 chips I was thinking of making some "art" out of them. :D:D:D
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-14 07:21
    The LM 339 is a comparator, NOT an op amp. It should be simpler to wire. It will try to swing full high or full low. You do need a pull up on the output to +5 for the BasicStamp of about 3K ohms.

    As far as sorting out which goes to plus and which goes to minus, I suspect that it will work either way if you adjust the program in the BS accordingly.

    But read the PDF and add the hystersis to avoid the possibality that it might oscillate.
  • doggiedocdoggiedoc Posts: 2,242
    edited 2012-10-14 08:13
    I was under the impression that comparators were op amps.

    I stand corrected.

    I have attached a good article explaining the difference.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-15 04:00
    A few years back I have the same illusion and collected op amps and comparators that had similar IC numbers. The biggest problem I now have with comparators is that I never really need 4 in one package, but singles and pairs are more difficult to purchase locally.

    Be sure to read the PDF on how to tie down unused ones (to lower power consumption).
  • LawsonLawson Posts: 870
    edited 2012-10-15 09:26
    doggiedoc: That .pdf simplifies things a bit. First, quite a few Op-amps have specifications on saturation response and recovery time. They're almost universally bad compared to a comparator, but still specified as it's not uncommon to overdrive an input. Second, he didn't talk about input protection differences. Many op-amps use a pair of diodes connected between the inputs, fine for closed loop use but trouble if used as a comparator. Third, a lot of modern comparators have some hysteresis built in. If you actually need precision to less than a mili-volt an open loop op-amp might be the best choice. Fourth, whatever you do read the datasheet. Take for instance the MCP6401 low power op-amps. Page 18 of the datasheet tells you it's fine to treat unused op-amps in a package as a comparator! Fifth, he seems to have missed the significance of the capacitor in the op-amp example schematic. It adds negative feedback and shapes the op-amp gain into the nice integrator like shape shown in the next figure. (also, the example comparator is simple enough that the right external components could turn into a good op-amp)

    So "I was under the impression that comparators were op amps." is I think quite accurate, but like you generally don't use a 3/4" wrench on a 1/4" screw head, using an op-amp as a comparator is generally a bad idea.

    Anywho, enough ranting.
    Lawson
  • doggiedocdoggiedoc Posts: 2,242
    edited 2012-10-15 09:32
    @Lawson - fantastic feedback! Thanks!

    @Loopy - I thought you had everything at your fingertips over there.
    ...singles and pairs are more difficult to purchase locally.
    :D
  • davejamesdavejames Posts: 4,047
    edited 2012-10-15 10:07
    doggiedoc wrote: »
    I was under the impression that comparators were op amps.

    I stand corrected.

    I have attached a good article explaining the difference.


    Thanks for the link, Doc. :thumb:
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-15 11:15
    I know that I was the guy that suggested the use of a comparator, but I need to say thanks to Doggiedoc. That PDF you posted is much clearer on how to properly use them than what I have on hand.

    In particular, I have been looking high and low on the internet for how to rig the hysteresis resistor with a mathematical formula. In your case, you may have to have quite a bit more than normal as a cloudy day might have the door opening and closing as clouds float by if you have it too close (the usual hysteresis is something like 10 micro-volts and intended for electronic noise).
  • doggiedocdoggiedoc Posts: 2,242
    edited 2012-10-15 14:51
    Loopy - I haven't implemented the comparators yet. I got distracted while learning to use the SD driver that Kye wrote with the plan of doing some data logging. I was doing pretty good until I somehow managed rip the frickin' USB connector off of the Gadget Gangster board! I was furious@! I didn't notice the USB cable had looped around the corner of my desk and when I picked it up it ripped the damn thing right off... traces and all!

    Good news is.. I salvaged the SD reader from it and soldered to a GG Quick Adapter Module.... added the four 10K resisters and was back in action! :D
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-16 10:15
    I understand. I was plugging along with studying first GCC and then Catalina C, now suddenly I am working with PropForth and TachyonForth. Not only that, I decide to set up individual Propeller Proto Boards for the two versions of Forth and I found that my desoldering of clutter on one board managed to disconnect the 3.3 V supply from the Propeller chip. So there was a day's delate in figuring out how to repair it.

    And now that you cleared up some comparator issues for me, I want to get back to using an LM339 with a zener to create an automatic low voltage cutout for my Lithium ion cells as I already ruined two brand new 18650 cells by not having such protection.

    Projects just seem to abound. I hope the chickens are doing well.
  • cdacunha71cdacunha71 Posts: 1
    edited 2013-11-28 14:35
    Hi Doggiedoc,

    I'm facing a very similar issue, I'm also using a photoresistor to drive an automatic chicken coop door closer, unfortunately it only work well for a couple of weeks. After some cold foggy days, the LDR stops working properly. The only solution left is to replace it by a new one, to me it seems the moisture permanently affects it.

    So I wonder if you were able to fix your issue or if you have seen similar behaviour.

    Regards,

    Carlos
  • doggiedocdoggiedoc Posts: 2,242
    edited 2013-11-28 20:30
    Hello cdacunha71 and welcome to the Parallax forums. My temperature issues seem to have resolved when a corrected a wiring mistake on my ADC. Since that time It is has not been an issue. But I also eliminated the long wires that I had connecting the photoresistor and soldered directly to the board. Not sure if that may have been a factor as well.

    Doc
  • Mark_TMark_T Posts: 1,981
    edited 2013-11-29 16:27
    skylight wrote: »
    If staying with a temperature problem, maybe it's not just the sensors?
    Presuming the connecting wires/cable are heating/cooling and you are taking resistance readings (light on cell), the length of run (from board to sensor) maybe a factor?
    how precise is the function that decides whether the door opens or closes? You might have to factor in a margin to cover for heating effect?
    Which boils down to what I was saying earlier, is the circuit and programming too sensitive for the application?

    Training may involve teaching the chickens to flap their wings to stabilise the coop's temperature :)

    Its probably the sensor, cadmium sulfide is a semiconductor and semiconductors have bulk resistivities
    very sensitive to temperature, either through thermal generation of electron-hole pairs or thermal
    dependence of recombination-time.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-11-30 08:29
    As best as I can recall, these CdS sensors were very successfully deployed for turning on street lights at dusk and turning the same off at dawn.

    I just wonder how those were installed. A check at Digikey of a Cds vendor shows they claim the operating and storage temperature range to be from -30C to +75C.

    Maybe some are poorlly packaged and others are well-built. The ones at Digikey look very good, but I seem to remember having some that were not as well protected.
Sign In or Register to comment.