Mobile Sun Tracking Solar Power Plant

Solar Tracker

A recent storm with horrific winds took down our electrical power. The outage was widespread, straining the power company to get everyone back online. We were without power for almost 3 days - no heating, no hot water, no refrigeration, no range, no microwave, no lighting. No TV, no WiFi, and no hot coffee in the morning. And we were the lucky ones; many were blacked out for over a week. Time for a backup plan.

My first thought was to buy a gas-powered generator. Plenty of backup power but with one problem; it's gas-powered. Big, heavy, noisy, lots of exhaust, and not exactly eco-friendly. And it uses fuel which may be scarce when, for instance, zombie hordes rule the land. I wanted something that would provide efficient power indefinitely, without burning up the gas. Something mobile and quiet I could use while camping as well as emergency backup. Something like a small solar power plant.


  • Sun Tracking Sensor
  • Renogy 50W Monocrystalline Solar Panel
  • Renogy 30A PWM Charge Controller
  • 85AH Deep Cycle Gel Batteries
  • 2000W DC-AC Power Inverter With 3 AC Outlets
  • Bussmann 150A Resettable Circuit Breaker
  • Servo Motor for Azimuth Axis
  • Linear Actuator for Elevation Axis
  • Arduino UNO Controller
  • Adafruit Motor Shield v2
  • Backlit LCD Voltage Meter
  • Adjustable LED Bar Work Light
  • 12VDC Switched Outlet With 15A Resettable Circuit Breaker
  • USB Charging Outlet
  • Durable Battery Box With Carrying Handles


Visual Schematic-PowerPlant

Visual Schematic-Arduino

Solar Panel With Sun Tracking Sensor

After a little research I found that a solar panel tracking the sun from morning through evening is much more efficient than a fixed panel. Estimates range from 35% to 50% higher efficiency using dual-axis tracking. The expense to implement sun-tracking can get quite high however, especially for larger systems. Given that only one medium-sized solar panel was going to be used for this project, I decided sun-tracking was needed to get maximum efficiency. Besides, tracking the sun makes for a more fun project.

A servo motor geared for high-torque controls the azimuth positioning of the solar panel, and a 12VDC linear actuator controls the elevation. Both of these were purchased from Servo City along with the aluminum tubing, brackets, and mounting hardware. The servo and linear actuator are driven by an Arduino UNO microcontroller using the Adafruit Motor Shield, and powered by the deep cycle Gel batteries.

The sun-tracking sensor is made from a cheap 6-LED flashlight. I picked up a pack of 4 of these for less than 6 bucks at the local hardware store. I removed the LEDs from one of the flashlights, cut some tracks, then soldered in 3 LDR photo sensors arranged in a triangle. These are separated by "shades" cut from a black vinyl plastic sheet that were shaped and welded together using a heat gun as shown in the photos.

The LDRs are connected via a 4-conductor cable to analog input pins A0, A1, and A2 of the Arduino; azimuth is determined by the light levels sensed by two of these side-by-side, and elevation is determined by averaging the levels of those two and comparing to the light sensed by the third LDR positioned below them. This arrangement allows the Arduino to orient the face of the solar panel towards the direction with the most light by driving the servo and linear actuator. At night, the Arduino automatically positions the solar panel to face east in anticipation of the morning sunrise. The end of a clear polypropylene test tube protects the LDR photo sensors, with a small hole drilled in the bottom to help prevent it from fogging.

The Arduino communicates with the Adafruit Motor Shield using I2C over pins A4 (SDA) and A5 (SCL). The servo motor is controlled using an output from the Arduino on pin 9. The linear actuator has a built-in potentiometer for indicating its position. One end (yellow wire) of the pot resistor is connected to +5v. The other end is tied to the wiper (white and blue wires) which are then connected to pin A3 through a 10k resistor, forming a voltage divider allowing the Arduino to sense the position of the actuator.

The metal bracket covering the base of the solar unit is a custom piece I created with eMachineshop. It has slots that fit snugly around the screw heads on the legs, allowing it to securely snap into place.

Low-Cost 6-LED Flashlights
LED Flashlights

Hacking The Flashlight

Disassembled Flashlight LDRs replaced LEDs
PVC Dowel Sensor Head

Battery Power Pack

An Attwood Power Guard 27 box was the perfect size to house the two 12V deep cycle Gel batteries; one 50Ah and one 35Ah wired in parallel for a total of 85Ah. These are kept charged by a Renogy 30A PWM Charge Controller connected to the Renogy 50W monocrystalline solar panel via a 20 foot cable with MC4 connectors, as shown in the video.

A 2000W DC-AC power inverter is connected to the batteries through a Bussmann 150A resettable circuit breaker. The power inverter provides 120VAC to three outlets and a USB outlet handy for charging cell phones, GPS trackers, and tablets.

The Renogy Charge Controller and the power inverter are bolted directly to the sides of the Attwood battery box to keep everything together, making it easy to carry.

A sunlight-readable backlit LCD meter is also mounted to one side of the battery box, along with rocker power switch, a sealed marine 12VDC outlet, and an adjustable LED bar work light.

I deliberately avoided mounting any components to the lid of the battery box so it could be removed freely, allowing the 20ft cables that connect to the solar panel unit to be stored in the box as shown in the video.


Wiring Wiring
Wiring Power Pack


I'm happy with the compactness of the battery power pack. Housing 85Ah at 12VDC for 1KWh of power, a 2000W power inverter, a charge controller, a voltage meter, an LED light bar, multiple outlets with circuit breakers, as well as all cables in such a small space is extremely convenient for portability.

However...this thing is HEAVY! At 58 lbs. I won't be taking it backpacking anytime soon. But the handles do make it fairly easy to carry even if getting a tad winded, and I wouldn't hesitate to throw it in the back of my Jeep to take on a camping trip. And it is still very easy to move and set up for emergency backup at the house. Although I would put it on wheels if I had to lug it more than a couple hundred yards - maybe in a wheeled cooler or on a luggage wheeler. Still, beats dragging around a heavy gas generator with fuel hands down.

The solar panel unit is much lighter at 15.2lbs but a bit more awkward to carry and would take a fair amount of space in the back of the Jeep. I've considered modifying the design to allow the panel to be easily removed, and collapsible or removable legs would probably also help make it easier to transport. I wouldn't call it fragile, but obviously it's not as rugged as the battery power pack.

One other complaint: the screw terminals on the Renogy Charge Controller are under-sized. They're almost too small to capture the #10 MC4 cable reliably, and I always make sure to have a screwdriver on hand to tighten up when needed.


Solar Power Schematics (PDF) - Mobile Sun Tracking Solar Power Plant Schematics

Source Code

SolarTracker_Rev_2.zip - Arduino Sketch



www.arduino.cc - Arduino main site
www.adafruit.com/products/1438 - Adafruit Motor Shield v2
www.renogy-store.com/MonoCrystalline-Solar-Panel-s/1831.htm - Solar panel
www.renogy-store.com/30-amp-charge-controller-p/ctrl-pwm30.htm - Charge Controller
www.harborfreight.com/2000-watt-continuous4000-watt-peak-power-inverter-69662.html - 2000W Power Inverter
www.servocity.com/ - Servos, linear actuators, motors, mechanical parts

Post nubila maxima, Phoebus

free b2evolution skin


Comment from: pundito [Member] Email
This is something I would like to rebuild !
Great work ... do you have a part list available. E.g. I just looked for the ServoCity Linear Actuator ... they have so many almost similar ones - no idea which one you used.
A complete part list would be so apprecialted.

Best regards and keep up the good work,
08/16/14 @ 16:57
Comment from: kschulz [Member]
Thanks Guido! I don't have a complete parts list, but nearly all are identified in the schematics, which you can download in PDF format using the link in the Schematics section above. Here are links to the major components:

Arduino Motor Controller


Linear Actuator (2" stroke)

Solar Panel: (avail on Amazon)

Charge Controller (avail on Amazon)

Power inverter

Nearly all of the parts for the solar panel mount were obtained from Servo City.

Hope this helps!
08/16/14 @ 17:24
Comment from: pundito [Member] Email
Thanks for all the information !
I'll for sure give it a try :)
08/17/14 @ 04:40
Comment from: dmsolar [Member] Email
This looks like a great project.I'm concerned about the match of the ldr and resistor. I found the 10k but there are many 5v LDR's thinking of going with Audrino brand. Also you have a globe over the sensor that didn't seam to come with the led light. Impressed with your work!
09/08/14 @ 21:45
Comment from: kschulz [Member]
Dmsolar, thanks! Pretty much any LDR can be used, or even a photo-transistor. I'm just using a 10k resistor with the LDR to set up a voltage divider that provides a value at the analog input ranging from around 100 (least light) to 1000 (most light). I cut off the end of a clear plastic test tube to use as a cover over the sensors.
09/08/14 @ 23:17
Comment from: dmsolar [Member] Email
This looks like a great project.I'm concerned about the match of the ldr and resistor. I found the 10k but there are many 5v let's thinking of going with Audrino brand. Also you have a globe over the sensor that didn't seam to come with the led light. Impressed with your work!
09/11/14 @ 03:10
Comment from: dmsolar [Member] Email
Thank you ! Coo project!
09/11/14 @ 03:17
Comment from: ty tower [Member] Email
Overboard on cost for me so I am looking for a cheaper set of hardwars all round and searching my bits and pieces.
The software however is excellent . Well written and commented and quite professional in its presentation. Top marks
I have been messing around with two servos and the 3led sensor and used an old PIR housing and RC servos just to get something happening . Lots of fun to be had there with the LED sensor.
Using a version 1 shield as its another $70 odd to get a version 2 Adafruit shield and I had a version 1 hence the two servo approach.
Thanks Kurt . very well done mate!
09/17/14 @ 05:25
Comment from: ty tower [Member] Email
Did not get a comment box on the Scooterputer ?
Seems to me it would be an ideal addition to a Yacht.
A bit heavy for me yet but I might look at it after I get the solar panels working.

You might move this comment to the Scooterputer
Cheers from the Great Barrier Reef
09/17/14 @ 05:52
Comment from: ty tower [Member] Email
Just another thought on cost reduction . Old 12V Cordless drills are abundant here thrown away . Bit of threaded rod and a nut and voila.
09/19/14 @ 06:01
Comment from: kschulz [Member]
Hey ty tower, thanks for the positive comments and feedback! Sorry for the late reply. I just returned from a dive trip to Bonaire. The GBR is on my bucket list - hope to visit soon for some great diving. You're right, the servo and actuator motors are a bit pricey. I like your idea of possibly using DC motors from cordless drills, and I do have a few in my stash. Would probably need a bit more mechanics for coupling and control, but could easily be the cheaper way to go. Thanks again my friend!
09/21/14 @ 11:24
Comment from: dmsolar [Member] Email
I have been tinkering with this for a while now in my spare time. I have the controller inverter and meter mounted on thick plastic bolted to my hand truck that the battery is setting on as I got a good deal on a larger 125 amp solar battery a work in progress until I get it all packaged up! I have LDR's mounted in the light and started playing with the Audrino this week just today i tried to upload the code SolarTracker_rev_2 and I'm getting errors starting with Adafruit_MotorShield MS = Adafruit_MotorShield( ); not defined. I'm no sure if I have the wrong version or it got corrupted or changed. I'm using the Audrino Uno. at this point i don't have the motor shield v2 connected. just trying to load the Uno with no other connections to it. any thoughts on this? I was able to load a few of the example codes with no problem, and the Uno responded.
11/23/14 @ 17:33
Comment from: kschulz [Member]
dmsolar - do you have the motor shield library from Adafruit copied to the Arduino "libraries" folder? This sketch uses the Servo, Wire, and Adafruit_Motorshield libraries, and the "Adafruit_PWMServoDriver" included within the Adafruit_Motorshield folder. You can get the Adafruit libs here: https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/install-software
11/23/14 @ 18:40
Comment from: dmsolar [Member] Email
Ok, I'll check that out. Thank you so much. I'm having a lot of fun with this project!
11/23/14 @ 18:49
Comment from: dmsolar [Member] Email
Thanks again i was able to add the libraries, and it compiled and uploaded. so now the real fun can start!
11/23/14 @ 20:15
I work in power engineering and this is really well done!
12/24/14 @ 21:34
Comment from: photostreet [Member] Email
I looked at your design and I am beginning to replicate it. Do you have the design or the parts for the base of the solar tracker. The piece from emachineSport and how the horizontal pole is incorporated into it.
06/23/15 @ 19:53
Comment from: kschulz [Member]
Photostreet - I just emailed you the eMachineShop base cover CAD file. Hope it helps you out!
06/24/15 @ 08:48
Comment from: grson [Member] Email
Has anyone have trouble with getting the actuator to run? I've been working on this for the past three weeks, i have everything down, except the actuator. I've look at the arduino sketch, and tried to change it around. I have it prototype using a breadboard first before i start soldering everything together. Any help will be greatly appreciated. E-mail me for faster response gerson3@hawaii.edu
07/22/15 @ 00:55
Comment from: grson [Member] Email
Great project also, now i just need to have mine working
07/22/15 @ 01:00
Comment from: kschulz [Member]
Grson - I'm working with someone now who is also having problems getting the linear actuator to work. Hang in there and I'll post when we find the problem.
07/22/15 @ 09:35
Comment from: kschulz [Member]
Grson - The schematic diagram showed the black wire coming from the linear actuator connected to the GND terminal on the motor shield. This is NOT correct. It should be connected to the open M4 terminal, adjacent to the red wire terminal. Sorry for the error - the schematic has been updated.
07/22/15 @ 10:34
Comment from: photostreet [Member] Email
Thank you kschulz for your email but it went to my junk email that apparently has a self delete function but I saved the information. The cover you were talking about i would be interested in getting it. I got many parts in the list but not all and I am about to get the rest today but one question. The project is mounted on a four legged stand. In the list you gave is that mount built from the (634226) 1/2 inch x 2 inch Precision and the (545560) 1/2 inch Bore Set Screw Hub (0.770 inch) ? If that is the case the items should be four each in addition to two 45 Degree Dual Angle Channel Brackett (585426)? The only parts I am looking for is how to secure the servo to the 4 legged mount, whether by screws or other attachments.
07/22/15 @ 21:22
Comment from: dmsolar [Member] Email
Wow! I just saw the post on moving the black lead to m4! Its Alive!! I have been checking continuity on all my connections. and comparing the diagram to the specs on ServoCity. I also thought i may have fried my board. i also noticed today that a bought the 25 lbs. linear actuator not the 115! I hope it won't be too much of an issue! Still testing as i just changed the connection a few minutes ago..I've had to correct my typing about 10 times!! pretty excited! fyi to other builders I found that a piece of plastic rain gutter can be used as a temp. cover. I may also look into your Fab. cover as it's pretty cool!
07/25/15 @ 18:17
Comment from: kschulz [Member]
dmsolar - there was one other change made to the schematic to correct the connection of the linear actuator's position pot. Previously, it showed the 10K resistor wired in series to A3. It should be in parallel as shown now.
07/25/15 @ 18:28
Comment from: dmsolar [Member] Email
Ok I have had it out in the sun for a while the actuator doesn't want to extend except on startup. Looking on the specs.from SC. the white and yellow leads are reference leads, and the blue (wiper) is the position signal. I have the 5 vdc from the board wired to the yellow. and tied the wh and bl together soldered to one end of the 10k res. and input the other end to a3. I can read a 5 vdc at the end of the resistor. I'm not very familiar with it but, is ths correct? or should both of the reference leads have the 5 vdc and the (wiper) blue lead be separate and have the 10 k resistor into a3? I'm a little worried about burning things up!
07/25/15 @ 20:18
Comment from: dmsolar [Member] Email
so I didn't see your post before i sent my las one. Thanks! i will check it out.
07/25/15 @ 20:20
Comment from: dmsolar [Member] Email
my next question is you show the ground reference to battery ground, is it the ground from the Arduino card? if not where? i'm currently using the card ground near the 5 vdc
07/25/15 @ 20:26
Comment from: kschulz [Member]
Yes, make sure the actuator position pot is wired according to the schematic as it's now shown. The pot and 10K resistor form a voltage divider read by analog input A3. The Arduino is powered by the battery. It is OK to wire to the Arduino ground.
07/25/15 @ 21:03
Comment from: dmsolar [Member] Email
Ok thanks!
07/25/15 @ 23:13
Comment from: samo111 [Member] Email

I have put you code on Arduino 1.6.7 and when i start with cheking code, i recive masage :
- compilation terminated.
- exit status 1
- mistake in translation

What could bi wrong, because i cheked code and see it is same as you have put on net.
01/25/16 @ 11:38
Comment from: abokhadejah [Member] Email
Can you give me your email to correspond with you ؟؟
01/06/17 @ 07:27
Comment from: will.schools [Member] Email
Hi Kurt,

I really liked the complexity and functionality of your project thanks for sharing your hard work with the world! I was having a small issue with controlling the linear actuator. I followed your instructions and tripled checked off your schematic with my connection but I cant seem to figure out why the servo responds but actuator doesn't. I've been troubleshooting for 3 weeks without any progress. I appreciate any help but none the less this is still a fantastic project!
04/23/17 @ 04:29
Comment from: kschulz [Member]
Hi Will - originally there were two errors in the schematic for the linear actuator, but the schematic shown here was updated awhile ago. Check the red and black wires coming from the actuator motor to make sure they're connected to both M4 terminals of the motor shield (the black wire must NOT be connected to ground). Also, the white/blue wires from the actuator pot should be connected directly to A3, with a 10K resistor in parallel to ground to form a voltage divider (the old schematic showed the 10K resistor in series which is not correct).
04/23/17 @ 18:08
Comment from: will.schools [Member] Email
Thank you for your quick response Kurt!

I actually wired the white/blue wires from the actuator in series with the 10k resistor. I will try wiring the 10k resistor in parallel and report my results again.
04/23/17 @ 22:09
Comment from: will.schools [Member] Email
Hello Kurt,

I followed your advice and made sure to connect the white(pot ref) and blue(pot wiper) wire directly to A3 of the motor shield, with a 10k resistor connected in parallel but still no response from the actuator. This is the actuator we are using.

Could it be that our actuator requires more current than the shield can supply?

I also noticed that the M4 terminal on the shield only supplies a few milli volts which is not enough to drive the 12V actuator.

If possible could I contact you privately and send you pictures of my connection?

04/29/17 @ 18:22
Comment from: kschulz [Member]
@Will - how are you providing power for the linear actuator motor? Do you have the jumper in place on the Motorshield to supply VIN power from the DC jack to the motor?

From the Motorshield FAQ on the Adafruit website:

HELP! My motor doesnt work! - HELP! My motor doesnt work!...But the servos work FINE!
Is the power LED lit? The Stepper and DC motor connections will not work if the onboard green Power LED is not lit brightly!
You must connect 5-12VDC power to the shield through the POWER terminal blocks or through the DC barrel jack on the Arduino and VIN jumper.

What is the green Power LED for?
The LED indicates the DC/Stepper motor power supply is working. If it is not lit brightly, then the DC/Stepper motors will not run. The servo ports are 5V powered and does not use the DC motor supply.

See it here:
Adafruit Motorshield FAQ
05/01/17 @ 00:37
Comment from: holger [Member] Email

I am really happy that I found this great project. But when I wanted to start order needed stuff I recognized that the linear actor seems to consumpt more current than adafruit shield is designed for. How did you solved this problem?

Best regards
07/09/17 @ 08:04
Comment from: kschulz [Member]
@Holger - the Adafruit motor shield is spec'ed as using TB6612 MOSFET drivers with 1.2A per channel current capability (you can draw up to 3A peak for approx 20ms at a time). The linear actuator I used is spec'ed at 800mA current drain with no load, and 3.8A at max load. Looking at the speed vs load chart on the Servo City website, loads range from 0 to 315 lbs. Weighing only 11 lbs, the solar panel represents a very light load, and the actuator operates at a very low duty cycle. You shouldn't have any problems using the Adafruit motor shield for this. The heavy duty actuator is way overkill, but that's what I had on hand. If you prefer, you can use a lighter duty actuator that draws less current since the solar panel is such a light load. Good luck with your project!
07/09/17 @ 08:58
Comment from: holger [Member] Email
Thanks a lot!!!

Best regards
07/11/17 @ 13:11
Comment from: knutarn [Member] Email
Hi :) Does it have to be placed west before I turn it on? or?
07/11/17 @ 14:42
Comment from: jherrmann [Member] Email
This a well thought out project. Thank you.

Please send me a copy of your CAD file. I'm thinking of creating one.

Thank you,
11/30/17 @ 09:03

Comments are not allowed from anonymous visitors.