logo elektroda
logo elektroda
X
logo elektroda

Another Solar Tracker - controller and description of the structure

SylwekK  25 7221 Cool? (+19)
📢 Listen (AI):

TL;DR

  • Builds an ATmega168-based single-axis solar tracker controller for an east-west panorama drive on a garage-roof panel structure with 24V relay control.
  • Uses two phototransistors in a divided dome-camera housing, plus time delays, flash filtering, and optocoupler-isolated limit switches to avoid false moves and electrical faults.
  • Stores the tracking brightness threshold in EEPROM, enforces a fixed 10-minute tracking interval, and requires a clear light state for 2 seconds before moving.
  • Provides manual jogging, maintenance shortening modes, nine LED status codes, south parking, and automatic shutdown if the rack misses a limit switch.
  • The tracker now follows the sun reliably and parks south at sleep time, while an anti-wind input remains prepared but inactive without a sensor.
Generated by the language model.
Printed circuit board with electronic components and a wire ending with an LED.

Today I am presenting another controller of my creation for the solar tracker (the first one from 2011 is described here: Photovoltaic panel turntable controller ). This time, a rudder designed for a friend who made the mechanics himself based on an old trampoline, or more precisely, its rim with a welded-in gear. Everything is placed on a relatively flat garage roof, mounted on pins with stiffening reinforcements. They are not in the attached photos yet (actually there is one, the rest are being made). The structure with panels rolls on rollers, and there are similar rollers on the bottom to prevent the wind from blowing away the "sail". The rotation could be 360 degrees, but for obvious reasons it is limited to about 260-270. If by some miracle the limit switches do not work, the rack will simply run out and the movement will stop, and the engine will turn off automatically after a short time (time protection in the program will activate). The controller is single-axis (panorama only) - these were the assumptions.
It would seem that tracking the sun could be done using one or two comparators and the matter would be solved - nothing could be further from the truth. As my experience has shown, a good algorithm means failure-free and fruitful operation of the whole. There are two schools of following the sun: 1-tracking, 2-clocking. I support option 1 and no one has yet had strong enough arguments to convince me to choose option 2.
So what does my driver have in it? It is based on Atmega168 (smd), and the program takes about 8kb written in C (predecessor in BASCOM. First of all, all movement options, buttons, etc. are protected by a time delay, e.g. there is no sudden change of direction without waiting first at least 1-2 seconds (longer in some situations).
The controller manages two 24V relays, switching on and changing the direction of a three-phase motor (a friend had one and it suited his project). If there was a sudden turnaround without time delay, it is easy to imagine that even a strong fuse would blow.
The light sensor consists of two phototransistors placed with a partition in the dome camera housing (hermetically improved). This casing worked well in the first project, so why drill down.
There is no additional photoresistor, which is sometimes found in other controllers of this type, to determine the parking level, and I am surprised by such solutions, because it is completely pointless, having two photoelements on board, which are perfectly capable of assessing the light level. The use of phototransistors instead of photoresistors as directional sensors is also important, because it is impossible to wake up the system by shining a typical, popular LED flashlight on the sensor, even if someone wanted to do it out of curiosity or malice.
At the startup and installation stage, I updated the software a few times, correcting minor errors or adding simplifications, but this is a normal process in a living organism, because the fact that everything works beautifully on the desk is only a theory, and practice usually quickly verifies it.
Currently, the positioner copes well with the sun, gets up and goes to sleep when the time comes, and the sleeping position in this (as well as in my first tracker) is the southern position. This is an almost ideal position for our region, because 90% of the wind blows from the west, sometimes slightly from the southwest, and it is also an excellent anti-wind position (the panels facing the wind offer little resistance).. Plus, it's the best place to start tracking. No, not the eastern one, I don't agree with that and no one will convince me that the eastern part is better.

Main features of the controller:
- tracking in both directions east - west,
- on-demand programming of the tracking threshold (brightness level at which work starts and ends) stored in the eeprom memory,
- tracking interval of at least 10 minutes (fixed), sometimes depending on the sunlight or lack thereof, after the countdown there is a waiting time for stronger light,
- protection against momentary flashes (the sensor must be in a clear lighting state for at least 2 seconds),
- manual positioning with tracker buttons in both directions (e.g. for maintenance purposes),
- time protection against failure to reach the target (tracking, parking) and related personalized alarms to quickly determine the cause of the fault,
- manual shortening of time delays (tracking interval, parking on demand, wake-up) for maintenance and testing purposes using a button,
- each controller state is signaled by an individual, very intuitive and clear LED blinking time combination (9 states),
- the parking position is determined by an additional switch (in this case the southern one),
- all limit switches are connected to the processor via optocouplers for safety reasons (e.g. induction of voltages in the cables).

The rudder also has an anti-wind input prepared and it is partially programmed (the executive part, i.e. parking on the southern end switch regardless of which side of the end switch it is located on), but my friend does not have any sensor at the moment and does not know the parameters to which the program should respond, so for now the input is unused and inactive.

I do not share the program. Let the above description be an inspiration for someone who would like to make such a rudder but does not know what functions to equip it with.

Electrical schematic of a solar tracker controller with ATmega168 microcontroller.

And finally, a few photos.

Photovoltaic panels mounted on a garage roof with a rotating mechanism. Controller block mounted on a metal structure of a solar tracker with visible cables. Panel tracker control system with gear and sensors. Solar panel mounting structure on a roof.
Solar tracker controller inside a housing with visible wires and components. View of the interior of the solar tracker controller housing. Geared motor with mountings on a metal structure.
The image shows an electronic controller module with a multi-pin connector and colored wires attached. Solar sensor with two phototransistors in a dome-shaped enclosure.

The video shows a part of the ride during calibration right after turning it on.




About Author
SylwekK
SylwekK wrote 2764 posts with rating 2762 , helped 82 times. Live in city Lipsko. Been with us since 2007 year.

Comments

Shadowix 27 Oct 2023 20:53

Cool driver. What is the total cost of RBH? Why not something industrial? Even this Logo! to be enough, you can add a preview online, etc., etc. I don't like the use of the yellow-green cable to control... [Read more]

Sofeicz 27 Oct 2023 23:06

And how does tracking perform in full cloud cover, when it is difficult to obtain a differential signal from phototransistors? [Read more]

SylwekK 28 Oct 2023 11:23

The electronic side - costs about PLN 100, but the execution (diagram, board, soldering) requires a day's work. The program took a total of 1-2 days (including tests). The rest (mechanics, box, contactors,... [Read more]

Sofeicz 28 Oct 2023 12:33

What is the estimated energy cost of such control? How much energy does the operation of the controller and actuators consume? Did you count it? [Read more]

SylwekK 28 Oct 2023 12:45

@Sofeicz, I didn't count. I'm taking a common sense approach here :) Taking into account the 10-minute interval with several seconds of movement and the correct setting of the tracking threshold,... [Read more]

krzbor 28 Oct 2023 19:44

Maybe I'll try :) In option 1, the main problem is the possibility of contamination of the optics. If a bird leaves its white substance on the western or eastern part, the system will immediately... [Read more]

SylwekK 28 Oct 2023 20:33

Well, sorry, but the complexity of the system you describe begs for systematic failures :) Still not convinced. In fact, most opponents of tracking write about sensor contamination. Pay attention to its... [Read more]

krzbor 28 Oct 2023 21:11

I don't see any room for systematic failures. Reed switches are a very good solution - they are effective and practically failure-free. Basically, you can reduce their number by 2, i.e. make synchronization... [Read more]

Sofeicz 28 Oct 2023 22:17

How did you solve the problem of defining hysteresis? I once saw a similar controller that had the disadvantage that when reaching the target point, it fell into oscillations caused by too narrow hys... [Read more]

krzbor 28 Oct 2023 22:21

You can also do it differently - add only the limit switches (actually, you should only add one "morning"), and determine the position using the light barrier installed on the lower gear. Then we simply... [Read more]

slaw0 29 Oct 2023 10:10

For tooth counting, an inductive sensor reacting to metal or an encoder on the motor will be better. [Read more]

Anonymous 29 Oct 2023 10:16

How many kilowatts does it take to turn the tracker? Does it really matter? But to the point: no one can convince you to choose 'option number 2', i.e. clock-based positioning. And for me to... [Read more]

gimak 29 Oct 2023 18:14

If I were to play with these blocks on a larger scale, because I play on a micro scale, that's why I observe topics like this and I had the right conditions, I would rather choose trackers, and rather... [Read more]

SylwekK 29 Oct 2023 18:14

There is no problem with hysteresis, because it takes a stable 2 seconds to change the sensor state, and after making a movement, the lock is immediately activated for 10 minutes. My first solution... [Read more]

Anonymous 30 Oct 2023 08:31

Are you sure? Please correct me if I'm wrong, but aren't tracker installations most often made in such a way that the panels are placed 'lying down' during windy conditions? If so, it is... [Read more]

SylwekK 30 Oct 2023 09:00

It depends on who writes the software :) Most of the trackers I've read about do just that, i.e. place the panels, while I position them quite sharply vertically and sideways to the wind. This solution... [Read more]

sq3evp 30 Oct 2023 10:25

Nicely made, I've seen a similar diagram - 4 phototransistors that can be placed in two planes. [Read more]

SylwekK 30 Oct 2023 13:26

Thanks :) Initially, I was going to make a universal version with two axles, but my friend doesn't even plan on changing the design, so I only made him a left-right one. [Read more]

sq3evp 30 Oct 2023 14:50

It is much more difficult to follow the sun in two planes - especially mechanically. Once at school we had a purely conceptual project to think about how to do it using op. amps as follow-up regulators. ... [Read more]

FAQ

TL;DR: A DIY single-axis solar tracker with a 10-minute tracking interval and 24 V relay control shows why “the profit from tracking is at least 40%.” This FAQ helps DIY solar builders choose between sensor and clock tracking, set thresholds, and add motor, relay, and wind safety features. [#20789034]

Why it matters: A good tracker algorithm decides whether a rooftop PV tracker is productive, stable, and safe in real weather.

Option Sensing method Strength Main drawback
Optical tracking 2 phototransistors with divider Follows real sunlight and stops when light is too weak Needs clean optics and a solid algorithm
Clock-based tracking Time, switches, RTC/NTP Predictable position without light sensor Can move even when no useful sun exists
PLC Logo! approach Industrial controller Expandable, possible online preview Higher cost and harder to fit custom logic

Key insight: The thread shows that the controller matters more than the sensor alone. The winning design combines optical tracking with timed lockouts, threshold programming, parking logic, and fault alarms, not just simple comparator-based sun following.

Quick Facts

  • Electronics for the controller cost about PLN 100, while schematic, PCB, and soldering took about 1 day and firmware plus tests took 1–2 days. [#20788924]
  • The controller uses an ATmega168, drives two 24 V relays, and switches the direction of a three-phase motor with enforced delays between changes. [#20788086]
  • Tracking is single-axis only, with practical rotation limited to about 260–270°, even though the mechanics could rotate 360°. [#20788086]
  • Normal tracking uses a fixed interval of at least 10 minutes, requires a stable light condition for 2 seconds, and parks after about 1 hour of weak gray light. [#20788924]
  • The author reports an estimated energy-yield increase of at least 40% on sunny days, while controller self-consumption is only in the milliamp range. [#20789034]

How does this single-axis solar tracker behave during full cloud cover when the phototransistors do not see a clear light difference?

It waits instead of chasing weak, diffuse light. After the normal 10-minute interval, the controller checks whether brightness exceeds the programmed threshold; if not, it delays movement until stronger sun returns. If gray light persists, it parks after about 1 hour, then wakes again when sunlight rises above the stored threshold. [#20788924]

What is the estimated power consumption of the controller itself and the motorized tracker during normal operation?

The controller uses very little power, and the motor energy is treated as negligible in normal use. The author did not calculate watt-hours, but he states the controller draws only milliamps and the drive moves for only a few seconds every 10 minutes. That duty cycle keeps operating cost low compared with the claimed gain in PV output. [#20789034]

Why did the author choose sensor-based sun tracking instead of clock-based positioning for this solar tracker?

He chose sensor tracking because it follows real irradiance, not an assumed sun position. The author rejects moving the tracker during long cloud periods, arguing that clock control can waste energy for days when no useful sun reaches the panels. He also reports more than a decade of field experience with an earlier optical tracker without the contamination failures others predicted. [#20789654]

ATmega168 vs PLC Logo! — which is better for building a custom solar tracker controller with delays, alarms, and manual controls?

ATmega168 fits this design better because it packs custom logic into a small, cheap board. The author says a PLC Logo! would need at least 8 inputs and 3 outputs, would not necessarily cost less, and would be harder to shape into his delay-heavy logic, alarms, and 9 LED states. For a custom DIY tracker, direct C code gave him tighter control. [#20788924]

How do you set the brightness threshold for wake-up and parking in a solar tracker, and why store it in EEPROM?

You program the brightness threshold on demand and store it in EEPROM so the tracker keeps the value after power loss. In this design, that threshold decides when work starts, when tracking pauses, and when parking begins under weak light. EEPROM matters because installers can tune sensitivity once and keep it stable across resets and maintenance. [#20788086]

What is hysteresis in a solar tracker controller, and how do you prevent oscillation around the target position?

Hysteresis is control deadband that prevents repeated back-and-forth switching near the target. Here, the controller avoids oscillation by requiring a stable sensor state for 2 seconds before acting and then locking out further movement for 10 minutes after each correction. That combination is much stronger than a narrow analog threshold alone. [#20791022]

How can two phototransistors with a divider in a dome housing be used as a directional sun sensor?

Two phototransistors separated by a divider create a directional imbalance when sunlight strikes one side more strongly. "Phototransistor" is a light-sensitive semiconductor that converts illumination into current, offers fast response, and can act as a directional sensor when paired with a physical shade. The dome camera housing protects both elements, while the divider turns angle error into a left-right light difference the controller can compare. [#20788086]

What is an optocoupler, and why use optocouplers on solar tracker limit switch inputs?

An optocoupler isolates the processor from external wiring and noise. "Optocoupler" is an isolation component that transfers a signal with light inside the package, keeping the control circuit electrically separated from long cables and induced voltages. In this tracker, all limit switches connect through optocouplers to protect the microcontroller from interference and wiring transients. [#20788086]

How do time delays between relay direction changes protect a three-phase motor and contactors in a solar tracker?

They stop instant reversals that can trip protection or damage switching hardware. The controller always turns both relays off first, then waits at least 1–2 seconds, and in some cases 2–3 seconds, before energizing the opposite direction. The author explicitly says skipping that delay could easily blow a strong fuse when reversing the three-phase motor. [#20819010]

What safety measures should be added to a rooftop solar tracker structure to prevent derailment, wind damage, or the panels rolling off the supports?

Add structural bracing, lower anti-lift rollers, and a secondary retention link. In the thread, users recommend faster reinforcement of the roof pins and even a steel safety cable to the lower structure. The build already uses upper rollers for motion and lower rollers to stop the wind from lifting the “sail,” but mechanical stiffening remained an important open issue. [#20788486]

How much does it cost to build a DIY solar tracker controller based on ATmega168, including electronics, PCB, and programming time?

The electronics cost is about PLN 100, plus roughly 2–3 days of work. The author estimates one day for the schematic, PCB, and soldering, then another 1–2 days for firmware and tests. That figure excludes mechanics, enclosure, contactors, and the rest of the structure, which were built separately. [#20788924]

Why use phototransistors instead of photoresistors in a solar tracker light sensor, especially for resistance to false triggering from flashlights?

Phototransistors make false wake-up from a common LED flashlight much harder. The author states that a typical popular flashlight cannot wake this system, even if someone tries deliberately. He treats that as a practical advantage over photoresistor-based approaches and also rejects the extra parking photoresistor as unnecessary when two main light sensors already measure brightness. [#20788086]

What is the best parking position for a solar tracker in windy regions, and why might a southern anti-wind position be better than an eastern one?

A southern parking position can be best when local winds come mostly from the west or southwest. The author says his tracker sleeps in the south because about 90% of the wind in his region blows from the west, making that orientation both a good start point and an anti-wind stance with low resistance. He explicitly rejects eastern parking for this site. [#20788086]

How could a clock-based tracker be built using reed switches, an RTC or NTP, and ESP8266, and what are the pros and cons compared with optical tracking?

A clock tracker can use perimeter reed switches, an RTC or NTP timebase, and an ESP8266 for timing and fault reporting. One proposal used switch points at 6, 9, 12, 15, and 18 hours, with synchronization every 3–4 hours and Wi‑Fi setup by phone. 1. Define time positions. 2. Move by counted motor time. 3. Re-sync on switch hits. The advantage is predictable positioning; the drawback is movement even when clouds provide no useful sun. [#20789546]

What changes are needed to turn this one-axis east-west tracker into a two-axis tracker, both mechanically and in the control algorithm?

The software change is manageable, but the mechanical redesign is the hard part. The author says a two-axis version would need a well-balanced, well-bearing-supported structure that stays durable and stable under load. Another post notes that two-plane tracking is much harder mechanically, even if the control concept is straightforward. [#20793858]
Generated by the language model.
%}