Photoresistor
TinCansAssoc
Posts: 9
How do I get a photoresistor to work with my propeller? I'm trying to make a program for pointing an object at the sun using light sensors and servos. What is a good approach to do this?
Comments
Using the Prop pin as an input, you'll get an ON/OFF state by monitoring the status of this PIN...
If you want to measure the actual light level, you might try using my ADC object at www.rayslogic.com
Photoresistors are ok I guess, do you know that an ordinary green LED makes a great daylight sensor? (and they're cheap)
Why don't you tell use more about your project, we all answer questions and share information about what we are doing because it's of interest to us and both educates and stimulates.
*Peter*
Graham
*Peter*
Heat seek and you will find.
*Peter*
Sorry, its OT but it was too good to miss.
There was someone else who asked a question about using LDRs. I think it may have been in the sandbox.
How long do you have to find the sun? Are you going to use servos to search for it or do you want a monolithic 360 degree photoresistor solution?
How much resolution do you need in your final answer?
There is a big difference in the approach you would take if this were a solar powered submarine... vs. a smart bullet for shooting down micro-uavs, which also happen to have very bright head lights[noparse]:)[/noparse].
There is a nice RC circuit in one of the education labs(PE-Kit-Counters-Lab)... For solar powered submarine type applications, this should work just fine.
Since you are dealing with a fairly bright source, the RC circuit should be nice and snappy. You might want to try pin-hole optics to get yourself a nice field of view (http://www.ruf.rice.edu/~dodds/Files231/pinhole.pdf). The sun is about a half a degree.
Of course, if you know roughly where your machine is pointing to begin with, the problem gets a lot easier... a 3D accelerometer(used as an inclinometer) and a compass would give you a really good starting point and let you zero in on the sun a lot faster.
I think Steve's idea about (temporal?) filtering is a good one, you know the sun doesn't move at high speed so neither should the servo. You could also add a certainty value to your measurements, with my suggested method you would be more certain of your direction when you have four equal signals from bright sources than from relatively weak ones.
Another method would be to glue a ball bearing to a sheet of glass and place an array of photoresistors or photodiodes some distance behind it, you could create a sort of digital sundial, try to move it with the servos to keep the shadow in the middle of the array. This would also make finding the sun in the first place childs play but cloud will reduce the shadow considerably.
Yet another method would be a 2D position sensitive detector and a pin hole, try to put the light that comes through said hole in the middle of the array. PSDs are easy to interface with and fairly cheap. In this case cloud will make the spot bigger.
Graham
Other than my guns (kisses biceps)
Graham
Legal note: "No ant hills where harmed in the construction of my theory!"
My theory on your design - you could take the LDR mount(spelled hot glue)·it at the bottom of a tube (~1/4-3/8"W X 1-2"L) and take that assembly and "mount" it to a servo arm. Now, i'm not sure just how big your object that needs to get pointed at the sun is, but if it's on the order of a few lbs, you'll probably want to look into one or two giant scale servos for it's control.
The servo with the LDR mounted to it can be used like radar -but for light intensity. Producing a sweeping motion and sampling the LDR at the same time will give you a means of comparison which can be done with as little as two variables. Using the two variable compare method (bright_last_position, bright_current_position), will be·faster and less complex·than lookdown tables + math. It also has the advantage of a variable sky(clear, pt. cloudy..) not affecting your code possibly causing a bug. Then one the position of the sun has been determined and if the servos were all mounted on the same plane, ie- oriented in the same direction relative to one another, then posistioning your object will be as simple as passing your brightest position on your "light-dar" servo to the other servos. And if you wanted to get real fancy you could mount the light-dar servo to another servo's arm giving the ability to scan horizontally also. but for 100% acuracy, you'd need to take thoe two light-dar servos and·mount them to a third axis servo, giving·you the ability to track the arc also. It may not be cheaper than a whole array of·LDR's at different angles, but·i bet even a 3-axis servo setup would be easier to code·than a hemisphere's worth of LDR's.·Just thinking out loud, hope this helps a bit though.
@Grahm - I got your heatseek and can't find missle covered! lol I have a base-ment full of planes, 25% Extra 300, 45% Pitts Special, a few ducted fan jets, and a few (10) 3D Heli's too. All in all about 30 craft to aim @.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Well in more details I was thinking about making a solar generator using a parabolic reflector and a sterling engine, but before I get too far into the mechanical aspect I wanted to learn more about the propeller aspect. In reality it would be cheaper to use geared motors and a rotating framework, but I'm open to ideas on how to control the angles. Since I don't need a lot of accuracy, I was thinking about using 4 photoresistors in a circular array with something that projects in Z-axis to create a shadow. Then I have left/right, and up/down, but I agree it won't work too great in clouds, but maybe it wouldn't matter anyway, I could just have it position where it thinks it should be according to time of day/year. I like the idea of a sensor array and a ball-bearing glued to a cover
however, I'm new at the propeller and i just want to figure out how to get the code to work with my hardware first. [noparse]:)[/noparse]
If you are going to be using a parabolic reflector it is actually going to have to be fairly accurate. Is it going to be a trough or a dish? How most people do it these days is to simply program the controller with where the sun should be. This avoids all the problems with cloudy days and reflections.
Geared motors (maybe a stepper motor) and a rotating frame are probably the way to go as you could get more accuracy than with a servo. You would also need some way detecting either where the reflector is or when it has reached its stops.
For the OT part of this thread...
Now forget the rockets and missiles, all we need is a few mirrors to reflect the sun onto the enemy and we can burn them up
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Searider
(update) I got my sensor to work, so now I just have to finish my code.
Post Edited (TinCansAssoc) : 3/16/2008 5:24:54 AM GMT
Design and construction of a system for sun-tracking
You can buy the article but if you PM me with your email I might be able to help you out [noparse];)[/noparse]
Anyone have plans for candle powered sterling engines?
Graham