Controller PDF

This is the controller I built.  The switches on top allow manual control of the array.  That large chip in the center is a PIC microcontroller, responsible for moving the array to the correct location and sequencing the hydraulics.




It's powered by a 12 VDC wallwart which is located up in the hydraulics box.  The large white wire is connected to the relays and the large gray wire is connected to the LED sensors.  The design is based on a schematic by Ross Wheeler, and modified a bit to fit the specific need.  The schematic is shown below (Click for a full size PDF). 





The sensor consists of two large green LEDs back to back and mounted with about a 90 degree angle between them.  Any LED will produce a tiny bit of power when exposed to sun, but green ones seem to produce the most.  In full sun they produce a little over 1 volt but a very tiny current of maybe a few micro amps.  The idea is that when the line that bisects the angle between them is pointing at the sun, the voltage across will be zero.


Sensor LEDs


Here's a shot of the sensor LEDs mounted on one the side of the array.  It doesn't really matter where you mount it, but we figured the side was the least likely place for birds to sit on it.  If the sun is to one side, the voltage will be negative.  Conversely if the sun is to the opposite side, the voltage will be positive.  This voltage is sampled in by the A/D converter in the PIC microcontroller.  To allow detection of the nevative voltage, the LEDs are biased up slightly.  The current produced by the LEDs is extremely tiny, and not enough to drive the A/D converter directly.  The LM358 op-amp is used to buffer the input to solve this issue.  One issue I had is that in the mornings, when the sun is significantly behind the tracker, the LEDs can pull the opamp's input below the negative rail.  This results in weird behavior (like the output swinging all the way to the positive rail) so a diode should be put between the LED bias to the LED input.  The voltage drop across the diode still allows some swing below the bias, but keeps the input from going negative.  The dual diode packages (D4 - D8) provide static protection for any external inputs. 


There are 4 pushbutton switches and a 16 x 2 LCD for a basic user interface with the controller.  These allow you to change delays, force an immediate track, and see what's going on.  I'm using PICbasic Pro as a compiler, and it has routines for the LCD already built in.  The 6-pin header fits into the PICkit 2 ICSP for easy reprogramming. 


To actually move the array, the controller has to sequence the hydraulics.  There are 3 relays up in the hydraulics box; two control the solenoids, and one controls the pump motor.  12 VDC is supplied to the relay coils at all times and are switched on by transistors T1 - T3 which sink the current to ground.  Diodes D1 - D3 protect the transistors from the inductive voltage spike seen after shutoff. 


Another "gotcha" was the extreme sensitivity to noise.  The sensors are probably 10 ft away from where the controller is located, and the wiring between them was picking up the ambient 60 Hz hum which really wreaks havoc on the acurracy.  This was nicely solved using shielded wire and tying the shield (at one end) to the circuit board ground plane. 


Board Layout


Here's the board layout I came up with (click for fullsize PDF).  I used some surface mount parts since they're cheaper and keep things a lot smaller.  The size could be reduced significantly more by using a surface mount PIC, but I like being able to easily pull them out and replace them should the need arise. 


The software is written in BASIC for the PICBasic Pro compiler.  It provides a basic user interface for changing some of the pertinent values and allows these to be stored in the chip's EEPROM so they'll persist through a hard reset.  I'll make the source code and binaries available in a .zip file at the bottom of the page.