PIC Microcontroller Based Solar Tracker Using Fuzzy Logic

Download (PDF, 193KB)


This is a Solar Tracker Based on Fuzzy Logic. Its function to rotate the sensor in front of light to receive the maximum amount of light. This is very useful at places where solar energy is used to produce electricity.

Fuzzy Logic

Let me expalin Fuzzy logic in an easier way. For example how is a warm sunny day determined to be not warm but hot instead, and by whom?. The threshold of when someone considers a warm day hot depends on the person’s personal heat threshold and influence of his environment see fig.1. There is no universal thermometer that state that 81.5 degree Fahrenheit is warm and 82 degree Fahrenheit is hot. Further a person living in Chennai has a different set of temperature values for hot days from a person living in Simla and both these values will be different from those who are living in Bangalore. a hot day has different temperature scale in winter from that in summer. The same things applies to other things such as navigation, speed, height. eg if we graph the height of 5000 peoples our graph looks like of fig.2. We can use this graph of height to classify shortness, average height and tallness. If we apply a hard rule that everyone under 5’4″ is short and everyone taller that 6′ is tall then our graph resemble fig.3. In this condition what happens if someone have a height of 5’11” ie the perason’s height is closer to the tall group.so instead of hard rules peoples use soft logic or fuzzy logic. Fuzzy logic uses groups and qualifies the membership in each group. So a person who is 5’11” tall is almost out of medium group and well into the tall group see fig. 5. Fuzzy Logic provides alternative to the digitized graph, a high resolution digitized graph is also accurate in classifying height fig. 4. To implement Fuzzy logic in PIC microcontroller we assign a numeric range to a group.
The sensor used for the tracker is cadmium sulphide photocell. Cadmium Sulphide Photocell is a light sensitive resistor. Its resistance varies in proportion to intensity of the light falling on its surface. The project uses two CdS cells. The photocell are mounted over a small piece of wood for each CdS two small holes are drilled for the wire lead to pass through. Longer wires are soldered to these wires and connected to PIC microcontroller.

Motor Driver

An H-bridge is an electronic circuit which enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards. The term “H-bridge” is derived from the typical graphical representation of such a circuit refer fig. 6. An H-bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4 (according to the below right figure) are closed (and S2 and S3 are open) a positive voltage will be applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the motor. Using the nomenclature above, the switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. The same applies to the switches S3 and S4. This condition is known as shoot-through. This H-bridge uses MOSFETs for one main reason – to improve the efficiency of the bridge. When BJT transistors (normal transistors) were used, they had a saturation voltage of approximately 1V across the collector emitter junction when turned on. A power supply of 10V consumes 2V across the two transistor required to control the direction of the motor. 20% of power was eaten up by the transistors. The transistors also would get quite hot. MOSFETs are used here because when they turn on they have an ON resistance called RDS(on). This is the resistance between the Drain and Source when turned on. It is quite easy to buy MOSFETs that have very low RDS(on) ratings of less than 0.1 ohm. Now, when a MOSFET has a low RDS(on) rating, it usually has quite a high current rating typically in the 10s of amps. Low RDS(on) P channel MOSFETs are more difficult to find than N channel. I had to resign myself to a higher rated P channel MOSFET. There are quite a few MOSFET manufacturers: MOTOROLA, International Rectifier, National Semiconductor to name a few. MOSFETs work by applying a voltage to the Gate. They call this transconductance. When a positive voltage greater than the Gate threshold voltage is applied, the MOSFET turns on. Circuit Diagram of Fuzzy Logic Based Solar Tracker is shown in fig. 7. Component Layout of Fuzzy Logic Based Solar Tracker is shown in fig. 8. PCB Layout of Fuzzy Logic Based Solar Tracker is shown in fig. 9.

Subscribe Newsletter