Im sensing the lights with 2 LDRs and using them as an ADC inputs to PIC 16F876A
the code should see the difference and gives an order to DC motor to move
right now my code is fine the only problem I have now that the LDRs read different readings but there is no output from the pic.
without the ldrs, when I put different voltages instead of them I get an outout from the pic
that means there is a problem in the LDR circuit right? how can I solve it?
And what voltage might the arrow be? Hopefully 5Vdc
Put the scope on it and see what is going on. You may not have any voltage at all on the A0 -A1 points depending of the LDR you are using and the ambient light.
And what voltage might the arrow be? Hopefully 5Vdc
Put the scope on it and see what is going on. You may not have any voltage at all on the A0 -A1 points depending of the LDR you are using and the ambient light.
Have you measured the light / dark resistance of your LDRs? You have a LDR in series with a pot (0 to 10K) so you have little more than a voltage divider correct? The pot is known so I would measure the light & dark LDR resistances.
Have you measured the light / dark resistance of your LDRs? You have a LDR in series with a pot (0 to 10K) so you have little more than a voltage divider correct? The pot is known so I would measure the light & dark LDR resistances.
Im not sure if I got you right
what I did is I measured LDRs resistans using ohm meter
LDR1=5k ohm and LDR2=11.3Kohm and Im Connecting variable resisters both=10k
the LDRs are connected as shown in my first post
Meaning measure each LDR out of circuit and note the Light and Dark resistance. The LDR covered is Dark and with plenty of light striking it is Light resistance. If both LDRs are the same type their light & dark resistances should be about the same.
OK, if LDR1 for example is 5K with light striking it and your pot (10K pot) is set about midrange (5K) and V is 5 Volts you should see about 2.5 volts Vout. You would have basically a resistor voltage divider of 5K and 5K in series. This assumes open circuit (not connected to your PIC chip). You are seeing pretty low voltages which would lead me to believe something is loading your Vout. Disconnect your Vout from the PIC and measure the voltages.
your o/p voltages seem too low.Measure LDR's light and dark resistance and then set your POT resistance accordingly.So that you'll get sufficient analogue voltages.
well, I measured LDRs light resistans using ohm meter
LDR1=5k ohm and LDR2=11.3Kohm
for now Im Connecting variable resisters both=10k
what I understood from you now is that the 10k is fine for LDR=5k but the other LDR=11.3k should be connected to bigger value
did I got you right???
What I suggested was to disconnect the LDRs and their series resistors from your PIC and measure your Vout. The Vout voltages you posted earlier are way too low. Something about all of this just isn't right. I also asked if these are supposed to be the same make and model of LDR? If you have a 5 K resistance LDR with light and set the pot for about 5 K you should see a Vout of about 2.5 volts.
What I suggested was to disconnect the LDRs and their series resistors from your PIC and measure your Vout. The Vout voltages you posted earlier are way too low. Something about all of this just isn't right. I also asked if these are supposed to be the same make and model of LDR? If you have a 5 K resistance LDR with light and set the pot for about 5 K you should see a Vout of about 2.5 volts.
Then something is very wrong. You have an LDR with a light resistance of about 5 K Ohm so you have what amounts to a 5 K resistor. If you set your pot to about 5 K Ohm you have two 5 K ohm resistors in series with 5 volts applied. This is a voltage divider ans if we assume the 5 volts is 5 volts constant and you measure in the middle between the LDR and the pot you should have about 2.5 volts. That is all there is to it. It doesn't get any simpler. I don't know what to tell you or suggest at this point. Maybe someone else has a thought?