source code of /projects/light-sensor/index.html
Last modified | |
Lines | 139 |
Parent directory Download CGIread sitemap Main page
Quick links: contact content footer navigation title
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://oskog97.com/style.css" type="text/css"/>
<link rel="icon" type="image/png" href="/favicon.png"/>
<link rel="canonical" href="https://oskog97.com/projects/light-sensor/"/>
<!-- End html5 macro. -->
<title>Bloody light sensor</title>
<meta name="description" content="Analog light sensor"/>
</head>
<body>
<!-- BEGIN autogenerated navigation -->
<nav><div id="navigation"><div id="nav_inner">
<p><a href="#content" class="textonly">Skip navigation</a></p>
<p class="row">
<span class="textonly" translate="no">[</span><a class="head" href="/">Home</a><span class="textonly" translate="no">]</span>
>>
<span class="textonly" translate="no">[</span><a class="sub" href="/projects/anonymine/">Anonymine</a><span class="textonly" translate="no">]</span>
<span class="textonly" translate="no">]</span><span class="sub active">Analog light sensor</span><span class="textonly" translate="no">[</span>
<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>
<span class="textonly" translate="no">[</span><a class="sub" href="/small-scripts/">Small scripts</a><span class="textonly" translate="no">]</span>
<span class="textonly" translate="no">[</span><a class="sub" href="/thinkpad/">-> My IBM thinkpad</a><span class="textonly" translate="no">]</span>
</p>
<p class="row">
<span class="textonly" translate="no">[</span><a class="sub" href="/sitemap.py">Sitemap</a><span class="textonly" translate="no">]</span>
</p>
<hr class="textonly"/>
</div></div></nav>
<!-- END autogenerated navigation -->
<main><div id="content">
<h1 id="title">Analog light sensor</h1>
<p>This is a report on an assignment for a course in process measurement
technology at Novia UAS. The task is to design, simulate, construct,
test and calibrate an analog illuminance sensor based on an LDR.</p>
<ul>
<li><a href="light-sensor-part-1-design.pdf"
>Report part 1: Design</a></li>
<li><a href="light-sensor-part-2-testing.lowres.pdf"
>Report part 2: Construction, testing, and calibration</a>
<a download="" href="light-sensor-part-2-testing.pdf"
>(Download high quality version)</a></li>
<li><a href="https://gitlab.com/osksko-novia/light-sensor"
>Browse the project files on GitLab</a> or
<a href="/archive/light-sensor/light-sensor.tar.xz" download=""
>download entire project as compressed tape archive</a></li>
</ul>
(Downloads are throttled, go make a cup of coffee)
<h2>Sneak peek at the schematic</h2>
<img src="schematic.png" alt="(Picture of schematic)"/>
<h2>LDR characteristic curve</h2>
<p>It's surprisingly difficult to find any information about
resistance/illuminance characteristics for photoresistors/LDRs.
At best you get a straight line on a log-log graph which looks
too good to be true considering that datasheets specify at which
illuminance the gamma value is measured.</p>
<p><var>R = R<sub>10</sub>*(10/E)<sup>gamma</sup></var></p>
<p><var>R</var> is the resistance, <var>R<sub>10</sub></var> is the
resistance at 10 lux, <var>E</var> is the illuminance and gamma is a
"constant"</p>
<p>Datasheets tend to define
<var>gamma = log<sub>10</sub>(R<sub>10</sub>/R<sub>100</sub>)</var></p>
<p>
Adafruit is the only source I've found with <a class="print"
href="https://cdn-learn.adafruit.com/downloads/pdf/photocells.pdf#page=6"
>more detailed information about typical characteristics of LDRs:</a>
slightly curvy traces on a log-log plot. I meant to add this as a
reference in part 2, but unfortunately I forgot about and I don't feel
like making any more late ammendments.</p>
<h3>Own "research"</h3>
<p>The sensor is designed to translate conductance (the inverse of
resistance) directly into a voltage: <var>U = k/R</var></p>
<p>Approximate model:
<var>log<sub>10</sub>(U) = a*log<sub>10</sub>(E)<sup>2</sup>
+ b*log<sub>10</sub>(E) + c</var></p>
<img src="curve.svg" alt=""/>
<p>A lot more details are in the second PDF</p>
<p>The inverse formula is a bit more funny:</p>
<img src="formula.svg"
alt="Sprechen Sie LaTeX?
$$ E = 10^(\frac{0.789-\sqrt{0.488-0.124 log_{10}(U)}}{0.0621}) $$
E is the illuminance in lux, U is the voltage in volts. $E \pm 9.4\%$"
/>
<p>I like to call this "unevenly engineered". If it was over-engineered
it wouldn't use a sucky LDR and have a sucky 10% accuracy.</p>
<h2>Copyright</h2>
<p>I won't bother cluttering the reports any further with explicit
permissions unless someone actually wants permission to use them.
If you do please send me a message and I'll do something about it.</p>
<p>I also may have to do something about one of the images, I'd rather
make an equivalent myself than trusting fair use if I were to open source
this project.</p>
</div></main>
<!-- INCLUDED FOOTER -->
<footer><div id="footer">
<hr class="textonly"/>
<p>
Copyright © Oskar Skog<br/>
Website content released under the <a
href="https://creativecommons.org/licenses/by/4.0/" rel="license noopener"
target="_blank">Creative Commons Attribution (CC-BY 4.0)</a> license
and my software usually under the <span class="a"><a target="_blank"
rel="noopener"
href="https://opensource.org/licenses/BSD-2-Clause">FreeBSD license
(2-clause)</a>.</span>
<br/>
Images may be from other sites, I should have cited useful sources
somewhere on the page.
<span class="notprint">Contact me if I haven't.</span>
</p>
<p id="contact" class="notprint">
You can contact me at: <a href="mailto:oskar@oskog97.com"
rel="noopener" target="_blank">oskar@oskog97.com</a>
<span class="a">(<a href="/pgp-pub/oskar.asc"
>PGP public key</a>)</span>
</p>
<p> <a class="notprint" href="https://oskog97.com/read/?path=/style.css">
CSS Stylesheet
</a>
<a href="https://validator.w3.org/check/referrer" rel="nofollow noopener"
target="_blank" class="notprint"><span
class="img">Valid HTML5</span
></a><br/>
</p>
</div></footer>
<!-- END OF INCLUDED FOOTER -->
</body>
</html>