Skip to content

FreeRTOS-based solar tracker with Lithium-Ion charging and web interface

License

Notifications You must be signed in to change notification settings

sztvka/solarcharger

Repository files navigation

SolarCharger

ESP-IDF
This project is my first shot at programming real-time systems featuring multiple tasks. I wanted to create a dual axis solar tracker that's reliable in terms of hardware and software in the field where most of the similar projects run on a breadboard with an Arduino. The device is able to:

  • Track the sun in two axis
  • Charge a Lithium-Ion Battery with current limit and overvoltage protection
  • Display a web UI with real-time status of the device photo1 webUI

Hardware

Mechanical

The mechanical design is a remix of the Dual Axis Solar Tracker by OpenSourceClassroom. My updated design fixes some major mechanical issues apparent in the original design, mainly related to poor alignment of the two axis. In my new design, the pan axis is kept aligned with bearings, the gears are screwed on instead of being plastic welded and my design features proper cable management with strain relief.
Required materials for assembly:

  • Printed parts
  • M4x10mm Screws
  • M4x20mm Screws
  • M3x6mm Screws
  • 6001 Bearing (I recommend opening it up and removing the grease inside to decrease friction)
  • M3 standoffs (Optional, extra space under the pcb allows cable management)
  • M6x100mm threaded rod with two M6 nuts
  • MG-996R Servo (pan)
  • MG90S or SG90 Servo (tilt)
  • Cables (silicone insulation is optimal)
  • Cable conduit

Electronics

Hardware flowchart
Everything is placed onto a custom pcb. For more details refer to schematics and kicad files in the repository. This design uses a 3W solar panel.

Software

The code is written in ESP-IDF with FreeRTOS and is designed to run on an ESP32.

Compiling

Prerequisites

Steps

  1. Clone the repository git clone https://github.com/sztvka/solarcharger.git
  2. Make sure your ESP-IDF path is set correctly and idf.py is resolvable
  3. Install the required python packages pip install rjsmin css_html_js_minify
  4. Configure your install in config_default.h file
  5. Run the compile_extras.py script to setup the web UI (this will minify web files and set your config for compiling)
  6. Run idf.py build to compile the project
  7. Flash the device with idf.py -p (PORT) flash

Extra media

photo

video.mp4

License

This project is licensed under the Creative Commons Attribution Share Alike 4.0 International - see the LICENSE file for details
cc