Solar Tracker - First Project
Hi everyone, I've had my BS2 for 2 days now and was playing around today and made a solar-type tracker that finds the brightest light and stops.
I know it's not much but I'm happy it works at all considering this is my second day.· My formulas are rusty so if anyone knows a way to have it search for the brightest light without a predefined variable I'd appreciate the help.· I'm always open to suggestions and look forward to meeting everyone on the boards.· I've attached my code and a pic.
I know it's not much but I'm happy it works at all considering this is my second day.· My formulas are rusty so if anyone knows a way to have it search for the brightest light without a predefined variable I'd appreciate the help.· I'm always open to suggestions and look forward to meeting everyone on the boards.· I've attached my code and a pic.
Comments
" SANDBOX "you will see that this could become much more complex.
Friendships, Michel
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards from Belgium,
Michel Dechief.
Engineer and professor at Brussel's university (artificial intelligency)
Excellent first little project – do you have any further plans for it? Perhaps you could invert its operation and make it find the darkest spot for fun
On the programming side, you asked if there was a way to do this without using a pre-defined variable? I think it’s better off staying with the variables, this way you can easily adjust the sensitivity (based on your original program)
In your bunch of IF statements you check some stuff that you don’t need to. For example the first check is if quality < 10, then the second check is if quality >10 and <20. Well you don’t need to check if quality is < 20 here, you could just do this which has the same effect as you can see:
Another little point, in your program if the value is 10,20 or 30 then the program won’t know what to do and just use the last value of ‘adjust’ in the loop, as the < > operators check for a value greater than or less than but not equal to. You can use >= and <= (greater than or equal to / less than or equal to) to be inclusive of the value if you want to (like above), and by removing the redundant checks (like above) this will allow the program to set ‘adjust’ to the next appropriate value rather than not doing anything. You can also wrap these all into one big if statement, like this, which is more effecient:
And ultimately swap in the variable names instead of the values so you can simply change the initial variable values to affect the whole sensitivity, something like this
One other little thing, although space is not an issue at all here, most the variable types could quite easily be reduced to a byte instead of a word. A byte will hold a value up to 255 which is easily sufficient for your purpose, a word variable can hold up to 65535 which is way more than you are using except in ‘range’! In fact for the good / fair / poor you could just replace these with a CONstant value instead of having them as variables if you don’t intend the program to change them at all.
Nice work though, glad you are having fun! (and nice solar panel btw )
Ans as Michel says, do some reading and you will see this could become much more complex!
Pezi
you reflected on the fact that the sun moves on 2 axes(est towards west according to the hour but towards south or north according to the season). Friendships, Michel
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards from Belgium,
Michel Dechief.
Engineer and professor at Brussel's university (artificial intelligency)
Mount it on an axle that is parallell with the Earth's own axis. That will more or less keep it pointing at the sun with no complicated mechanics.
(If you don't consider summer/winter deviations, which can easily be adjusted by a small motor and a table of adjustment values, which again will demand a working calendar and... and... )
One way of increasing accuracy and therefore what is collected by the solar panel is to add another sensor, but at a few degrees angle from the first.
Then you can compare values to find the direction to rotate the panel.
(Will need a bit of 'inertia' built into the program or it might end up vibrating as the system constantly adjusts the position)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There is always an answer.
There is always a way.
There is always a reason.··· -SciTech02.
Easy to do when resistor are into a tube
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards from Belgium,
Michel Dechief.
Engineer and professor at Brussel's university (artificial intelligency)
small 1"x2" solar cells as the sensors. Basically, the idea with a
tube is that if you are not pointing directly at the sun, then at least
one of the sensors will have a shadow of the tube cast upon it.
If you have 2 sensors per axis mounted 180 deg apart from one
another adjacent to the axis of interest. A simple comparator circuit
can be used to determine the equality of the sensors, and then based
on the comparison, you move your solar collector accordingly.
Here is an example of what a 2 axis sensor would look like.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks, Parallax!
Then you can use the RCTIME comand with a sweeping motion on the servo to determine the brightest part of the sweep. Then adjust the center PWM of the servo to hold that position.
Notice that it took more effort to describe the making of the sensor housing than it did the coding involved, that's how easy it is to use! Enjoy discovering and experimenting with this powerful tool!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
·
Do you have any follow-up news on your project?
·
·
Just an FYI, you may find this interesting.· I was digging around and cleaning up·some disk space on an old computer,
and came across an old solar project that I was working on a few years back.· This design used a 3 foot x5 foot parabolic
trough to focus the sun onto a 3/4 inch·diameter·pipe (painted flat black in picture) which also serves as one of the
gimbaled axis.· This was used to pre-heat water·into a 20 gallon re-circulating hot water heater.
·
·
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
how well did it work?
Do you have a picture of the whole thing (didn't think I saw a water pipe there)....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
·
This actually worked pretty well.·· As a test along the way... I·closed one end (the bottom) and poured water (about 1 cup) into the top end of the pipe, after about 15-20 min the water
started to·boil, steaming out the top of the pipe.
·
Sorry, I don't have any more pictures.· The water pipe is the black vertical; better seen in the right image.· It is actually stationary to the reflector and also acts as a pivot axis for
the reflector.· When laying out the parabola, I used a 1/4 rule which works out so that what ever width you have, if you use 1/4 of that for your depth then your focal point will be the
center of your width at the top.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
OFf topic...but got me thinking!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
The hacker in me loves the use of the cordless screwdrivers for motors, clamped into the angle parts [noparse]:)[/noparse]
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Sorry to "hijack" this thread.... Not sure where Newbie went. ....But perhaps there is some motivation in there somewhere for a BS2 controlled version.
"The hacker in me loves the use of the cordless screwdrivers for motors, clamped into the angle parts"
Ummmm.... it's a poor-mans compression fit sleeve
I always keep an eye out for “clearance sales” on cordless screwdrivers for robotic type applications.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I have been thinking about building a simular device and focuse it on a stirling engine and spin a generator. Do you mind telling me where you got the parabolic material?
inches or so. I secured a thin (about 1/64th of an inch) flexible plastic to the ribs... over the thin plastic I used 2 inch wide adhesive foil tape used in air-conditioning
duct work. ....If I had to do again, I would select something much more reflective. I'm also a cheapskate so I would use something such as the inside liner of a chip
bag ... a little 77spray adhesive and a spoon to work out the bubbles and your in business.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
Beau,
You "came across" a 1300W Collector!?
What else do you have "hanging" around the house. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
I have a my BS2 kits and still learning.
I'm current a student and I have an idea for my school project similar like yours.· To start out with the project,
I would like to make it small where I'm able to gather enough energy and which allow me to use SOME KIND OF EQUIPMENT
that would boil the water.· If successful, I will use it as for a larger project like the water heater.
I would really appreciate if you could draw out the schematic and post a clear design so a rookie like me can learn.·
Program codes would be very helpful too.
Thanks
Robert
NDBGA