Single-Axis PIC Controlled Solar Tracker DIY Kit

Introduction: Single-Axis PIC Controlled Solar Tracker DIY Kit

About: Hi there! My name is Patrick, and I am an electronics engineering technician who works full time as a lab tech, and part time as an electronics engineer/salesman. I own an ebay store, and two websites, which …
Hi All
I'm not going into as much depth with this instructable due to my current time constraints.  That said, I fully plan on updating this instructable as time progresses with new algorithms and programs for optimization.  

I was messing around with some new stepper motors one day, and I decided to make a light tracker unit.  It is very simple and works on only one axis.  It is a neat science project.  Below is a video that offers a small demonstration.  The following pages will have videos on how to put it together.  There is a lot of discussion about how this kit works in the videos, so if you are really interested, then pay careful attention to what I say in the videos.  Below is video#1.

NOTE:  While I do sell this as a kit, you can use the ideas and algorithms talked about in this instructable/video to improve upon this basic design.  It was designed as a fun little science project.  I will be adding software and improvements as time progresses  so please be patient with me =)

Step 1: Electrical Discussion & Assembly

Electrical Discussion:
This kit is comprised of a main board that houses a microcontroller (PIC18F1220), a select button,a 5v regulating power supply, a stepper motor driver output connection, and a feedback input connection.  The stepper motor output connection has four signal lines that are driven by the PIC, a regulated 5v line, and a DC ground line.  The feedback input connection acts to both power the sensor board, and to provide three analog signal lines, and a single digital signal line back to the PIC. 

The sensor board has three LDR (Light dependent resistors).  Each LDR is in series with a 10k resistor.  Each series set acts as a voltage divider.  Depending on how much light is hitting the LDR, the PIC will receive a more or less voltage.  The feedback from the three sensor is fed into three ADC (Analog to Digital) lines of the PIC.  The PIC samples each of these sensor feedback lines several times a second, and runs a subroutine to determine which sensor has the most light, and which has the lease.  If the left sensor is seeing the most light, the motor will take one step left.  If the right most sensor is seeing the most light, the motor will take one step right.  If the middle sensor is seeing the most voltage, the motor stays in the last position and does not move.  

There is also a whisker and a stopper.  The whisker is a wire on both sides of the sensor board.  the stepper is a wire that is connected to ground, and fastened to the motor.  When the motor runs too far left, and the whisker hits the stopper, it sends a digital signal back to the PIC saying that it has gone too far, and it will instruct the motor to step backwards and try again.  
If this is too ambiguous, see the video.  The whisker connects back to the main board via the input feedback connector.  This line is connected to a 10k pull-up resistor.  When this whisker hits the stopper (ground), if pulls the whisker voltage from 5v to 0v, and the PIC is always looking for that.

The sensor board schematic may look broken to you. This is because I've designed a PCB that allows for the user to manipulate it physically.  Typically, all of the 10k resistors would be connected to the 5v line.  The secondary sides of the LDRs should all be connected to ground.  The area between each  resistor and  LDR (Voltage Divider Analog Voltage Signal) is sent back to the main board. 

Here Is The Assembly Video:

Step 2: Mechanical Integration

Putting it all together....  This is the fun part!  You really have a lot of leeway here for your own ingenuity.  I used hot glue to put it all together.  You can see this in the below video.  A More mechanically inclined individual would be able to greatly improve upon this.   
There is a lot to say, but it is all mentioned in the video.  

Step 3: The Algorithm

When you first power this device on, it first waits for you to press the select button.  This is your start/stop button.  You can press it any time to disengage the circuit.  When you press the select button after power up, the first thing the device does is samples the feedback signals from the light sensor board and the digital signal from the whisker. Below is the very basic algorithm.

Sample ADC1
Store Digital Data
Sample ADC2
Store Digital Data
Sample ADC3
Store Digital Data
Check Whisker
If 0v, Reverse Stepper Direction
If 5v, Ignore

Decode Feedback Data: (MS= Middle Semsor/LS = Left Sensor/RS = Right Sensor)
Compare Left sensor Voltage To Middle Sensor Voltage (More Votlage = Less Light)
If LS Voltage is Lower Than MS Voltage, Compare LS Voltage With RS Voltage.  If not, go to (2)
If LS Voltage is Lower than RS Voltage, Instruct  Motor To Step Left
Check Select Button.  If Pressed, Stop Operation.

(2) Compare MS voltage with RS Voltage
If RS Voltage Is Lower Than MS, Instruct Motor To Step Right.  If Not, go to (3)
Check Select Button.  If Pressed, Stop Operation.

(3) No Motor Movement.
Check Select Button.  If Pressed, Stop Operation.

Obviously there is more than just what I've explained above, but I am neglecting the rest because I am in the midst of making changes to the algorithm.  When I've made the improvements, I'll make the changes in this instructable.  This is also the reason why I am not putting the software into this instructable as of yet.  

However, as I mentioned in the beginning, I will be making updates to this instructable as time progresses.

Step 4: Interested in Buying a Kit?

Thanks for having a look at this instructable.  I'm a huge enthusiast of electronics, and I sell kits and parts on the side.  If you'are at all interested, please feel free to have a look at my website, my ebay store, and the ebay listing for this kit.  Thanks for having a gander, everyone =)  I'll be making more updates to this instructable soon!


Visit Us At:

Find Our Ebay Store Here:

Solar Tracker Kit Ebay Listing:

Instructables Design Competition

Participated in the
Instructables Design Competition

Be the First to Share


    • Big and Small Contest

      Big and Small Contest
    • Make It Bridge

      Make It Bridge
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge



    Reply 10 years ago on Introduction

    Yes, but the only problem is that the motor head is very tiny, and you'd have to be pretty mechanically inclined to make a platform for the sensor board and the solar panel. The stepper motor is strong enough, but the gear head is very small, which is problematic.


    How efficient is the stepper motor? (When I think of a solar tracker, I usually think of using it to help a solar panel gather more direct sunlight. I wouldn't want to waste all of the power gained by tracking on the tracker.)


    Reply 10 years ago on Introduction

    Actually, when in operation, the stepper takes less power than a standard servo, which is surprising. Also, when the most light is hitting the middle sensor, no power is being applied to the motor. I'm implementing a subroutine that turns off the device when all three sensors detect low light, so that it isn't trying to move around when little power could be saved.