source code of /projects/light-sensor/index.html

Last modified
Lines 134

Parent directory Download CGIread sitemap Main page

Quick links: contact content footer navigation title

  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.         <meta charset="utf-8"/>
  5.         <meta name="viewport" content="width=device-width, initial-scale=1"/>
  6.         <link rel="stylesheet" href="https://oskog97.com/style.css" type="text/css"/>
  7.         <link rel="icon" type="image/png" href="/favicon.png"/>
  8.         <link rel="canonical" href="https://oskog97.com/projects/light-sensor/"/>
  9. <!-- End html5 macro. -->
  10.         <title>Bloody light sensor</title>
  11.         <meta name="description" content="Analog light sensor"/>
  12.     </head>
  13.     <body>
  14. <!-- BEGIN autogenerated navigation -->
  15. <nav><div id="navigation"><div id="nav_inner">
  16. <p><a href="#content" class="textonly">Skip navigation</a></p>
  17. <p class="row">
  18. <span class="textonly" translate="no">[</span><a class="head" href="/">Home</a><span class="textonly" translate="no">]</span>
  19. &gt;&gt;
  20. <span class="textonly" translate="no">[</span><a class="sub" href="/projects/anonymine/">Anonymine</a><span class="textonly" translate="no">]</span>
  21. <span class="textonly" translate="no">]</span><span class="sub active">Analog light sensor</span><span class="textonly" translate="no">[</span>
  22. <span class="textonly" translate="no">[</span><a class="sub" href="/projects/PLLM-M702A/">Reverse-engineered schematics for PLLM-M702A</a><span class="textonly" translate="no">]</span>
  23. <span class="textonly" translate="no">[</span><a class="sub" href="/small-scripts/">Small scripts</a><span class="textonly" translate="no">]</span>
  24. </p>
  25. <p class="row">
  26. <span class="textonly" translate="no">[</span><a class="sub" href="/sitemap.py">Sitemap</a><span class="textonly" translate="no">]</span>
  27. </p>
  28. <hr class="textonly"/>
  29. </div></div></nav>
  30. <!-- END autogenerated navigation -->
  31. <main><div id="content">
  32.     <h1 id="title">Analog light sensor</h1>
  33.     <p>This is a report on an assignment for a course in process measurement
  34.         technology at Novia UAS. The task is to design, simulate, construct,
  35.         test and calibrate an analog illuminance sensor based on an LDR.</p>
  36.     <ul>
  37.         <li><a href="light-sensor-part-1-design.pdf"
  38.             >Report part 1: Design</a></li>
  39.         <li><a href="light-sensor-part-2-testing.lowres.pdf"
  40.             >Report part 2: Construction, testing, and calibration</a>
  41.             <a download="" href="light-sensor-part-2-testing.pdf"
  42.             >(Download high quality version)</a></li>
  43.         <li><a href="https://gitlab.com/osksko-novia/light-sensor"
  44.             >Browse the project files on GitLab</a> or
  45.             <a href="/archive/light-sensor/light-sensor.tar.xz" download=""
  46.             >download entire project as compressed tape archive</a></li>
  47.     </ul>
  48.     (Downloads are throttled, go make a cup of coffee)
  49.     <h2>Sneak peek at the schematic</h2>
  50.     <img src="schematic.png" alt="(Picture of schematic)"/>
  51.     <h2>LDR characteristic curve</h2>
  52.     <p>It's surprisingly difficult to find any information about
  53.         resistance/illuminance characteristics for photoresistors/LDRs.
  54.         At best you get a straight line on a log-log graph which looks
  55.         too good to be true considering that datasheets specify at which
  56.         illuminance the gamma value is measured.</p>
  57.     <p><var>R = R<sub>10</sub>*(10/E)<sup>gamma</sup></var></p>
  58.     <p><var>R</var> is the resistance, <var>R<sub>10</sub></var> is the
  59.         resistance at 10 lux, <var>E</var> is the illuminance and gamma is a
  60.         "constant"</p>
  61.     <p>Datasheets tend to define
  62.         <var>gamma = log<sub>10</sub>(R<sub>10</sub>/R<sub>100</sub>)</var></p>
  63.     <p>
  64.         Adafruit is the only source I've found with <a class="print"
  65. href="https://cdn-learn.adafruit.com/downloads/pdf/photocells.pdf#page=6"
  66.         >more detailed information about typical characteristics of LDRs:</a>
  67.         slightly curvy traces on a log-log plot.  I meant to add this as a
  68.         reference in part 2, but unfortunately I forgot about and I don't feel
  69.         like making any more late ammendments.</p>
  70.     <h3>Own "research"</h3>
  71.     <p>The sensor is designed to translate conductance (the inverse of
  72.         resistance) directly into a voltage: <var>U = k/R</var></p>
  73.     <p>Approximate model:
  74.        <var>log<sub>10</sub>(U) = a*log<sub>10</sub>(E)<sup>2</sup>
  75.                                 + b*log<sub>10</sub>(E) + c</var></p>
  76.     <img src="curve.svg" alt=""/>
  77.     <p>A lot more details are in the second PDF</p>
  78.     <p>The inverse formula is a bit more funny:</p>
  79.     <img src="formula.svg"
  80.         alt="Sprechen Sie LaTeX?
  81.         $$ E = 10^(\frac{0.789-\sqrt{0.488-0.124 log_{10}(U)}}{0.0621}) $$
  82.         E is the illuminance in lux, U is the voltage in volts. $E \pm 9.4\%$"
  83.     />
  84.     <p>I like to call this "unevenly engineered". If it was over-engineered
  85.         it wouldn't use a sucky LDR and have a sucky 10% accuracy.</p>
  86.     <h2>Copyright</h2>
  87.     <p>I won't bother cluttering the reports any further with explicit
  88.     permissions unless someone actually wants permission to use them.
  89.     If you do please send me a message and I'll do something about it.</p>
  90.     <p>I also may have to do something about one of the images, I'd rather
  91.     make an equivalent myself than trusting fair use if I were to open source
  92.     this project.</p>
  93. </div></main>
  94. <!-- INCLUDED FOOTER -->
  95.     <hr class="textonly"/>
  96.     <p>
  97.         Copyright © Oskar Skog<br/>
  98.         Website content released under the <a
  99.         href="https://creativecommons.org/licenses/by/4.0/" rel="license noopener"
  100.         target="_blank">Creative Commons Attribution (CC-BY 4.0)</a> license
  101.         and my software usually under the <span class="a"><a target="_blank"
  102.         rel="noopener"
  103.         href="https://opensource.org/license/BSD-2-Clause">FreeBSD license
  104.         (2-clause)</a>.</span>
  105.         <br/>
  106.         Images may be from other sites, I should have cited useful sources
  107.         somewhere on the page.
  108.         <span class="notprint">Contact me if I haven't.</span>
  109.     </p>
  110.     <p id="contact" class="notprint">
  111.         You can contact me at: <a href="mailto:oskar@oskog97.com"
  112.         rel="noopener" target="_blank">oskar@oskog97.com</a>
  113.         <span class="a">(<a href="/pgp-pub/oskar.asc"
  114.                             >PGP public key</a>)</span>
  115.     </p>
  116.     <p> <a class="notprint" href="https://oskog97.com/read/?path=/style.css">
  117.             CSS Stylesheet
  118.         </a>
  119.     </p>
  120. </div></footer>
  121. <!-- END OF INCLUDED FOOTER -->
  122.     </body>
  123. </html>