solar tracker using RTC

AWOL, sounds good to me, what size did it compile down to if you have the figures handy?
PS, I like that slight hint of yours about 'want to'

I just compiled it for a Linux box for speed of testing and simplified I/O, so the size is irrelevant, I'm afraid (FWIW it's a 36kB executable on a Xeon W3530).
Accuracy should be maintained for an Arduino, though.
At the moment, I don't have the time to go through and move the tables to PROGMEM for AVR, but I'm pretty certain it would work as-is on a Due (64 bit doubles - yay!)

AMPS-N:
whole idea is i wanna do with cheaper solution , I wanna use only rtc, linear actuator and arduino board for the project.
If i am using above component is it possible to it??
if yes how can i do it??
how can calculate sun elevation angle??
i don't have any sensor to locate and control the position.

Obviously, it is possible to do it, but it isn't advisable. What you are talking about is altitude but, if you are only going to control one axis, you will be better off putting the device on an equatorial mount and controlling the azimuth. I have already told you where the calculations are but, when I said what I said about a lookup table, I didn't realise it would be so compact, and I think you would be better off trawling for an on-line service, or a freebie programme that can provide the data for same, thereby saving you from calculating anything.

Update:
The SPA source compiles for the Due (64 bit doubles) and produces correct results.
The size of the main tables comes to 17532 bytes, so even halved for 32 bit floats won't fit in RAM on a Mega.
It compiles, but doesn't run (see above), on a Mega, with a sketch size of 29K, so I'd be surprised if it squeezed into a Uno, even with the tables in ROM.
A challenge.
I'm on it. :slight_smile:

How accurately are we trying to track the sun's position? Some of the solutions being discussed seem to be aimed at very high accuracy indeed - which might be justified if we're trying to aim a telescope but would be ridiculously over the top if we're just trying to point a solar panel in the right general direction.

PeterH:
How accurately are we trying to track the sun's position? Some of the solutions being discussed seem to be aimed at very high accuracy indeed - which might be justified if we're trying to aim a telescope but would be ridiculously over the top if we're just trying to point a solar panel in the right general direction.

Indeed, and so absurdly so that a lust for intellectual exercise by the ignorant is the only explanation. At this 1x magnification, an astronomer would be seeing it as so trivial it is a potential use for that old iron frame falling weight siderial clock gathering dust in the attic. The Arduino/RTC/linear actuator could then be used just to lift the weight at midnight. No calculations needed - probably.

but would be ridiculously over the top if we're just trying to point a solar panel in the right general direction.

Couldn't agree more.
See earlier discussions regarding H-bridges, heliotropes and CdS LDRs.

Can some one guideline how can i calculate the sun elevation angle.
please share me link if possible.

if someone has already achieved using RTC share code.

How accurately are you trying to calculate it?

AMPS-N:
Can some one guideline how can i calculate the sun elevation angle.
please share me link if possible.

if someone has already achieved using RTC share code.

You will probably get all you want from the Cerebral Meltdown forum. It seems to specialise in this sort of thing.

Have you tried copying the code you linked to at Solar Position Algorithm (SPA) and changing all instances of 'double' to 'float'?

[EDIT: as AWOL says, you don't need to change 'double' to float, however on the Arduino I believe they are both the same i.e. 32 bits.]

You don't need to change doubles to floats. I only did it because I used a platform where doubles are 64 bit, and I wanted to compare performance.
It works fine on a Due, but as-is, uses too much RAM for a Mega.

Hello All,
I am relatively new to the arduino.. I am currently pursuing a solar tracker as a project for my final year of engineering...
It is a single axis system..
We am planning on having 2 systems for tracking

  1. this is based on the solar position algorithm(SPA) released by NREL
  2. A system based on 2 LDR's
    As it is single axis all i need is the sun's elevation angle.
    I plan on using the arduino DUE and i wanted to know if the DUE would be able to handle SPA code by NREL ??
    Also as ours is a concentrator based system the dish is large and what sort of drive should i use for the DC motor ??
    Any help would be much appreciated.
    Thank you.

i wanted to know if the DUE would be able to handle SPA code by NREL ??

Have you read this thread?
(give your keyboard a shake - your question-mark key looks like it is sticky)

That code has a number of large arrays of constants, but only uses small arrays of variables. I think even a standard Arduino could handle it if you move the tables of constants to PROGMEM.

Not so sure about that - there are also some large variable arrays, too much even for a Mega.
The advantage of the Due is that it maintains 64 bit doubles.

AWOL:
Not so sure about that - there are also some large variable arrays, too much even for a Mega.

Can you point out where in the code those arrays are? I'm sure you're right, but I only found variable arrays with ~6 elements.

I'm sorry - I think you're right, it may well be possible.
I did start to look at moving them to ROM on a Mega, then remembered Massimo had kindly given me a Due, which also made verification easier.

thank you.
the DUE has an ARM core and the controller it uses is the AT91SAM3X8E.
As per the data sheet the above controller has a real time clock so i wanted to use this on board rtc with the SPA program.
I will fix the latitude and longitude the program must be able to get the date and time from the rtc on a regular basis for tracking purposes.
How can i do this ?

Is the RTC supported yet?
You could start there, if it isn't.