Introduction: DIY 5.2kW Solar Tracker Controlled by Raspberry Pi

Picture of DIY 5.2kW Solar Tracker Controlled by Raspberry Pi

A solar tracking system can increase the output of the solar farm with up to 40%. All commercial solar tracking systems I have found cost more than 40% of the total cost based on a fixed installation. Some solar tracking systems cost 2 times more than a fixed installation.

Hence it is better to buy more panels than to invest in solar tracking, unless you build the solar tracking system yourself. I set out to design and build a 5.2 kW solar tracking array, consisting of 20 panels, 260W each.

Each panel is about 1x1,6 meters, so the construction consist of 2 rows of panels, each row is about 2 meters high and 12 meters long.

The electronics I use to control the dual axis motion needs to be low cost, yet reliable. I decided to use a Raspberry Pi computer to calculate the sun position and to control the motors. The program was developed using Python, it is so easy to learn that anyone can understand and modify the program.

I spent about 6000 Euro/Dollars on solar panels, 3-phase inverter and cables.

The solar tracking system cost about 3 000 Euro. A fixed frame would cost about 1000 Euro.

I did not count my hours, but it was several days of work to build this.

The most expensive parts of the solar tracker was the linear motors, I used 4 motors (120 Euro each) and 4 drivers (50 Euro each)

Step 1: (Optional Step) Build Prototype

Picture of (Optional Step) Build Prototype

The prototype was built from scrap wood. It is actually two frames, one larger frame to track the suns vertical position, and one smaller frame to follow the horizontal position. The solar panel is mounted on the smaller frame.

Galvanized waterpipes are used to mount the frames and allow for the rotating movement.

An old screw driver was used as a linear motor, the Raspberry PI controls a motor driver that can set the speed and direction of the screw driver. The prototype only tracked one axis.

Materials used for prototype

  • Old 12V screw driver used as motor
  • RaspberryPi computer to calculate sun position and move the frame
  • Parallax HB-25 motor driver to drive the motor with GPIO pins
  • Limit switch to detect Home position
  • 10mm threaded rod and nuts used for linear motion
  • 12V DC source
  • 12V to 5V converter for the Raspberry Pi to run on 12 V

All plastic parts for the prototype was made in my 3D printer.

I have attached the Python code for my prototype to this step in the instructable.

Step 2: Build the Full Scale Solar Tracker

Picture of Build the Full Scale Solar Tracker

The solar tracker frame was built mainly with impregnated 2" by 4".

A stable foundation is very important. Depending on the ground conditions, you might want to dig or make concrete foundations. I used a mix of both since I found bedrock on some locations while digging.

I will continue to write on this instructable when I have a moment to spare.

I have the code, the bill of materials, drawings, lots of photos.... Let me know if you have questions.

The system has been online since august 2016. The production is displayed here: http://www.solarmanpv.com/portal/Terminal/Terminal...

Step 3: ​Configure the Raspberry Pi

Picture of ​Configure the Raspberry Pi

Follow these steps to configure your Raspberry Pi

  • Install Raspiban for Raspebrry Pi
  • Download and install bitwise SSH on your PC (To remote control the Pi)
  • Set time and date
  • Set time zone
  • Enable NTP so the time is always correct
  • Enable wireless
  • Disable ipv6
  • Install Python 3.5
  • Install Pysolar (Calculates the position of the sun based on the date and time)
  • Install RPI.GPIO
  • Create a program to control the solar tracker, or let me know if you want mine.

I use an apache2 web server and run parts of my application as a Python CGI in order to remote control the applicaiton. This way any device with a web browser can be used to control the application.

The plastic parts in the picture was made in my 3D printer.

Step 4: Let Me Know If You Need Any Further Information

Picture of Let Me Know If You Need Any Further Information

More pictures and a video will be added soon.

Comments

DrWeird (author)2017-10-04

Great project Mats! Can you provide some more detailed plans or pictures for the construction? Maybe parts numbers for the linear actuators? I am building my own solar setup, and yours seems to be very wind resistant, which is what I need. Any more detail/plans would be appreciated! Hello from Tennessee, USA.

MatsB76 (author)DrWeird2017-10-06

Hello! The linear actuators are: 30" Stroke 400lb Force Linear Actuators. Product Code RB-FRA-89. I bought them from robotshop.com.

I use 4 in total since I got two rows of panels. Each row need one actuator for tilting and one for turning the panels.

The raspberry pi is connected to the Parallax HB 25 DC Motor controller, the motor controller powers the linear actuators. I saw a while back that Parallax has released a better motor controller since I bought this.

mm44 (author)2017-02-16

Hello Mats
It is a fine project you've made, I find it safe in stormy weather.
Your panels are pretty close to each other, don't they shade each other in the morning.
What time of day is they free of shade from each other.

Martin

(Denmark)

MatsB76 (author)mm442017-10-06

Hi Martin. There is some shading in the morning and in the evening. The sun does not provide very much energy during that time so there is no great loss. I position the panels so they do not shade each other. This means they are not facing the sun directly, but there is so little energy there is no loss. The times depends on the angle of your array and the time of year.

MatsB76 (author)mm442017-02-17

Hi Martin. I don't know how storm proof it is yet. I had some wind during the winter and it seems good. The concrete Foundation is 1 meter deep so it should be good. Denmark can be a lot windier so you might need more struts.

The second row is about about 50cm higher that the front row of panels, it is a bit shade in the morning and evening but not much. Today the production of this sun tracking solar array was more than 50% more efficient than my fixed solar array. I have one 5,2kW fixed solar panel array and this one.

There is a bit of shade at sunrise and sundown, but the power produced during the morning and evening is very low.

I got 10kWh from the sun tracking 5,2kW array today and only 6kWh from the fixed 5,2kW array.

I built this in august, so I'm not sure how much I will loose from shadow in the summer. It seems like the atmosphere takes most of the sun during the shady hours.

I need to see how it behaves in the summer before I can know for sure....

Hydropunk (author)2017-01-13

Hi Mats. I'm interested in your project. I'm about to build a trough solar concentrator, and I need a way to very precisely point it at the sun.

Some questions for you:

1) You answered one commenters indicating that you that you've "attached" various code. Do you mean, the code would be accessible via the Download button? I'm wondering, since it seems that the download button only works if you have a premium Instructables account. I'd love to see the whole bit.

2) Is the motor always spinning, or does it move periodically then stop.

3) Does the Pi/controller track how many turns the motor makes, or do you determine speed/duration from testing, then use the limit switch to "return to zero", or something else. Related: Had you also considered using stepper motors for this project?

4) Could you provide pictures of the linkage between the motor(s) and the frame?

5) What make of 3D printer do you have, and do you recommend it?

Much thanks in advance!

-Kurt

(San Jose, California, US)

MatsB76 (author)Hydropunk2017-01-17

Hi. Very interesting with a solar concentrator!

My solar tracker will aim the panels in the general direction of the sun. It is not super accurate. A an error of a few degrees is hard to notice.

I think that your solar concentrator might need more accuracy, so stepper motors will probably be best for you.

1. At the bottom of step 1 there is a .py file. (Under the photos). Can you check if you see that? Otherwise I need to email it to you. I do not have a premium account for myself.

2. The motors starts every 10 minutes and moves for a certain time.

3. The motor does not track how many turns the motor makes. I use speed/duration calculations. I did not use stepper motors since that would be much more expensive.

4. I will add some photos of the linkage. I made it my self and used a steel sheet and a threaded rod.

5. I have a Vertex Velleman K8400 and it works great. It cost about 600 dollars and it is a kit that you need to put together yourself.

Kind regards, Mats

MatsB76 (author)2017-01-06

Here is a photo of the motors that control one of the rows. There is one linear motor for the side-to-side movement, and one motor for the angle movement.

biflip (author)2016-11-20

Love your project. I would like to attempt it. Do you have a link for the Python code for the tracking calcs? Thanks.

MatsB76 (author)biflip2016-11-21

Hi. It was a fun project!

I used pysolar for the calculations. (Python version 3.5)

Install pysolar by typing: sudo pip3.5 install pysolar

Here is the code.

#for pysolar
from pysolar import solar
import datetime

def GetSunPosition():
longitude = 12.5350953
latitude = 59.6365662
elevation = 55

when = datetime.datetime.now()

altitude_deg = solar.get_altitude(latitude, longitude, when)

sun = solar.get_azimuth(latitude, longitude, when, elevation)
if abs(sun) >= 180:
sundirection = abs(sun)-180 #Works before noon
else:
sundirection = abs(sun) + 180 #Works after noon

print(when)
print(sun)
print('angle', altitude_deg)
print('bearing', sundirection)
return sundirection

biflip (author)MatsB762016-11-21

Thank you for taking the time to respond to my question. I am a novice to Python and am taking a class. I don't have Internet available and am going to have to attach a time module my pi. Would it be possible to get all your code? I really liked the way you controlled the linear actuators. Thank you again.

Bruce

MatsB76 (author)biflip2016-11-23

Hi. I have attached a file called Servo - for instructables.py to this instructable. That is all code for my prototype.

The real system needs internet, I control the application from a website published on my rasperry pi.

Let me know if my .py contains all you need.

I used www.codeacademy.com to learn Python. It is free, online training.

A problem with the raspberry pi is that you need to set the time everytime it is started unless you have internet access. Is that what you need your time module for?

I let my raspberry pi go online to set it's Clock using NTP.

biflip (author)MatsB762016-11-26

Again I appreciate you taking the time for an answer. We are moving to the UK to a remote location. No mains electricity or Internet for miles. Can get mobile data though. But that just gets too complicated to go that route. Hence the need to be off grid with wind and solar. So I will have to use a time module to keep time. My apologies, I did not see the Servo code at first. Thanks again.

MatsB76 (author)biflip2016-11-27

That is a great idea. I will buy a time module and upgrade my own system. Which module will you use? I can get the same kind and let you know when I am done with the code.

biflip (author)MatsB762016-11-27

I would like that. I am glad that I can contribute something. I purchased a ChronoDot - Ultra-precise Real Time Clock - v2.1
PRODUCT ID: 255 from the Adafruit website. It was $17.95. Looking forward to seeing your results.

MatsB76 (author)biflip2016-12-15

Hi. I have recieved my RTC now. I will connect it to my Raspberry PI as soon as I get some spare time. I bought a similar RTC based on the same chip, so the code should work for you as well as soon as I'm done with it.

doggieman (author)2016-12-13

He man like your projeckt. It's looking great.

I have a question: i'm looking for the servo code also. I can seem to find it on your instructable. Can you give me a hint where to look? I have downloaded the PDF, but its not there.

I like the setup with the Raspberry and using Python with pysolar and I would like to give it a go in the future. Can you help me out?

Kind regards,

Marcel

MatsB76 (author)2016-11-16

I have now attached the python code for my prototype to this instructable. Let me know if you have any further questions.

oldbarnes (author)2016-11-14

Great job. I don't suppose you have the instructions in Pdf? Electronics used? Code?

MatsB76 (author)oldbarnes2016-11-14

I use a rasperry pi, Parallax HB 25 motor drivers, RB-FRA-89 linear motors, a 12V to 5V/USB converter from an auto parts store (to power the rasperry pi with 12V).

I don't have the pdf yet. I will add all instructions to this instructable, including the source code.

Maxim Andr (author)2016-11-14

The project is so expensive! How much does cost kWH in your country from energy supply organisation? What is estimation time for money back?

MatsB76 (author)Maxim Andr2016-11-14

Hi. I live in Sweden where the cost is about 10 Euro cents per kWh. Of the 9000 Euro, 35% is given back to me as a grant from the government. So my actual cost is 6000 Euro.

I expect the solar farm to produce about 8000 kWh per year which will save me about 800 Euro per year.

The electricity that I don't use myself is sold, and I get approximately 6 cents per kWh.

The payback time is about 10 years with the government grant. 15 years if you build without grant.

The expected Life time of the solar panels is 30 years (20 years warranty).

This will not make me rich, but it was a fun Project, it's good for the Environment, and if I get som batteries in the future, I can use electricity even if the Power is out.

DIY Hacks and How Tos (author)2016-11-14

Nice! tracking makes solar panels way more efficient.

About This Instructable

11,835views

184favorites

License:

More by MatsB76:DIY 5.2kW Solar Tracker controlled by Raspberry Pi
Add instructable to: