Introduction: Dual Axis Solar Tracker With Online Energy Monitor

Picture of Dual Axis Solar Tracker With Online Energy Monitor

This project was one of my final projects I did on my exchange studies in Finland.

For this project I worked together with Fatbardh.

This is a much larger and more advanced version of one of my first projects ever.
Also a solar tracker: .

The features of this solar tracker are:

  • Solar tracking: making sure the solar panels are aligned to the sun as long as possible.
  • Energy monitor: This measures the voltage and the current generated by the panels and calculates the generated Power and Energy.
  • Data logging: this sends the data from the energy monitor into the cloud of ThingSpeak.
  • Also there is an LCD to display the values of the energy monitor

In this instructable are technical drawings of the project included. And at step 10 there is a link to the complete project report and presentation.


To read more about the energy profit from this kind of system please read this chapter on wikipedia.

This is also my entry for the 3D printing contest:
I would love to have a 3D printer. It will help me a lot to do other projects. To make gears and enclosures. So if you found this Instructable interesting please vote for my Instructable in the 3D printing contest.

My excuses for my spelling mistakes, you may always let me know if you see some.

Step 1: Overview

Picture of Overview

In this step I’ll go over all the used components in this project.

Solar panels:

We used 2 solar panels of each 12V 150W which will bring the total to 300W.

Ebay link

Energy Monitor:

The energy monitor uses 2 current sensors, to measure the current.

And one voltage divider to get the voltage down to a voltage that the Arduino its analog-digital-converter or ADC can handle.
If you don't want to make it your self you can buy one as well: ebay link

Light direction sensor:

Light direction is detected by four Light dependent resistors or LDRs. Each of the LDRs is placed in a voltage divider and the signal is fed to the Arduino its ADC.
ebay link

The end stop Switch

The end stop makes sure the mechanical construction doesn’t collide in its self.

Ebay Link

The motors

The motors are 12V linear actuators from internet.

Actuators on ebay

And are controlled with a very simple H-bridge.

motor drivers on ebay


The ESP8266 is a cheap WIFI module which we use to send the data to a ThingSpeak datastream

Ebay link


The display is used to display the energy monitor values

ebay link

The microcontroller

The microcontroller we used was an Arduino ATMEGA 2560

Arduino MEGA 2560 R3 ~10$ - Ebay

The charger

For the charger you should search for a MPPT (max power point tracking) chager. And for sure not buy the one in the picture because this one overcharged our batteries and is not MPPT.

Step 2: Mechanical Construction.

Picture of Mechanical Construction.

We both didn't had a lot of experience with metal working. Because of this we got help from a local vocational school.

The construction exists of a strong steel beam, in which a second part is placed, by sliding in a rod in a hole. To this set-up are levers added to which we connect the linear actuators.

Have a look at the technical drawings (PDF) and the pictures to get a better idea of what it looks like.

The technical drawings and the renderings are made with Fusion 360

Linear actuator ebay link

Step 3: The Light Sensor

Picture of The Light Sensor

This is the same principle as the previous version. 4 LDRs separated by a crossbeam. This time the crossbeam was 3d printed.

It works by comparing the average of LDR values of each side to determine which side to rotate to.

LDR holder 3d model:

Photoresistors ebay link

Step 4: Motor Control Algorithm

Picture of Motor Control Algorithm

The motor control algorithm is responsible for turning the motors on and off. This all depending on the data of the ligh sensor.

This also improved compared to my previous version. Now there is a hysteresis implemented. Comparable to a Schmitt trigger. So the motor turns only in if the light difference is larger than a certain threshold value, and it will only stop if the light difference is below a certain value.

Step 5: Energy Monitoring

Picture of Energy Monitoring

The energy monitor works by measuring the voltage and current output of the panels.
By multiplying these two values you get the generated power.

P = U * I
P= Power in Watt; U = Voltage in Volt; I = Current in Ampere.

By integrating the Power over time you'll get the total generated Power.

Voltage measurement

The voltage measurement is done by a voltage divider over the panels output. To get the output range of the panels 0-22V down to a range of 0-5V to protect the analog-digital-converter.

Current measurement

The current measurement is done by two ACS712 hall effect current sensors.

Current sensor ebay link

Step 6: Data Logging

Picture of Data Logging

The data logging is done by sending all the data to a ThingSpeak channel.

This is done by an ESP8266 WIFI module.

The ESP8266 ebay link

Step 7: Microcontroller

Picture of Microcontroller

Step 8: Software

If you want to use this code you should have a look at:

  • EnergyMonConnections.h
    • connections for the energy measurement
  • solartrackerdefines.h
    • settings and conenctions for the LDRs and solar tracker
  • solarPanel.h
    • to set the formulas right for the calculations of the ADC
  • internet.h
    • set wifi name and password aswell as api key

Step 9: Final Results!

Picture of Final Results!

Step 10: More Information

Picture of More Information

For much more information about this project.

I would like to recommend you my project report and presentation.



Step 11: Questions

Picture of Questions

If you have any questions, feel free to ask. If you can't find your answer in the comment section.
And I'll try to add more information to the Instructable depending where the most questions are about.

I hope you had fun reading my Instructable.


FellaMegaOld. (author)2017-11-29

See this image.. Oooh :)

FellaMegaOld. (author)2017-11-29

Meh.. 2x 5v 200mah panels (east/west or north/south) placed flat on the edge of the pv panel . 2x 5v relays with flyback diodes & 5v PV blocking diode to both east or west relay. Connect battery positive to n.c. of both relays & battery negative to n.o. of both relays. Connect common of one relay to actuator positive , connect common of remaining relay to negative of actuator.

No micro, No mosfet, No worries.

Absolutely foolproof & cheap. Please find a simpler & more elegant way ?

mongause (author)2017-11-25

Why add other sensors when the solar panel itself knows when it's squared up with the sun. Have the program measure panel output voltage each step until the voltage starts dropping then reverse to where the highest voltage was measured.

SimonF81 made it! (author)2017-11-24

Where did you get the LDR dome housing from? I have been searching everywhere and can't find anything as good. Currently i am using an inverted glass jar, but this is not ideal.


geo bruce (author)SimonF812017-11-25

I used a glass cap from a garden / street lantern
like in the picture

SimonF81 (author)geo bruce2017-11-25

Ah yes, your link is broken, but I think I understand what you mean. I will have to keep looking for one.
I simplified the code just to do just solar tracking, thought I'd get the basics working first.
Still having teething issues but slowly I will sort it out. It was working really well, then I realised how much water can be your enemy so now trying to fix it so not to have water problems again.
Thanks for the post, I have enjoyed making it.

geo bruce (author)SimonF812017-11-25

Very nice to see someone else built it too!

davem304 (author)2017-11-24

Hi Guys,

How did you calculate the rotational angle possible by the fixed arms and selected actuators. Really stuck on this.



CyberKID made it! (author)2017-10-08

Stunning! Great to see you made your earlier instructable into a real life usable solar tracker. Taking a cue from your previous instructable, I too started working on my own solar tracker. It's been around five years since I've been working on, constantly improving the design and implementation of the idea you gave in the previous instructable. While I tried replicating your initial project, I faced a lot of real-life problems, trying to convert a palm-top size model into one that's quite large (yes, my panels span across 1.6x2 meters, and weigh approximately 42 kilograms). It's further hard since finding the right stuff like linear actuators of the right size and capacity, gear boxes is pretty difficult here in India, especially when you have nothing to do with electronics and engineering in your academics.

I had to integrate solar panels into my home, and gradually move over to a grid independent home that is capable of taking care of all the power needs of my home for as long as I am getting enough sun and the days are clearer and sunny. Here are a couple of pictures of my tracker in action. The panels here are Canadian Solar Polycrystalline panels, 265 watt each, coupled with a 40A MPPT charge controller, which is hooked to a 1500VA home inverter that powers part of my home's appliances. I had to make the linear actuator on my own since there was none available online with a stroke length of ~500mm or more. The ones I was getting were <320mm, and extremely expensive. So, I built one using a 500 mm threaded steel rod coupled with a DC 12-24v geared motor running at 10rpm. I chose those geared DC motors since I couldn't lay my hands on servo motors that powerful. BTW my Zenithal motor has a stall torque of 45kgs and the Azimuthal motor stalls at 106kgs, way more power than what I need currently, but necessary in order to upscale the system in future. I'm still working on this along with my brother to build something as robust to handle itself autonomously, day in and day out. We are currently working on data logging, and will be gradually putting it up online to monitor and control the system remotely.

Thanks for creating that first instructable which helped me with the idea.

36South (author)2017-09-28

What azimuth angle can you achieve ? I have a 300mm (12 inch ) stroke actuator and am trying to reconcile the two pivot arm dimentions. As I read the plans, you have 330mm on the fixed pivot and about 715mm for the moving pivot. What is the stroke length you used ?

JuliusH20 (author)2017-09-27

Do you think that's possible that I use an Arduino Uno (see the project from Joshua Zimmermann) to control two 12V/24V DC motors for an dual axis slew drive?

Tchakounte Hyacinthe (author)2017-06-27

is it possible to use big servo motors to support such charge of 150W solar pannel? if yes may i have the name of such servo motors and how to use it?

Tchakounte Hyacinthe (author)2017-06-27

great work at all. thank to share it Ing. Geo Bruce. please i would like to know which motors you are using and the electronic scheme for command with connections details. Waiting please

SimonF81 made it! (author)2017-04-22

Loved the idea and concept so I decided to build one.
Now it's still in testing phase so its pretty rough around the edges.

I took the code and stripped it back to just the solar tracking, taking away all of the WIFI and the energy monitoring. To be honest I had a lot of trouble trying to get the energy monitoring side of the software working, and didn't try the WIFI part. Later I wish to get the energy monitoring going but use ethernet, not wifi.
I am only new to this so it was quite a learning curve getting it all to work, but initial testing shows that it should be good.
The tracker does get confused when there is no sun, just pointing to the sky.
Here is a time laps video of it working.

geo bruce (author)SimonF812017-04-23

Awesome build! Glad to see that someone replicated my instructable!
And it always points to the brightest point in the sky, so when there is no sun, if searches for the brightest point in the cloud.

Looks very good!!
please keep us updated if anything changes!

rohit27arora (author)2017-04-15

can you help with the code , as i'm using a stepper motor for pan motor

and the tilt motor is a dc motor .

chilefil (author)2017-03-26

Nicely done!!

bror2011 (author)2017-02-03

How big is the motor which use solar tracker ????

NetoW (author)2017-01-23

geo bruce, thank you very much, for passing your knowledge to us, I am from Brazil, and I am studying about photovoltaic energy and I will put this project into practice if you authorize, of course.

geo bruce (author)NetoW2017-01-23

Of course have fun with it!! I'm glad I you like my project!!
Please keep us up to date and post some pictures and share your experiences!

Good luck!

mohamedr39 (author)2016-12-11

well done, but i don't get where is your left and your right in LDR , and if PAN_MOTOR_PIN_0 mean the direction is left or right also if i need to use this code as only a tracker my Void Loop will only be

void loop() {





please let me know which pin is right and which is left for motors, also where is your left and your right in LDR in the 3D printer model on a simple sketch if it is possible, thanks and again well done.

KaiE7 (author)2016-09-01

I wanna copy that for my garden. Sorry in case i missed it but is there a circuit diagram/wiring diagram?

thingspeak (author)2016-08-03

Great project! Is your data on ThingSpeak public? If so, what is the channel number? We wanted to see if we could provide some MATLAB analysis of the raw data that might improve performance.

macner (author)2016-07-26

Hello Geo Bruce and Any kinf person who can able to answer,

I would like to make a similar one with horizontal stepper motor with micro step driver and vertical DC actuator, however i need some help on coding. Could you please help me on that. I have achieved to move both DC (driving with L293D) and Stepper motor, but i do not know how i can implement it into the code which is given here.

int pul = 3;

int dir = 2;

int DCyon1 = 5; // L293D's 2nd pin is one direction

int DCyon2 = 6; // 7th pin is reverse direction.

void setup() {

pinMode(pul, OUTPUT); // microstep driver pulse

pinMode(dir, OUTPUT); // microstep driver direction

digitalWrite(dir, LOW); // if it is HIGH means reverse direction of stepper motor

pinMode (DCyon1, OUTPUT);

pinMode (DCyon2, OUTPUT);


void loop() {

digitalWrite (DCyon1, LOW);

digitalWrite (DCyon2, HIGH);

digitalWrite(pul, HIGH); // this goes to pulse of step motor driver


digitalWrite(pul, LOW);



kak1616 (author)2016-07-25

Hi All,
I was wondering ... what kind of load (a resistive load?) is applied to the output of the solar panels ?
Since these are very high wattage solar cells how do the creators go about tackling this?
(I could not find any reference to that while skimming through the project)

Thank you

Evi Seeker (author)2016-07-01

Hi All, I was wanting to do something similar but keep the tracking simple to code and effect. I figured that being up to 5deg away from perpendicular to the sun wouldn't greatly affect electric output so my plan was to lead the sun by 5deg wait 40 minutes as the sun passed through perpendicular and then move ahead to lead the sun by 5deg again. So only about 18 movements per day. Given that the year is symmetrical, that's only about three and a half thousand x,y pairs for a given location. I would think an arduino could handle that kind of table lookup? What do people think of that idea?

Evi Seeker (author)Evi Seeker2016-07-02

Ok, I just read a post by Howdenpines over on:
Where he suggested having one axis parallel to the earth's axis. This hugely simplifies the required table of data. Each day the declination is set (23deg down at winter solstice, 23deg up at Summer solstice, zero for each equinox and a simple sine wave variation in between) and the axial rotation is then simply on time of day. I think I will simplify even further and only chase 9am to 3pm sun at 20 min intervals - 18 movements of 5deg so I won't be more than 2.5deg off perpendicular.
I'm still interested in anyone's thoughts ...

WaqasC3 (author)2016-06-30

Hi geo bruce,

What server have you used to upload the data? can you provide a link of that please?

DougM95 (author)2016-06-14

While this way of tracking is precise, it depends too much on digital subsystems that can fail, causing the entire thing to stop tracking.

Alternately, consider a mechanical/analog system that is based on differences in heat. Such a system uses the weight of a fluid in a closed loop system that is seeking to constantly equalize itself. As fluid heats up in one chamber, it pushes the fluid through tubes into another chamber. The balance point is constantly reached due to heat differences between chambers. The chambers are balanced whenever the panel is looking directly at the sun, since the amount of energy reaching both chambers is equal. If unequal, the side receiveing the most energy heats up, sending fluid into the other chamber to keep equilibrium equal.

The chambers are on a lever witha balanced fulcrum point that pushes microswitches at the ends of the lever arm. These switches are wired to the axis motors. As long as weight in the chambers are equal, the lever is perpendicular to the axis. Whenout of balance, the lever trips the switches, causing the panel to move.

neliswillers (author)DougM952016-06-24

Of course fluids can leak, freeze or degrade/decompose. You can also measure the power generation by using the panel's current to heat something and get on the roof every 15 minutes to read the mercury thermometer and write it in your little black lab book with a nice sharp pencil (you can still get these if you know where to look). The heater will only lower the system's efficiency by about 50%. All of this require complex pipework. But hey, if you want all such complexity, be my guest! The whole point with arduino/esp is that it is so much easier.

Eco, I think yours is a job well done! Congrats!

BTW, your English is much better than most people's Finnish.

docsshearon (author)2016-06-18

What was the total cost of these components and which panels manufactured by who at what cost ? Liked it...

bond815 (author)2016-06-14

If this is not an instruction on how to build this, what are you doing on this site? Not sure if you took notice but it's not called ideables!

geo bruce (author)bond8152016-06-16

I've added technical drawings with measurements to this instructable.
So now everybody should be able to make a copy of this project.

FatbardhX (author)bond8152016-06-16

Actually if you look closer, you will find all the details on how to build this thing. And if you were looking for some dumb step by step explanation that you might have used to make light bulbs switch on and off, then you will never be capable of building something of this size.

RazorQuin (author)2016-06-08

Nice project, I am also building a solar tracker but I am not using light sensors. I will use astronomical calculations. Apart from that It will be similar so thank you for sharing.

geo bruce (author)RazorQuin2016-06-09

Sounds cool, How will it determine it's exact location and orientation? Or are that parameters that will be hard coded?

RazorQuin (author)geo bruce2016-06-09

Well, im using what is called "solar equations" to know where the sun will be in a specific date and time for about 15 days. Using these equations and scilab or matlab I will calculate the angles. I am still thinking wheter I should calculate all the angles and save them in a eeprom for their comparison or design an algoritm that makes the calculations in real time both options based on a RTC such as a DS1307.

DoctorWizard (author)RazorQuin2016-06-09

I've already done it. I have built both a sun tracker and a moon tracker. All the formulas can be found in a book called "Astronomical Algorithms" by Jean Meeus. (And there are several other good books on the subject) Its all based on the Julian date system. Make sure you use a 32 bit microcontroller with floating point support such as STM32F103 because it's way too much math for an Arduino.

jbike (author)DoctorWizard2016-06-09

I have done astronomical calculations for a solar tracker too. I just used an Arduino pro mini along with a DS3231 accurate clock, that is more than enough computing power. see

marc.deloor.5 (author)jbike2016-06-15


RazorQuin (author)jbike2016-06-09

Im using an atmega32 for my project with avr-gcc compiler, thanks for the video.

RazorQuin (author)DoctorWizard2016-06-09

That's amazing, I will look for that book thanks for the advice.

tkjtkj (author)RazorQuin2016-06-14

Your 'calculation' method might be more accurate on cloudy days? Opinion?

Is your approach involving 'tables' , or are you actualoly doing astronomical calc's ??

linjari (author)2016-06-15

Hey, I graduated from there 2012 :) and probably brought first arduino to premises around 2009. Nice to see that positive mood for projects on them have grown since then.

HansF5 (author)2016-06-15

Smart piece of kit, well done

rickd68 (author)2016-06-14

I really appreciate your posting your work. I returned the favor and voted for this project under the 3D printer contest. Best wishes and Good Luck. Cheers.

geo bruce (author)rickd682016-06-14

Thank you very much! If you've any questions feel free to ask!

alex456 (author)2016-06-14

Hello! What part of produced energy you use for move your tracker?

geo bruce (author)alex4562016-06-14

The stall current of 1 motor is 3A @ 12V but in normal use it only takes 0.6A in this setup. And the motor in not constantly turned on, only for very short periods of time.

ve6cmm (author)2016-06-14

Hi Canyonman,

You could adapt this to track satellites as the concept is the same, however the detection of the satellite and keep it centered would be difficult. You might want to look up radiosonde equipment to do this. I worked on one system many years ago that would follow radiosonde balloons for miles. The concept is the same, just different.

About This Instructable




Bio: Hello, I'm Bruce. I'm a student in Belgium. I have a wide variety of interests: electronics, computers, technology, ... In my spare time I ... More »
More by geo bruce:Musical Tesla Coil Kit (instructions)Design a Parametric Pulley (DXF / STL)High Voltage Pulse Generator for $8 (stungun)
Add instructable to: