Instructables


The Just-For-Fun Sun-tracker

             using the Arduino and two servos.


        This device, along the lines of the most useless toy, is not so much for function as it is for fun. But as with many things, you can't spell function without fun! This could easily be modified to rotate solar panels into the right position for the best solar power absorption.

       Ingredients:

  • An Imperial short ton of cardboard!
  • Arduino
    • I used the awesome Freeduino (ATmega 328)
  • A breadboard
  • 2 Servos - The kind/company doesn't matter terribly, you’ll just have to change the code a little if it’s too different
  • A lot of wire, almost as much as the cardboard
  • Some sheets of paper, any kind will do 
  • A knife, preferably a box-cutter - you’ll be cutting a lot of cardboard!
    • I used: This One
    • Also, be careful! Don't cut yourself as I have done
  • Circular drawing tool – Either a compass, Tupperware, or a ball and cup
  • Hot glue gun – Though you can use nuts/bolts, glue is much easier
  • Silly putty, presstick, or sticky tack 
  • Some nuts, bolts and washers. Depending on how much glue you want to use.


 
Remove these adsRemove these ads by Signing Up

Step 1: The Sensor Array

PC080091.JPG
PC080093.JPG
PC080097.JPG
PC080100.JPG
PC080101.JPG

For this part you will need:
  • 5 Sheets of paper
  • 5 Photo-Resisitors
  • 5 Pieces of putty / presstick / sticky tack
  • Compass / Protractor
  • Scissors / Knife
  • Wire / Strippers / Cutters

   - The sensors are positioned to form a cross to allow sensing in the x and y axis. It is possible to do this with as few as 3, but photoristors are so cheap that an extra 2 won't bust the bank. These sensors will sit inside cones to reduce the light that isn't shining directly at the resistors, thus making the sensing a lot more accurate.

   - To make a cone, you must take your trusty compass or any other circle transfer tool and make a perfect circle on one of the sheets of paper. The size of the circle will adjust the accuracy and contrast of the photo-resistors; bigger circles will result in bigger cones, stopping indirect light more.
   - Next, take your scissors/knife and cut out the circle you drew. Once you have the circle cut out, cut a line straight from the outside edge of the circle to its exact centre.

   - At this point you may either opt to cut a small circle out of the middle (to leave a hole at the bottom of the cone) or you can leave it uncut, in which case you will be poking holes in the paper for the leads of the photoristors. (as i have done)
   
   - Now you need to take the circles and turn them into cones!  All you do is take the ends of the circle (where you cut the straight line) and move them into each other. Rotate further to tighten the cone, I find a 30 degree opening to be best.

   - After you have your cones. Take some of the putty/sticky tack and roll it into a tiny cone shapes, this will sit at the bottom of your cones and hold your photorestors in place and they should be smaller than the length of the leads on the photorestors. Once you have all your sticky tack cones, take your photorestors and get the leads through the putty/sticky tack. The leads should poke out of the bottom about half a finger's width or more.

   - All that's left is to get your putty & resistor combo into your cone. Poke holes for the leads if you need to; though they tend to be soft, so use a sharp tool, like the one end of your compass.
   - You can now opt to stick the cones together like I have, or simply leave them loose if you plan on cutting individual mounting holes for the cones.

   - All that need to be done now is to wire the suckers. Remember to use long enough wires for this part, you can always cut them shorter, but you can never grow them back!
   - Take one lead from each of the pins and either solder them straight to wires, in which case you will have to remove them from the cones or risk losing an eyebrow, or do what I did, and solder wires to some female to male pins and then you can just plug the leads into them!
   - It helps at this point to think about where the other wires will be going on the breadboard. They need to be lined up on the breadboard from left to right C.R.L.U.D. (Centre Right Left Up Down). As with the other leads, solder them directly on to the wire or make the plugs.
syspacman11 months ago
can yo send me the .txt file whit the code please?
veedo (author)  syspacman11 months ago
the code is available on the last step
infanati1 year ago
all right, I can make the program run on my arduino uno, but when I switch the board to ATtiny13V, that's when the code stops there.
infanati1 year ago
thanks again but I just cant get it to work lol .
infanati1 year ago
cool thanks, but im a noob to all this stuff lol. so I don't have a clue as to where I would add those codes.
veedo (author)  infanati1 year ago
setting your DDR# register is exactly what pinMode does.
Setting your PORT# register is the same as assigning a value. So all you need to do is figure out what pin on which port "10" hooks up to and you're golden
infanati1 year ago
for some reason when I run your code on arduino it says that the output was not declared.
Arduino.png
veedo (author)  infanati1 year ago
doing it bit by bit
DDRD = B11111110; // sets Arduino pins 1 to 7 as outputs, pin 0 as input
veedo (author)  infanati1 year ago
Your Arduino version may have changed the way inputs and outputs are handled.
You may want to look at an example program of the version you are in, or go straight to the direction registers and set them (1: Output, 0: Input)

eg.
DDRD |= 0x01 // This would set pin 0 of port D as an output
DDRB = 0x00 // This would set port B to all inputs
etc.
i got question here . why my circuit doesn't work ? what is my problem actually ? needs an urgent help hereeee !!!
meon912 years ago
I have a question. How do you power up this tracker?
veedo (author)  meon912 years ago
I used the USB power from a computer, but you could easily just use a 9V battery or two 3V. You would just need to use a regulator to bring the voltage down to 5V

You could also just get a 5V wallwart and power the arduino that way
Poesis2 years ago
Hey what's up!!! COOL PROJECT!!!!! I'm building a similar project with four photocells and different servo but can't get it to work. Maybe you can help me with the project since you clearly know what your doing =D thanks.
veedo (author)  Poesis2 years ago
hmm, I can try, do you know roughly what is wrong?
Heef3 years ago
Incred-a-cool! I want to see if I can torture a house plant with this idea! I picture a more ugly 'flower' for my sensors and something franken-steam-stein-punk skeletal structure swinging around in the window...

Nice foundation for lots of exploration, great instructable, man.
veedo (author)  Heef3 years ago
thanks! I had a lot of fun making it. Hopefully I'll start seeing some cool ideas popping up using my design :)
TOCO3 years ago
Just 1 question. Why do you buy the freeduino or other arduino clones for like 2 dollars less. If it is much cheaper where did you get yours?
veedo (author)  TOCO3 years ago
I'm busy attending an electronics engineering course, it was cheaper because it was bought in bulk (i guess)
ongara_013 years ago
DIRTY BUT GREAT:-)
veedo (author)  ongara_013 years ago
Adds to the ghettoness ;)
PKM3 years ago
I've sometimes wondered if you could combine the angle-sensing control circuitry of a servo motor with the mechanics of one of those USB missile launchers to make a two-axis tracker with a bit more power.. solar trackers are cool but they are at their best when bearing a slightly heavier load than a cardboard box.

Still, it's a nice learning/experimenting build.
veedo (author)  PKM3 years ago
The card board is Surprisingly strong, it can easily hold two small solar panels (about a forearm's length) and function properly... even better in some cases

The usb rocket launcher gives me a cool idea... whenever a shadow passes by, it can track it and then fire once it has a steady motion for that shadow in memory (and then can theoretically fire in front of the moving shadow) :p
Rob K3 years ago
Lol Digikey brand solar tracker.

Well use what you got.
bertus52x113 years ago
Cool! I see lots of applications. Still need to learn the Arduino stuff first though...!!