Selecting best sensor to control actuators from Arduino Uno

If the objective is to create a routine that will move the panel to a ‘flat’ orientation when the wind gets up to a certain value (which is what your post seems to imply) then tracking the sun has no relevance to the task.

I assume that “flat” means aligned with the frame, whatever the frame’s orientation in space is. In that case limit switches seem the obvious and simple way to go, and it’s not clear why you are not pursuing that path. If “Flat” means parallel to the ground in two planes then the accelerometer/gyro sensor is the appropriate device.

LDRs and so on are useful for moving the panel to track the sun, but that part of the control system would be deactivated when the system detects that it needs to move the panel to the flat position.

1 Like

Hi John

I wouldn’t believe it either. I was always taught the sun is directly overhead at the Tropic of Capricorn, (a couple of days ago I think) you are a few degrees south of that. Know the feeling though, I lived in PNG for a while and the sun is south at noon for almost half the year, most confusing. But in theory anyway your panel is always going to slope to the North.

What I meant here was a Real Time Clock. The time would tell you which way the panel had to move. Actual time does not matter, before or after noon is all you need. It won’t be exactly noon but you will have to work that out for yourself by knowing your longitude if you need to be that precise.

Not if you use 2 switches, one either side, arranged so both are off in the centre position. If the panel is off centre only one will be on. That will tell you which way the panel has to go. I still say the elevation system will always point north so you will only have to move one way. I don’t think Physics has changed much since I went to school.

I just noticed Jeff’s post. He is correct in saying that to park the panels the sun tracking system has to be disabled. I thought that would have been fairly obvious.

Edit to previous post.
I quoted ADC numbers of 255. Please amend to 512 (another senior moment).

I have been basing my suggestions around a Zero seeking system which to me is the simplest. Try to get a handle on it as this can be very useful in all sorts of applications. Used to be analog amplifiers but I think in the digital age is much easier. The means of obtaining this “Zero” I outlined previously, just change all reference to “255” to “512”.

I really don’t see the need to know exactly where the panel is facing as long as it is facing the sun. If you were aiming a telescope yes but for your application ???

When you said the sun was south how far down to the horizon was it. If you used a magnetic compass (or even a phone) there is a thing called “magnetic variation”. I don’t know how much this is where you live but here on the Central Coast of NSW it id 11.something degrees. Enough to indicate the sun could be a bit south early morning if I were at your Latitude
Cheers Bob.

1 Like

That idea with the switches works. “if switch a = on, tilt left, else tilt right”. Thanks - I’ll add that to the pot. Thanks.

Almost all of the code is nested inside an if-else statement that defaults to checking the wind.
If the wind is high: stow the panel and wait. After wait, test wind. If wind = high, wait, retest wind.
Else resume tracking. etc.

The comment about the orientation of the sun to the south isn’t important to the tracker, it will follow it easily. The difference is only a few degrees. But being about four degrees south of the Tropic of Capricorn, I was very surprised to have to tilt the panel a few degrees toward the south during the morning and afternoon. At midday yesterday, the sun was almost overhead.
(There have been many tennis-ball models of the Earth and Sun in my house this week!)
Anyhoo, not important to the project, just an observation that I wasn’t expecting to see!

I haven’t used a compass at any point - the centre of the platform base faces due north (T) and everything rotates about it. There is plenty of scope in the actuators to cover minor inaccuracies of base placement.

Got the note about 512 - thanks again.

1 Like

Hi Jeff,
You are right, the code tests for the wind strength, and if it is high, will move the panel to the fully horizontal plane. x=0, y=0.
The wind testing part of the code is okay. My problem was to determine which way to push the actuators, as I didn’t have a way (by virtue of my very limited experience) to detect their current positions.
I looked into tilt switches, then, following some suggestions magnetometers and IMUs. None of which I have any experience with.
The idea of limit switches was considered, but I hadn’t thought that through very well. I have had some great suggestions in this post though, and do have a good use for them, but I agree, using the X and Y sensors of an accelerator will give me a precision that is not based on time, orientation, or daylight or darkness levels. There may be other and even better options, but this seems to be leading the field.
It is also easy for me to code - a very important factor in my choice.
Thanks for your help.

1 Like

Imagine yourself just north of the Antarctic circle. In midsummer the sun is above the horizon nearly all day, so it would rise just to the E of S, pass through E, N and W, and set for a few moments just to the W of S. That’s an extreme case, but the principle is the same for any latitude.

1 Like

That is a very useful image - thanks!

1 Like

May like to consider reed-switches rather than micro-switches?

Hi Peter, I decided on using an accelerometer in the end as it would enable me to find an actual position with regard to horizontal and vertical.
Thanks for the suggestion though.