To do a daily task
such as sweep the floor, or water the plants you can do it one
of two ways. First, one can simply put a digital clock circuit
in the robot and have it water the plants at a specific time,
such as noon. Another way which makes for a far more sophisticated
and interactive robot is to look for the sunrise daylight, do
the task, then look for night. Then the search repeats. Because
this robot is a thousand times smarter than any robot Ive done
before it due to the advanced C language Im using to program
it, I went with the photocell brightness approach.
How
it works.
The robots photocell
is a photo diode mounted on the top of the robot, and produces
a voltage of 0 to 5v into the analog input on the PIC. Data ranges
from 0 for night to 1024 for maximum sunlight. At sunrise, the
dark downstairs room is roughly around 30 and this is the first
threshold. When sunup is detected, we wait 10 minutes and test
again, three times. This ensures we are really seeing sunrise
and not the overhead light fixture being turned on for a few
minutes.
Once confirmed,
the watering task is done. Once finished, and re connected to
the docking station, the robot shuts down and waits 14 hours
to begin to look for night time. This prevents the robot from
watering the plants over and over on a partly cloudy day when
the sun is going in and out of clouds, especially at sunrise.
You will see examples of this effect in the graphs below.
Once it sees darkness
around 10pm this time of year, a 2h delay is used to keep the
robot from starting up again from over head lights being turned
on. Finally, it starts the process of looking for daytime all
over again.
I cant stress how
much more sophisticated this algorithm is than what we used in
the floor sweeping robot a few years ago! That robot would wake
us up at 4:30 in the morning and start its noisy vac motors for
half an hour. Some days it would sweep the floors ten times because
of clouds. Well, at least the floor was clean.
|