Welcome Login
Blog Photos Links

RSS Feed

Directional Light Sensor

April 22, 2011, 11:03 pm - James Farrer

Ever since I got the light meter going I've been thinking about what I could do with it. I want to hook up some servos but I don't have any yet and have needed something to do with them. I had the idea to set up a set of sensors to detect direction of something and then point something at it. Something to the effect of automatic aiming.

So here's what I've done. I set up five photocells each facing out and take the input in. The actual values that come in from each photocell vary so I normalize it between the max and min values for each photocell and map that to a range of 1000. Once I have the normalized data I compare the new value to the last value for each sensor and determine the difference. I set a threshold for the difference to minimize the noise and effectively adjust the sensitivity. Then I compare the difference between each of the sensors and whichever sensor has changed the most indicates the direction.

Since I don't have a servo to actually point in the direction I have set up five LED's with the proper one lighting up based on the direction from the photocells. It's a bit rough but it generally works. The biggest problem with the direction is when shadows cross over it. I think setting up a sort of hood over each photocell should help to keep them more direction based.

Some possibilities for improvement at this point include:

  • Hooking it up a little better so it's not just a bunch of wires strung around
  • Adjusting the LED's so they are also in the same general orientation as the sensors
  • Replacing the LED's with a servo and a set of eyes or something like that to indicate it's following the movement
  • Set up the threshold so it auto-adjusts to the amount of light and the deltas, probably using a sliding window to calculate it so a sudden light change would get it's attention but then over time more subtle changes could be detected
  • Take into account the data from several of the sensors to determine a more precise direction. For example if there are two sensors that are measuring similar changes, point to a spot in between them
  • Add a cannon, catapult, or laser to bring the application to a "useful" point of application on my desk at work...

Or click here for a still image of it.

Arduino Light Meter

April 16, 2011, 9:44 pm - James Farrer

Today while playing with the Arduino my Mom got me for my birthday, I was able to set up a rudimentary light meter. I took the input from a photocell and converted that signal to a range that corresponds to 5 LED's.

I also set it up to learn what the ranges are from the photocell. So if you start it up it will show relative light levels. E.g. In a dark room it will show full light reading down to zero. But if you add light to the room it will adjust the upper bound and scale everything accordingly.

Also, this was my first upload to YouTube. Not exactly the highest quality, but it shows the lights working when I cover up the photocell.


What's New

There are currently no new items, please check back later.

Archives
2021 (2)
  September (1)
  May (1)
2019 (1)
  August (1)
2018 (3)
  August (1)
  April (1)
  January (1)
2017 (1)
  January (1)
2016 (4)
  December (1)
  November (1)
  May (1)
  January (1)
2015 (1)
  December (1)
2014 (2)
  August (1)
  February (1)
2013 (4)
  October (1)
  July (1)
  June (1)
  April (1)
2012 (11)
  December (2)
  October (3)
  September (1)
  May (1)
  April (1)
  February (2)
  January (1)
2011 (14)
  December (1)
  November (1)
  September (2)
  July (2)
  June (1)
  May (1)
  April (2)
  March (3)
  January (1)
2009 (2)
  October (1)
  June (1)
2008 (1)
  September (1)