We decided to try a project to see if we could get a solar panel to follow the sun so that it always has direct sunlight throughout the day. By having the solar panels in the most optimum position throughout the day their efficiency will be increased and that will allow you to store more energy.
We used the Basic Stamp 2 Module that is available from Parallax Inc and some common electronic components that are available from electronic parts distributers like Steren Electronics. It's assumed that you have some basic knowledge about the Basic Stamp and electronics - but if you don't you can still try out the project using the Parallax products because they have great reference manuals and lots of online resources to help you learn.
Project Requirements
- 1 - Basic Stamp 2 Development Board (We used the Homework Board but the Board of Education works too.)
- 1 - 9 volt Battery to power the BS2
- 4 - Photo-resistors
- 4 - 0.01 uF Capacitors
- 4 - 220 ohm Resistors
- 9 - Jumper Wires
Electronics
The project will be developed on the Basic Stamp 2 Development board and then later we will use a smaller BS2 module for a nice, clean, compact electronic device that can be placed almost anywhere.
The picture on the right shows what the development board should look like when it's finished with all the electronic parts mounted on the board.
I/O or Input/Output channels on the BS2 are prefixed with a P and then marked with their corresponding channel from 0 to 15. Our project needs four movements - Up, Down, Left and Right movements will give us 2-axis movement for our solar panels and use I/Os P0 through P4.
The four circuits are exactly the same except that they use a different I/O channel. One thing that we suggest to do is measure the output of each photo-resistor and try and pick four of them that have fairly close readings when exposed to the same amount of light. There can be large variations between different photo-resistors and to get accurate results you'll want four that have close to the same readings.
For each channel the program we wrote will send a timed pulse of electrical current through the photo-resistor to a capacitor which will charge up like a temporary battery. the program will then measure how long it takes to discharge the capacitor and register that measurement as a string to compare with the other measurements taken from the other channels.
The Program for the Basic Stamp 2 Module
We also wrote the program needed to poll the photo-resistors and decide what to do based on the feedback received from them. The program uses the same four I/O channels as we've shown in the schematic so be sure to build the electronics using the same I/O channels as the schematic states.
We haven't completed the motor control routines and electronics that actually move the motors yet but we'll be bringing that to you in the next part of this project. We'll also have limit switches to interrupt the electrical source if the panels are at the farthest extent of their allowable movement cycle.
A BS2 Program always starts with a definition of which language the program is using and the chip that is was written for.
' {$STAMP BS2}
' {$PBASIC 2.5}
We then define the variables that will be used throughout the program.
'Variables
pr0 VAR WORD
pr1 VAR WORD
pr2 VAR WORD
pr3 VAR WORD
move VAR NIB
X VAR WORD
This is the main routine and it defines what events will happen and what actions to take. The main routine will be run every minute. Right now the value of PAUSE is almost at the maximum allowable so if you want to go longer you will need to change the program to use the SLEEP command to get the desired length of time.
DO
GOSUB P_PRs 'Poll Resistors Subroutine
GOSUB C_Nums 'Compare Numbers Subroutine
'Go to Desired Movement Subroutine
IF move = 0 THEN GOSUB UP
IF move = 1 THEN GOSUB DN
IF move = 2 THEN GOSUB LE
IF move = 3 THEN GOSUB RI
SLEEP 300 '300 = 5 minute sleep
LOOP
These unwritten subroutines will be used for sending a movement signal to the motors that actually move the solar panel apparatus.
UP: 'Step Up
RETURN
DN: 'Step Down
RETURN
LE: 'Step Left
RETURN
RI: 'Step Right
RETURN
We have to compare the results of the polling of the photo-resistors so we know the most efficient movement we can make the solar panels move to align them with the sun. The first part of the routine checks to see if the reading on any of the sensors is greater than 1100 and if it is it means that it is too dark to move the solar panels. We came up with this value by watching the output of the sensor when they were covered with a finger to shield them from the light.
C_Nums: 'Compare the sensor polling results
IF pr0 > 2000 THEN SLEEP 1800 : GOSUB P_PRs '30 Minute Sleep if any reading is more than 2000
IF pr1 > 2000 THEN SLEEP 1800 : GOSUB P_PRs
IF pr2 > 2000 THEN SLEEP 1800 : GOSUB P_PRs
IF pr3 > 2000 THEN SLEEP 1800 : GOSUB P_PRs
X = pr0 'Set the initial value of X with first reading
move = 0 'Use for Movement subroutine
IF X < pr1 THEN X = X
IF X > pr1 THEN
X = pr1
move = 1
ENDIF
IF X < pr2 THEN X = X
IF X > pr2 THEN
X = pr2
move = 2
ENDIF
IF X < pr3 THEN X = X
IF X > pr3 THEN
X = pr3
move = 3
ENDIF
RETURN
This is the subroutine that polls the photo-resistors and puts the result of the poll into the string that is used to represent its' respective photo-resistor.
P_PRs: 'Poll Photo-resistors
HIGH 0
PAUSE 100
RCTIME 0, 1, pr0
DEBUG DEC5 pr0, " ", CR
HIGH 1
PAUSE 100
RCTIME 1, 1, pr1
DEBUG DEC5 pr1, " ", CR
HIGH 2
PAUSE 100
RCTIME 2, 1, pr2
DEBUG DEC5 pr2, " ", CR
HIGH 3
PAUSE 100
RCTIME 3, 1, pr3
DEBUG DEC5 pr3, " ", CR
RETURN
All this will keep you busy for a little while so we'll continue this project at a later date. Watch for updates as we'll be bringing you the motor control next!




Submitted by shy-but-green on July 17, 2011 - 11:37pm.
I love seeing this kind of ingenuity. It just goes to show what a little brainpower and some circuit boards can do.
Submitted by shy-but-green on July 15, 2011 - 11:55pm.
solar panel kits - Solar Panels provide free solar energy without the need to hire an electrician.
Submitted by shy-but-green on September 10, 2010 - 3:06pm.
I love seeing this kind of ingenuity. It just goes to show what a little brainpower and some circuit boards can do.
You can search for Used Electric Cars in your area on our web site. Electric Cars = Greener
Submitted by shy-but-green on July 25, 2010 - 9:27am.
I want to buy those things already assembled. How can I get in touch with the seller? If there is any?
Worede
706-776-6766
anbbesse@yahoo.com
Submitted by cactii on February 10, 2010 - 12:16pm.
I've read that it will improve efficiency up to 30% but I have no experiments of my own yet to verify those claims. Really 30% is quite a lot too. For example if you have 1000 watts in panels it would be like adding an extra 300 watts with the improved efficiency. I'd even settle for 10% more efficiency in my solar panels..
Submitted by shy-but-green on February 10, 2010 - 9:22am.
You should really keep working on the project it seems really interesting. How much would having a sun tracker improve the efficiency of your solar panels.
Credit Cards For Bad Credit
Post new comment