Single axis solar tracker

24 Feb 2014

Hello everyone, I am working on a project which is a single axis solar tracker. I have all the connections wired up to the mbed. The stepper motor will rotate the panel using two LDRs connected to the east and west ends of the panel. The difference in voltage of the LDRs will rotate the panel depending on which LDR gets more light, I connected the stepper motor, which is a unipolar one and I connected it in 6 wire connection, to the digital outputs of the mbed going to the L293D driver chip which is in turn connected to the motor. And the LDRs are connected as analogue inputs. Now comes the fun part, I have to start the programming which will help rotate the motor in pulses depending on the LDR inputs, and I have no idea where to begin, I would greatly appreciate any help regarding to the programming. I am kind of new to mbed and more familiar with PLC programming so this is all kind of hard and its hurting my progress and I am lagging behind. Thank you

24 Feb 2014

Begin in small steps. Don't try to make everything at once. First start with looking at printing data to your PC, so you can more easily debug your code. Then try for example reading the LDRs, check if they indeed depend nicely on the amount of light. Try using your stepper motor in just a fixed pattern, connecting them to everything else is a later step. Etc.

24 Feb 2014

Thanks for replying, I have been working with LDRs and getting familiar with it. About using the stepper motor, I am not sure about how to program the logic to move the motor in required steps, rotating it in reverse or forward. And how do I program it to take the input values of the LDRs and use those to pulse the motor to rotate in steps.

24 Feb 2014

Well the part of controlling the stepper motor with the LDR is the final part, don't worry about it now, worry about getting the subsystems working. The logic is something you first have to work out how you want it to behave, and then implement that. Regarding the stepper motor, without having looked at it further, a quick search gave me already: https://mbed.org/search/?type=&q=L293D+

24 Feb 2014

Thank you Erik, I will get started on the LDRs first, then the logic to control the motor. Really appreciate your help.

25 Feb 2014

I used to do simulations that required accurate locations of the sun and used equations that are well verified and accurate enough for solar tracking. I would calculate the position of the sun, based on your location, and then determine the elevation and azimuth angles and then use the steppers to point the array in that direction.

wade