The Seed Sensor

A photocell measures light intensity, with higher intensity correlating with higher current and lower intensity with lower current. For a more detailed explanation and tutorial on photocells, visit Ladyada’s ever-helpful website.[47] By placing the photocells at a level beneath the seeds poured into the feeder, we can detect when the seed level dips below the sensor, exposing it to more light and thereby alerting us that the feeder needs to be refilled.

Before drilling holes into the feeder for placement of the photocell, we need to write some code and test it using the same approach that we did for our homemade foil resistor.

Connect one of the photocell leads to the Arduino 5v pin and connect the other photocell lead to ...

Get Programming Your Home now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.