Single-Axis PIC Controlled Solar Tracker DIY Kit using PIC18F1220

Summary of Single-Axis PIC Controlled Solar Tracker DIY Kit using PIC18F1220


This instructable describes a DIY single-axis solar tracker kit using a PIC18F1220 microcontroller, three LDR sensors, and a stepper motor. The PIC reads analog voltages from voltage-divider LDRs to decide motor steps left or right; a whisker and stopper provide a digital limit-switch input. The kit includes a main board with regulator, select button, stepper outputs, and sensor feedback connector, plus a sensor PCB and supporting wiring. Software algorithms sample sensors and move the motor to follow the brightest sensor.

Parts used in the Single-Axis PIC Controlled Solar Tracker DIY Kit:

  • PIC18F1220 microcontroller
  • Main PCB (microcontroller board with regulator and connectors)
  • 5V voltage regulator
  • Select button
  • Stepper motor
  • Stepper motor driver/output connector (4 signal lines, 5V, ground)
  • Sensor PCB
  • Three LDRs (light dependent resistors)
  • Three 10k resistors (for LDR voltage dividers)
  • Whisker wire limit switches (wired to ground)
  • 10k pull-up resistor for whisker input
  • Wiring and connectors between main board and sensor board

Single-Axis PIC Controlled Solar Tracker DIY Kit

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.

Intro:
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 =)

Solar Tracker

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.

Schematic Solar Tracker

Schematic Solar Tracker2
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.

 

For more detail: Single-Axis PIC Controlled Solar Tracker DIY Kit using PIC18F1220

Quick Solutions to Questions related to Single-Axis PIC Controlled Solar Tracker DIY Kit:

  • What microcontroller does the kit use?
    The kit uses a PIC18F1220 microcontroller.
  • How does the tracker determine which direction to move?
    The PIC samples three LDR voltage divider signals and steps the motor left if the left sensor reads highest, right if the right sensor reads highest, and stays if the middle is highest.
  • What sensors are used to detect light?
    Three light dependent resistors (LDRs) are used, each in series with a 10k resistor as a voltage divider.
  • How is the sensor board powered and connected?
    The sensor board is powered via the feedback input connector which also provides three analog signal lines and one digital whisker line back to the PIC.
  • What is the purpose of the whisker and stopper?
    The whisker acts as a limit switch that, when grounded by the stopper, signals the PIC that the motor has gone too far so it can step backwards.
  • How does the whisker input signal the PIC?
    The whisker line is tied to a 10k pull-up; when the whisker touches the grounded stopper it pulls the line from 5V to 0V which the PIC detects.
  • What outputs are provided for the stepper motor?
    The stepper output connector provides four PIC-driven signal lines, a regulated 5V line, and a DC ground line.
  • Does the PIC use analog inputs for sensor readings?
    Yes, the three LDR voltage divider outputs are fed into three ADC inputs on the PIC.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter