Google Tag

Sunday, December 29, 2013

Arduino Controlled dual axis Solar Tracker


Arduino Controlled dual axis Solar Tracker by Kostas Kokoras

It's a Solar Tracker project with the Arduino Duemilanove upgraded with atmega328 which controls two linear actuators with 24V DC motors. It calculates the position of sun in the sky in degrees (elevation & azimuth) according to date and time which gets from a i2c RTC (DS1307) and the coordinates of the place is installed also.      

Είναι μια κατασκευή Solar Tracker με το Arduino Duemilanove αναβαθμισμένο με  τον atmega328 η οποία οδηγεί δύο μοτέρ 24V dc (linear actuators).Υπολογίζει την θέση του ήλιου στον ουρανό σε μοίρες (elevation & azimuth) βάση την ημερομηνία και την ώρα, τα οποία τα παίρνει από ένα i2c RTC (DS1307), αλλά και τις συντεταγμένες του σημείου εγκατάστασης.

The theory of sun position calculations is here
Η θεωρία για τον υπολογισμό της θέσης του ήλιου βρίσκεται εδώ
http://www.pveducation.org/pvcdrom/properties-of-sunlight/motion-of-sun

Watch the video...
Δείτε το βίντεο...


Arduino Controlled dual axis Solar Tracker



Potentiometer
For the measurements of the degrees i put a potentiometer on each axis. Arduino ADC converts the potentiometer reading to degrees, 30-90 degrees for Elevation and 120-240 degrees for Azimuth. Potentiometers aren't so accurate with angle measurement, i suppose decoders will do better job but they cost more.

Ποτενσιόμετρο
Για την μέτρηση των μοιρών του tracker στον κάθε άξονα προσάρμοσα από ένα ποτενσιόμετρο και ένα μοιρογνωμόνιο. Το arduino μετατρέπει (ADC) την τιμή του ποτενσιόμετρου σε μοίρες, για το Elevation 30-90 μοίρες και το Azimuth 120-240 μοίρες. Τα ποτενσιόμετρα δεν μου δίνουν μεγάλη ακρίβεια στις μοίρες. Θα ήταν καλύτερα πιστεύω Encoders αλλά με ανάλυση 360 μοιρών για μέγιστη ακρίβεια. Φυσικά αυτό ανεβάζει το κόστος.


On/Off Switch
An On/Off switch changes the status of the tracker to "sun tracking mode" so it moves automatically according to the degrees that calculates and to "manual mode" so with four buttons you can activate any (one each time) move by hand. If you press UP and EAST at the same time enters to "calibration mode" so it makes all the moves one by one until each limit switch is reached, so it reads the potentiometer value and stores it to RTC memory

Διακόπτης on/off
Ένας διακόπτης on/off για να αλλάζει κατάσταση σε "sun tracking" όπου κινείται αυτόματα σύμφωνα με τις μοίρες που υπολόγισε και σε "manual" όπου με τέσσερα buttons μπορείς να ενεργοποιήσεις οποιαδήποτε (μια κάθε φορά) κίνηση χειροκίνητα. Αν πατήσεις το UP και το EAST ταυτόχρονα μπαίνει σε "Calibration Mode" όπου κινείται σε όλες τις κατευθύνσεις μία-μία ως ότου ενεργοποιηθεί ο κάθε τερματικός διακόπτης και διαβάζει την τιμή του ποτενσιόμετρου και την αποθηκεύει στην μνήμη του RTC.


RTC DS1307
The DS1307 i2c RTC keeps time, date and weekday and has some memory also. Maybe i should add some capacitors to crystal because it keeps loosing time.

Το i2c RTC DS1307 κρατάει την ώρα, ημερομηνία και ημέρα εβδομάδας αλλά έχει και μνήμη. Εδώ μάλλον πρέπει να βάλω και πυκνωτές στον κρύσταλλο γιατί συνεχώς χάνει την ώρα.



Limit Switches
Four Limit Switches for each limit position of two axlis of tracker and a led to indicate that at least one limit switch is activated.


Τερματικών Διακόπτες
Τέσσερις τερματικοί διακόπτες για τον έλεγχο των ακραίων θέσεων για κάθε κίνηση και ένα led που ανάβει όταν έστω και ένας τερματικός διακόπτης έχει ενεργοποιηθεί.




H-Bridge DC motor control
The two 24V DC motors are controlled through an  H-Bridge with two relays each from here     http://arduino-info.wikispaces.com/DC-Motors. Give some attention to "fly wheel braking" explained there.

Για τον έλεγχο των δύο μοτέρ 24V DC χρησιμοποίησα δύο κυκλώματα ελέγχου μοτέρ σε συνδεσμολογία H-Bridge με ρελέ  από εδώ  http://arduino-info.wikispaces.com/DC-Motors. Δώστε προσοχή στο φαινόμενο "fly wheel braking" το οποίο κάνει τα μοτέρ να "φρενάρουν" μόλις σταματήσει η τροφοδοσία τους.
                             
Download my Android Apps!
Κατεβάστε τις Android εφαρμογές μου!



To download from Google Play scan QR Codes or click the banners.
Για να κατεβάσεις τις εφαρμογές σάρωσε τους QR Codes ή πάτα στις εικόνες.




Finished
Ολοκληρωμένο



I also built a Visual Basic Application to which arduino sends all data to display on monitor with the current Solar Chart.

Έφτιαξα και μια εφαρμογή σε Visual Basic στην οποία στέλνει με την σειριακή το Arduino όλα τα δεδομένα και εμφανίζονται στην οθόνη και με γραφική παράσταση της πορείας του ήλιου.




The earth moves 360 degrees every 24 hours which means 15 degrees per hour or 60 minutes so it is 1 degree every 4 minutes. I programmed the tracker to move every 16 minutes to calculated position 8 minutes advanced from current time, so 2 degrees advanced from sun. At the next 8 minutes sun will come direct to tracker and pass it by 2 degrees and then the tracker will calculate new position and move to it. If the elevation degrees are equal or lees than zero, which means that the sun is set, tracker moves to horizontal position and stays there all night until the sun rises again.


Η γη κάνει 360 μοίρες σε 24 ώρες που σημαίνει 15 μοίρες την 1 ώρα ή τα 60 λεπτά άρα 1 μοίρα κάθε 4 λεπτά. Το έχω προγραμματίσει να κινείται κάθε 16 λεπτά και να πηγαίνει στις μοίρες που αντιστοιχούν σε 8 λεπτά από την δεδομένη στιγμή, άρα 2 μοίρες μπροστά από τον ήλιο. Στα επόμενα 8 λεπτά ό ήλιος θα έρθει κάθετα στο tracker και στα επόμενα 8 λεπτά θα το περάσει κατά 2 μοίρες, οπότε και θα γίνει ο επόμενος υπολογισμός της θέσης και κίνηση του tracker. Όταν το Elevation βρεθεί ίσο με μηδέν ή μικρότερο, που σημαίνει ότι ο ήλιος έχει δύσει, το tracker αυτόματα έρχεται σε οριζόντια θέση και μένει εκεί όλο το βράδυ μέχρι την ανατολή του ηλίου.

The mechanical construction is done from an old fence that was removed. I bet it can hold one real panel for sure or maybe two. the piece of wood i put on has about the same weight of a real panel. The linear actuators are from hospital beds so they can support more than 100Kgr each. I suppose a mechanic must design a construction that is correct for the job, depending of how many panels are gone placed on.

Όσο για την μηχανολογική κατασκευή, μπορώ να πω ότι δεν είναι και ότι καλύτερο, αφού έγινε με πεταμένα σίδερα από παλιό φράχτη, χωρίς την απαραίτητη μηχανολογική μελέτη. Παρόλα αυτά εξυπηρετεί άψογα τον σκοπό της και κρατάει άνετα το βάρος μιας κόντρα πλακέ που έχει περίπου το ίδιο βάρος με ένα φωτοβολταϊκό panel. Τα μοτέρ πάντως (linear actuators) αντέχουν αρκετό βάρος, μπορεί και πάνω από 100Kgr το καθένα, αφού προέρχονται από κινούμενα κρεβάτια σχεδιασμένα προφανώς να αντέχουν το ανθρώπινο βάρος.



Schematics here.
Σχέδια εδώ.

Code for Arduino here. (some comments are in Greek language, Sorry...)
Ο κώδικας για το Arduino εδώ.


The "Timer.h" library is here.
Την βιβλιοθηκη "Timer.h" θα την βρείτε εδώ.

Code for  VB here.

Ο κώδικας για την VB εδώ.

Thank you for your time, don't hesitate to ask or suggest anything.
Ευχαριστώ για τον χρόνο σας, μη διστάσετε να ρωτήσετε ή να προτείνετε κάτι.


Don't forget to visit my YouTube channel here to check out my other Arduino videos.
Μπορείτε να δείτε τα υπόλοιπα Arduino Projects μου στο κανάλι μου στο YouTube εδώ.    

Kostas Kokoras

NOTICE : Use all information in this page (hardware, schematics, Arduino Code, etc) in your own risk. 


ΠΡΟΣΟΧΗ: Η χρήση των πληροφοριών που παρέχονται σε αυτή την σελίδα (μηχανικά, ηλεκτρονικά σχέδια, πρόγραμμα Arduino, κ.α.) γίνεται αποκλειστικά με δικιά σας ευθύνη.

12 comments:

  1. Dear Kostas Kokoras

    great job! Question for T1. -> Is BC107 OK and in linear actuator are not already limit switch build in?

    Thanks

    ReplyDelete
    Replies
    1. Q1 and Q2 is 2N3904. But i guess any common general purpose transistor will be ok.
      Yes the linear actuator has built in limit switches, but you need the externals limit switches to control how far the whole frame will move.

      Delete
    2. I can set the maximum and minimum length of my linear actuator with the limit switch. I use cosine law to get the degree or length i need. maybe you can also set it.

      Delete
  2. hye, can I get the full circuit design. tq in advance :)

    ReplyDelete
  3. Dear Kostas, Happy New Year end Christmas to you. This project like me. Questions: in code you define limits_led A0 but in picture Arduino output Pin A1, what is true? Did you do Recommended Layout for Crystal? What capacitors to crystal did you added? Thank you.

    ReplyDelete
  4. Great job Kostas!

    Gil
    San Diego, CA

    ReplyDelete
  5. Do you have the schematic for the sensors set up?

    ReplyDelete
  6. can you please send me the program and the setup?

    Runlud@gmail.com

    ReplyDelete
  7. that's awesome sir, but i still doesn't understand yet with the Potentiometer Schematic about Arduino input pin 2 (Elevation) and Arduino input pin 3 (Azimuth), what it's mean? why there's 2 input in 1 potentio?

    ReplyDelete
  8. would you send me the schematic full sir? im so confuse with the step, please

    ReplyDelete
  9. Where can i find the software for Ardoino?
    Please Mail me runlud@gmail.com

    ReplyDelete