Electronics
Overview
This page is a quick tour of the electronics behind the solar tracker: how it is powered, what controls the motion, and how the system reports when something is wrong. The design is largely complete; the tracker itself is still being built and tested.
A Separate Power System
The tracker's electronics are completely independent of any power components associated with the main solar array. They run from two 12V, 100W panels wired in series (so the voltage is high enough for the MPPT charge controller to work) and two 12V, 100Ah LiFePO4 batteries wired in parallel. None of that is part of the array described elsewhere on this site. The main array's panels are wired into the same enclosure, but there they only pass through DC breakers and disconnects. From the DC circuit protection, the array power travels over heavy-gauge copper cable to the downstream charge controller, which sits with that system's battery bank.
Charging
A Victron SmartSolar MPPT 75/15 charge controller is connected to the tracker's panels and manages charging of the batteries. Its load terminals are rated to power all of the tracker's electronics.
The controller's load disconnect and reconnect voltages are set with the VictronConnect app. There is no data link between the Arduino and the Victron controller, so the firmware's low- and high-battery limits must be set to agree with the controller's. One condition is critical: The firmware's low limit sits 0.1V above the controller's disconnect voltage, and its high limit 0.1V below the reconnect voltage. The margin covers measurement tolerances and makes sure the firmware acts first, so the array can be stowed before the controller cuts power. It also avoids a race condition between the two. (One more thing to check on the controller: Remove its load-output jumper, or it can override these settings.)
Battery Warming
LiFePO4 batteries should not be charged near or below freezing. For near-zero conditions, an off-board W1209 thermostat module switches a 12V, 20W silicone heat pad on the batteries, and an XH-M609 voltage protector cuts the heater off if the battery voltage drops too low. This was a simple addition and, to be honest, an afterthought. Operation in the winter months is to be determined.
Power Distribution
A 4-channel (4-LM2596) DC buck converter takes power from the controller's load terminals and provides a 3.3V, 5V, 9V and 12V output for system components as required.
The Controller
The Arduino Mega was chosen mainly for its number of GPIO pins, and also because it has enough memory for the firmware. The firmware has an extensive set of features, including state streaming, serial commands (GET, SET, RESET and ACK functions) and telemetry, so it relies on uninterrupted serial I/O. An Arduino normally resets whenever a USB serial connection is opened. To keep the firmware running when a USB cable is attached, a capacitor is connected across RESET and GND, so the reset line never drops low enough to trigger a reboot. This deliberately works around the board's normal behaviour and preserves the firmware's run state.
Construction
The carrier is a two-layer PCB, with traces on both the top and bottom layers. It was designed in EasyEDA and manufactured by JLCPCB (https://www.jlcpcb.com/). This supersedes an earlier build on a large perforated protoboard. Only the Arduino Mega needed a modification to fit: Its top-side header pins were removed and placed on the bottom in order to mate with sockets on the carrier. Every on-board device is configured with header pins plugged into board sockets as this allows quick and easy replacement of components. Screw terminals are generally grouped by function: sensors, power, indicators and control.
Motion and Controls
Two MegaMoto Plus shields drive the azimuth and elevation actuators, as directed by the firmware based on sensor input and other conditions. They run straight from the battery bank at its unregulated voltage, which their input range allows, so no regulator is needed. They replace the electro-mechanical relays commonly used for this purpose, and their high continuous current capability was part of the design decision. Each actuator also has an external limit switch at each end of its travel, in addition to its internal ones. The external switches tell the firmware when an axis reaches the end of its travel, a small margin before the internal switches would need to trigger, so a move stops under software control and the internal switches are left as a failsafe. This avoids the need for an actuator with built-in Hall-effect position sensing, reducing the cost of an option and lessening a point of failure that you may not have the ability to remedy.
A latching switch selects Auto mode (autonomous tracking) or Manual mode, in which two joysticks move the azimuth and elevation actuators. In Manual mode, a momentary switch sends the array home, facing east and stowed flat.
Sensing and Timekeeping
The sun sensor is a typical quadrant of four LDRs (light-dependent resistors) wired directly to the Arduino's analog inputs. Besides steering the tracker, it is the backstop for the clock: When the average light is too low to track, whether at night or under heavy overcast, the array parks. If the GPS time is unavailable, the LDRs alone make that call.
Wind speed comes from an Inspeed WS2H pulse-output anemometer. It drives the wind-stow response based on per-second readings. The anemometer is mounted on the array using a pendulum-weighted shaft in order to keep it upright as the array tilts.
The time source is a u-blox MAX-M10S GPS. It replaces a DS3231 RTC module that I used at first and, in hindsight, other than location awareness, the GPS doesn't really add anything that the DS3231 already provided. The GPS breakout utilizes a supercapacitor that lets the module keep its captured data and speeds reacquisition after a power loss. A GPS failure is detected, reported and responded to. The firmware has dawn and dusk hour constants that govern wake and return-to-home events. Although the GPS module is mounted on the PCB, it is attached to an external active antenna via SMA connectors.
Supported Constellations:
- GPS (United States)
- GLONASS (Russia)
- Galileo (European Union)
- BeiDou (China)
Concurrent Tracking: The hardware platform supports receiving all four simultaneously, though specific firmware versions may limit concurrent active reception to three constellations at a time.
Display and Diagnostics
An I2C OLED display shows the time, GPS status and the highest-priority system fault. The firmware detects and reports an OLED failure, which has no effect on tracking.
A 32KB FRAM module, also on the I2C bus, stores system-critical records written by the firmware. They can be retrieved with commands in the software, mainly for fault diagnosis. Like the OLED, it has failure detection and reporting. Periodic "canary" writes to memory outside the area used by the ring buffer check that the connection is still good. A write-confirm was considered and rejected for reasons of timing and actual value, though I may reconsider it.
A row of warning and fault LEDs signals off-nominal conditions and system faults, covering more conditions than the OLED shows. Some clear themselves; others signal that intervention is needed.
Telemetry
The firmware streams telemetry and system status to a Node-RED application over the USB serial connection (see the Software page). Included in the stream are battery voltage, wind speed, GPS and enclosure conditions, and state flags similar to the LEDs. A second, independent copy of the same telemetry stream leaves the Arduino on a separate serial (UART) port. An XY-485 RS-485 converter and an EW11A-0 RS-485 to Wi-Fi gateway pick it up, but they are part of SolarLink, a completely independent and optional project with its own power. The tracker works exactly the same without them. A jumper on the carrier PCB switches this second stream on or off: fitted enables it, removed disables it. It is read once at startup, so a change takes effect at the next reset. SolarLink is described under WiFi / Starlink.
Enclosure
The electronics are housed in a VEVOR hinged steel enclosure, 20 x 16 x 8" (500 x 400 x 200mm) outside and 19.6 x 15.6 x 6.6" (497 x 397 x 166.5mm) inside. The box is 1.5mm carbon steel with an epoxy polyester powder coat in gray (RAL7035), and the door is lockable. The manufacturer says it is designed to meet IP66 and NEMA 1, 2, 4, 4X and 12; that is its claim, not something tested here. Inside is a detachable 2mm galvanized backplate, 17.7 x 13.8" (450 x 350mm), for mounting the electronics.
An off-board W1209 thermostat module runs a small 12V fan to regulate the enclosure temperature. A service light comes on when the enclosure door is opened (a microswitch) and the light detector reads dark.
The remaining hardware belongs to the solar array itself and the downstream devices, which will be covered on other pages.