<div dir="ltr">Murray,<div>     CdS LVR sensors have a light sensitivity similar to the human eye. That is why they were often used in camera light meters in the past. If you get quality cells the match isn't too bad. However, because of price I often buy a quantity of 10 to 30 cells from China on ebay ( about $2 for batch) and select 2 that are close. They do not need to be exact because you can correct mismatches in the software. The shape of the response curves between cells of the same type are generally similar (unless you are getting failed parts). Response times of small CdS cells are generally 20 ms when decreasing value and 30 ms when increasing value. Even 70 ms response time is adequate for a moth / cockroach robot, since you do not need the sensors to be at steady state.  The interesting light intensity value range for this type of robot is usually 4 to 400 Lux (Dark limit of civil Twilight under clear sky to well-lit office area). Published CdS LVR response curves are typically measured over a range of 1 to 100 Lux. Again this is adequate. Brighter than 400 Lux usually isn't too interesting.  As you stated the usable light intensity range is about 10-600 Lux.   </div><div><br></div><div>   I use a proportional speed value based on the absolute difference between the sensors. Like this:</div><div><br></div><div>case LVR_L:                        // Turn Left<br>                       // left mtr slow fwd, right mtr fwd<br>                   set_motors(100 , (100 + pro_LVR_spd));<br>                        delay(15);<br>            break;<br>                case LVR_R:                        // Turn Right<br>                  // left mtr fwd, right mtr slow forward<br>                       set_motors((100 + pro_LVR_spd), 100 );<br>                        delay(15);<br></div><div>break;</div><div><br></div><div>Where pro_LVR_spd is determined:by something like::</div><div><br></div><div>uint16_t proportional_response_LVR (float KP, uint16_t L_LVR_value, uint16_t R_LVR_value) <br>{<br>  uint16_t response = KP * abs(L_LVR_value - R_LVR_value);<br>  <br>  if (response > 100) {    // set max value<br>    response = 100;<br>  }<br>  <br>  return (response);<br>  <br>}<br></div><div><br></div><div><br></div><div>Moth / Cockroach is one of the Braitenburg vehicles. </div><div><br></div><div>Regards,</div><div>Doug P.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 11, 2021 at 10:49 PM Murray Altheim <<a href="mailto:murray18@altheim.com">murray18@altheim.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/02/21 4:17 pm, Doug Paradis wrote:<br>
> Murray,<br>
> Moth / Anti-Moth (i.e., Cockroach) behavior robots are really fun <br>
> for children and are very simple to make. All you need for sensors <br>
> are 2 CdS light sensors and 2 A/D pins. The Build More Robot tutorial<br>
> series had a session devoted to them. They were also demonstrated<br>
> using the Tiny Wander DPRG club robot (see Make Magazine vol 29) <br>
> which used a Attiny13 8 pin processor.<br>
<br>
Hi Doug,<br>
<br>
As you suggest, it'll be fun seeing how the robot reacts to the varying<br>
light levels in my house. Thanks for the link to the video, looks like a<br>
CdS photocell robot works just fine. I'm making a more-than-necessarily-<br>
complicated version of the Moth. Seems a lot of what I do is more than<br>
necessarily complicated. Not sure why that is... I just want life to be<br>
simple. (ha!)<br>
<br>
I'm also interested in having the bias between a left and right sensor<br>
possibly provide a proportional bias steering the robot towards or away<br>
from the light. It might be possible to do something similar with a<br>
CdS cell, but I understand that photocells work within a more limited<br>
light range and aren't very consistent between individual units, though<br>
as the video suggests, maybe that doesn't matter so much. On the other<br>
hand, being able to measure somewhere between 0 and 65K+ lux (using a<br>
BH1750[1]) or 3 to 55K lux with a logarithmic scale using a GA1A12S202<br>
sounds pretty interesting. And response times are more around 10-20ms.<br>
<br>
I was trying to find the specs on a typical CdS cell and it seems their<br>
usable range is more like 10-600 lux and have response times of<br>
somewhere between 50-70ms. The specs (e.g, [2]) usually just say<br>
something like "dark resistance" but don't provide much help about<br>
performance in dark rooms, i.e., provide a helpful notion of the curve<br>
of their response.<br>
<br>
This could of course even be done without a microcontroller or some fancy<br>
new sensor, but we gotta advance the science! :-)<br>
<br>
Cheers,<br>
<br>
Murray<br>
<br>
[1] <a href="https://www.mouser.com/datasheet/2/348/bh1750fvi-e-186247.pdf" rel="noreferrer" target="_blank">https://www.mouser.com/datasheet/2/348/bh1750fvi-e-186247.pdf</a><br>
[2] <a href="https://www.tme.eu/Document/0b7aec6d26675b47f9e54d893cd4521b/PGM5506.pdf" rel="noreferrer" target="_blank">https://www.tme.eu/Document/0b7aec6d26675b47f9e54d893cd4521b/PGM5506.pdf</a><br>
...........................................................................<br>
Murray Altheim <murray18 at altheim dot com>                       = =  ===<br>
<a href="http://www.altheim.com/murray/" rel="noreferrer" target="_blank">http://www.altheim.com/murray/</a>                                     ===  ===<br>
                                                                    = =  ===<br>
     In the evening<br>
     The rice leaves in the garden<br>
     Rustle in the autumn wind<br>
     That blows through my reed hut.<br>
            -- Minamoto no Tsunenobu<br>
<br>
</blockquote></div>