Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

solar tracker with LDR and PIC16F877A

Status
Not open for further replies.

kokwah520

Newbie level 5
Joined
Jun 3, 2011
Messages
8
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,399
i would like to design a solar tracker control by PIC 16F877A, the input is 4 LDR for left, right, up and down, output is the servo motor...
the design basically is when the light is spot on 4 LDR, sure have different intensity of the light, then the motor need to move to the high light intensity side.
but the problem i facing is i do not know how to compare the LDR and send the input to PIC to control the motor?
there is some suggestion which is using comparator to compare the LDR which left with right and up with down part compared, but i do not know how to connected and i got no idea on how to compare the LDR light intensity, anyone can please tell what i need to do in order to solve this problem, please...
 

LDR changes the status to high or low and it is reflected in port pin you connected... so start polling one LDR and when light falls on it then rotate the motor to turn the panel... and wait for other LDR to be illuminated.. the port pin status will change.. then rotate... do like this for all the 4 LDR and rotate it back to original position,,,,,
 
  • Like
Reactions: pomcoe

    pomcoe

    Points: 2
    Helpful Answer Positive Rating
I drew a voltage comparator circuit for you
This is so called window comparator

Another way is connect LDR with series resistor to supply and
check LDR voltage with ADC in PIC
or use LDR voltage connected to PIC input pin

View attachment LDR_Window comparator_01.pdf

Regards KAK
 
  • Like
Reactions: pomcoe

    pomcoe

    Points: 2
    Helpful Answer Positive Rating
thanks for the help...
to ckshivaram: i not understand what are u trying to say but what i need is compare 4 LDR together which is left with right, up with down... not triggering 1 by 1 is light spot on 4 LRD together and need to move towards to the high light intensity side...

to kak: my groupmate request me to ask u whether the circuit test before? because this morning we do a lot of test and it do not work because most of the test are not tested before.... but i really thanks for your help and u are really so kind... i truly appreciate it....
 
  • Like
Reactions: pomcoe

    pomcoe

    Points: 2
    Helpful Answer Positive Rating
This circuit i drew for you is well known and used in many devices.
I have personally used similar circuits in my industrial projects without problems.
( setting limits for movements and level controls )

**broken link removed**

https://www.aldinc.com/pdf/cd_23002.0.pdf

look links there too : other related circuits

Try google more................. ( window comparator )

Im sure you get it working , when you calculate voltage dividers for
operating points correct.

Regards KAK
 
Last edited:
for the circuit diagram u drew..

can u tell me wats does 'set window' mean?
and wats the suitable value range for R5 and R7..

ty..
 

to kak: my groupmate request me to ask u whether the circuit test before? because this morning we do a lot of test and it do not work because most of the test are not tested before.... but i really thanks for your help and u are really so kind... i truly appreciate it....

The problem may not be electronic. Can you share your mechanical design with us? Are you using a shadow vane (gnomon)?

Here are two links you may find useful. The first is just one example of may commercial commercial devices. You can see how it solved the need for a shadow. The second (**broken link removed** ) gives DIY instructions, including circuits. Note especially the use of comparators in Solar Tracker 3 and Solar Tracker 4 .

If you are trying to maximize intensity only, how are you going to correct for clouds?

John
 

The 877A has 8 analog inputs, you could just use four potential dividers with one LDR and one resistor in each then measure the voltage through the ADC. You can make comparisons of the measurements in software and if necessary also provide time filtering to overcome short fluctuations from cloud cover and other light level disturbances. The outcome of the comparison will tell you which LDR has most and least light falling on it so you can control the motor accordingly. Beware that LDRs are not precision made and you should expect mismatched results from them at different light intensity, you can again compensate for this in software if necessary.

I have doubt about using 4 LDRs though. The E-W position of the Sun is determined mostly by the rotation of the Earth and is farly constant so a simple slow motion drive system may be more economical to use. Bear in mind that at night all the LDRs would indicate the same level so the tracker would think it was on target and fail to move back to the morning start position. If you have to incorporate a clock to tell it when to return to start you may as well use it to set the E-W position as well. There is some benefit in using an elevation tracker but it depends on where on Earth you are, positioning the tracker elevation half way between seasonal low and high elevations will only lose a small amount of power, even when most off target.

Brian.
 

my project will only be experimented in a room instead of under the sky... i will be using torch light..my project is not as complex as u think

basically, my project is like: start from comparing the LDR(which is my biggest problem at the moment on how to compare them,x1 compare with x2, y1 with y2), then send the signal to PIC16F877A, then to driver L293D to drive the servo motor.

my model will be something like this:
YouTube - ‪Solaruino, just a simple solar tracking project with the arduino duemilanove‬‏

anyhow, i really appreciate help of u all... thanks a lot....

---------- Post added at 13:03 ---------- Previous post was at 12:40 ----------

betwixt : as u say, we can use software to make the comparison, but we do not know how to make it? what software we need to use? and how we make the compare? we only learn some basic on assembly language and C language in mplab ide, are u using the same software?
can u please teach us? thanks a lot....

---------- Post added at 13:32 ---------- Previous post was at 13:03 ----------

betwixt : as u say, we can use software to make the comparison, but we do not know how to make it? what software we need to use? and how we make the compare? we only learn some basic on assembly language and C language in mplab ide, are u using the same software?
can u please teach us? thanks a lot....

---------- Post added at 14:18 ---------- Previous post was at 13:32 ----------

betwixt : as u say, we can use software to make the comparison, but we do not know how to make it? what software we need to use? and how we make the compare? we only learn some basic on assembly language and C language in mplab ide, are u using the same software?
can u please teach us? thanks a lot....

---------- Post added at 14:48 ---------- Previous post was at 14:18 ----------

i have try the circuit that u send to me, but it not working as the both led also turn on....
i think most properly is the value of the resistor cause this problem, i have using 5 k resistor for the set window and 4.7 k for pull up resistor, is this value correct

---------- Post added at 14:51 ---------- Previous post was at 14:48 ----------

kak111: i have try the circuit that u send to me, but it not working as the both led also turn on....
i think most properly is the value of the resistor cause this problem, i have using 5 k resistor for the set window and 4.7 k for pull up resistor, is this value correct

---------- Post added at 15:42 ---------- Previous post was at 14:51 ----------

kak111: i'm so sorry, the circuit is working, thanks for the help.... we have adjust the value of the resistor.... really thanks a lot... ^^
 

To make the comparison is easy. Just read the analog inputs and subtract one horizontal LDR reading from the other. The result will be either positive, zero or negative. Zero means you are on target, positive means shift one direction and negative the other. Do the same for the other two LDR to get the result for the other axis.

Brian.
 

see the code its written in MicroC.. very simple and working one...........
 

Attachments

  • solar tracking using pic.rar
    41.9 KB · Views: 548
kak111:may i know what is the purpose of set up window, pull up resistor and R5 & R7? i need to explain in my thesis.....
 

Look attached file..............


**broken link removed**

in this circuit you see voltage divider chain R1, R2 and R3
as you see it gives reference points to comparators (Vref1 and Vref2)
lower left graph.picture.

If we give R2 larger value moves Vref2 higher and Vref1 lower
ie. so called window becomes wider.
and give R2 smaller value , window is narrower

In my picture R1, R2, R3 >>>>> R5, R6, R7

Hope this helps.

KAK
 

can i get the coding for yours project. actually my project using 7 ldr.. i want use your coding for reference..
thx
hope asap
 

google pinguino on net. it is a usb programmable open source micro system like arduino.
connect LDRs to analog input pins with suitable resistors on top. read values and activate output to drive servos. i think this may help

thanks for suggesting a good application
 
  • Like
Reactions: pomcoe

    pomcoe

    Points: 2
    Helpful Answer Positive Rating
i m doing a project on solar tracking system using mppt and using pic16F877A.we had doubt that how many LDR (light dependent resistor)are supposed to be used and where it has to be placed according to intensity of sun light please give some ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top