Author Topic: Plug'n'Play Solar Tracker  (Read 4366 times)

Bob101

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Plug'n'Play Solar Tracker
« on: October 19, 2012, 03:24:12 PM »
As mentioned in other posts I am wanting to build a portable solar tracker for use on a vehicle. As part of this I have written/need to write code to interface Gabriel's program with GPS and a compass.

My crazy idea is this:
What if the STATIC solar tracker design had a GPS+compass incorporated so that it can be set up with virtually no knowledge?

You unpack it/assemble it then you turn it on. Next thing that happens is: it aligns itself with the sun and starts tracking. You can move it to you friend's house and 10 minutes later it has automatically corrected itself. You put it in your garage for the summer, bring it back out when it get chilly, switch it on and 10 minutes later it's tracking like a gem.

What do you guys think? Do you think this would be useful?

Obviously adding a GPS+compass would add some cost to the unit ($80+ ?) but it would make setting up the unit and relocating it to another site far easier. You wouldn't even need a compass or a laptop! I think that as these projects move away from being for the technically curious towards the people that just need some renewable energy this really could be the way to go. Am I dreaming? $80 is not much to pay for no headaches, no setting timers, no orientating of units, no looking up your location and converting it to decimal, no working out your magnetic declination...


Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #1 on: October 20, 2012, 08:14:05 AM »
This is something that I might try at some point. I doubt that there is enough space on the Arduino Uno, but there should be enough on the Mega. You could almost add a second shield to the Arduino Mega which would add GPS / compass functionality if desired. The GPS would be pretty easy I think, but the compass could be tricky, although certainly not impossible. Of course, using the GPS and Compass doesn't necessarily guarantee that there won't be any headaches. The biggest worry that I would have is that the compass would be thrown off by magnetic interference, so people would still have to be educated on certain issues things I suppose.

On a side note, I have often considered just uploading the lat, long, and time through USB or XBee connection. The time could be retrieved from the user's computer (assuming that it is correct), and the lat and long could perhaps be found via the IP address. This too could have its pitfalls, but it wouldn't cost anything extra.


Bob101

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #2 on: October 20, 2012, 11:59:01 AM »
I doubt that there is enough space on the Arduino Uno, but there should be enough on the Mega.

Agree.

Quote
You could almost add a second shield to the Arduino Mega which would add GPS / compass functionality if desired. The GPS would be pretty easy I think, but the compass could be tricky, although certainly not impossible.

Also agree.

Quote
Of course, using the GPS and Compass doesn't necessarily guarantee that there won't be any headaches. The biggest worry that I would have is that the compass would be thrown off by magnetic interference, so people would still have to be educated on certain issues things I suppose.

Agree with this partly, though this could mostly be dealt with by suggesting a location on the machine to mount the compass (away from motors and iron) and giving general instructions like "Do not place the machine near sources of magnetic interference such as power lines, large iron objects (eg... garage doors or steel structures), speakers or steel vehicles (heavy equipment)"

Quote
On a side note, I have often considered just uploading the lat, long, and time through USB or XBee connection. The time could be retrieved from the user's computer (assuming that it is correct), and the lat and long could perhaps be found via the IP address. This too could have its pitfalls, but it wouldn't cost anything extra.
Although this certainly makes the setup slightly easier I really do not think this addresses the same issues. Users would still have to repeat the setup procedure from scratch each time they move the machine (with maybe the exception of time) and they would still need a compass and an understanding of the machine along with a computer to look up lat,long and declination.

I think adding USB/XBee interfacing is good idea, don't get me wrong, I just think that GPS+compass if working correctly would make setup and moving of the machine far, far easier than you ever could with even the fanciest program running on a laptop.

Paul L

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #3 on: October 22, 2012, 06:18:10 PM »
I think that having a plug and play heliostat would be the bees knees, and also feel that an extra 80$ is a price people would pay for ease of setup.  I can't fit the current version of the tracker on the Uno, so I've ordered a knockoff Mega - if you ever work on this Bob, I'd like to hear about it so maybe I could do it myself.

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #4 on: October 23, 2012, 08:55:23 AM »
Hey Paul,

What version of the program did you try to upload to the Arduino? Was it this one, SunTracker_Heliostat_Program_V097_b.zip, or did you try to upload the Mega version? The SunTracker_Heliostat_Program_V097_b.zip version uploads to my Uno with space to spare. I'm curious because someone else mentioned the same thing.


Bob101

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #5 on: October 23, 2012, 09:48:32 AM »
Please be aware of an issue with some Arduino UNOs that prevents them from accepting sketches bigger than 28674 bytes:
http://code.google.com/p/arduino/issues/detail?id=380

This is fixed in most new UNOs on sale but some are still some floating around with this problem (eg... my UNO  :P). There are ways to fix this with an ISP programmer and some even claim it's possible to do with another Arduino (http://arduino.cc/forum/index.php/topic,28733.0.html) though I haven't tried any of this.

I checked the size of SunTracker_Heliostat_Program_V097_b.zip with the current revision of Flash (Flash 4) and it is apparently 27866 bytes so it should compile fine.

I think that having a plug and play heliostat would be the bees knees, and also feel that an extra 80$ is a price people would pay for ease of setup.  I can't fit the current version of the tracker on the Uno, so I've ordered a knockoff Mega - if you ever work on this Bob, I'd like to hear about it so maybe I could do it myself.


Glad somebody likes the idea  :). As stated I am currently working on a portable solar tracker with these features. Keep an eye on various threads here and you can see the progress! Most of what I have learnt is directly applicable to static solar trackers that use GPS/Compasses.

Paul L

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #6 on: October 23, 2012, 08:27:53 PM »
Hey Gabriel and Bob,

    Yes, it was the V097_b.zip, but I have another Uno, so I'll try the method that Bob referred to in his post on the weekend and see if I can get the sketch to load.  Thanks for the heads up Bob!  Looking forward to seeing where this plug and play idea goes - keep us updated!   

Bob101

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #7 on: October 24, 2012, 01:29:20 AM »
Before you do anything note that as Gabriel said there are TWO programs on offer:

Mega_SunTracker_Heliostat_Program_V097_b.zip - this is the MEGA version of the program and will not fit on an UNO.
SunTracker_Heliostat_Program_V097_b.zip - this is the version of the program you want.

They both happen to have the version number V097_b but they are NOT the same program.

Also: my post details how the correct version of the program for the UNO should actually be small enough to fit on despite the bootloader issue. I doubt that updating your bootloader will fix this issue. It was just for general information and to save any headaches should you or Gabriel decide to increase the size of the UNO version of the program.

I will keep all updated on how my project is progressing. Busy week. I really need some spare time to devote to getting everything tested now as pretty much all the code is written in some form... just needs combining up and debugging.
« Last Edit: October 24, 2012, 01:34:08 AM by Bob101 »

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #8 on: October 24, 2012, 06:50:18 AM »
Please be aware of an issue with some Arduino UNOs that prevents them from accepting sketches bigger than 28674 bytes:
http://code.google.com/p/arduino/issues/detail?id=380


Gah, that's not cool. I'm sure that I could comment some things to make the program fit on any of the Uno boards, but that could just make it more confusing to people if they have to pick from several different programs to get whatever combination of features that they need. It's still a possibility though.


Bob101

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #9 on: October 24, 2012, 09:40:47 AM »
Your sketch is currently 27866 bytes, that's less than the 28674 bytes available even with the bug. Provided you don't add anything that increases the size of your sketch all should be good.

Remember that the UNO is a dying beast now... Leonardo and Due are out!

Paul L

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Plug'n'play
« Reply #10 on: October 26, 2012, 09:49:01 AM »
My apologies, I was trying to upload the newest version of the sketch - SunTracker_Heliostat_Program_V097_c2, which weighs in at 30426 bytes, hence my memory problem.  I did try the V092_b2 sketch and it does in fact fit on the board.

Sorry for hijacking this thread!  More Plug'n'Play talk!!   ;D

Update: Bootloader problem fixed using 2nd Arduino.  Sketch fits now!  Thanks!
« Last Edit: October 26, 2012, 11:58:07 PM by Paul L »

Bob101

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Plug'n'Play Solar Tracker
« Reply #11 on: October 27, 2012, 07:44:20 AM »
Ahh, much confusion. I forgot about SunTracker_Heliostat_Program_V097_c2. This all makes sense now and in fact the error reported immediately after Gabriel posted this version of the sketch is due to the bootloader issue (as the poster mentioned).

Not too much progress to report on the Plug'n'Play front at this moment in time. I am still waiting for a good moment to combine up my GPS/Compass and Mega SunTracker code. Might well wait for Gabriel to implement the changes I made to that sketch before continuing as I have a few other unrelated things on the go at the moment!

More to come soon.... (hopefully)

I was recently playing around with a compass though:
Just played about with our friend the Pololu LSM303DLH Compass. Without calibration I simply measured the x,y and z magnetic field strength and plotted them on a 3D graph. I then moved the unit around in as many directions as I could contort myself and repeated. An ideal compass in a static magnetic field (such as that created by the earth's magnetic field) would trace out a perfect sphere.

Here's what we get:

(axes are magnetic field strength in arbitrary units in the Cartesian x,y,z direction)

Our sphere is a little bit rugby ball shaped but I don't think we can complain too much. I can't see any horrendous outliers either so I think the compass might be reasonably reliable.

Will calibrate to correct the aberration. We really need to compare to a good quality digital or analogue compass and experiment with the effect caused by nearby ferrous materials.
« Last Edit: October 27, 2012, 07:46:58 AM by Bob101 »