Hello everyone!
I'm working on solar tracker and now I'm testing the photoresistors.
Here is the thing: I have two photoresistors (east and west). When these ones are not connected yet to 5V, I can measure an important resistance's change following the exposure to the light. BUT when I connect them and change the luminosity, I can notice the resistance's change is not as big as before, which make my photoresistors not really sensitive anymore
(When I have a look on the serial monitor, I get max values like 8, 9 but no more, I guess I should get a value way higher between 0 and 1023 right?).
I wanted to know if you guys already face this problem? Do you think my photoresistors are just counterfeits?
Thank you for your help!
PS: in the wiring diagram i also put north sensors but i don't use it in the code for now
void setup() {
// Initialise la communication avec le PC
Serial.begin(9600);
}
// Fonction loop(), appelée continuellement en boucle tant que la carte Arduino est alimentée
void loop() {
// Mesure la tension sur la broche A0
int valeur1 = analogRead(A0);
valeur1 = analogRead(A0);
int valeur2 = analogRead(A1);
valeur2 = analogRead(A1);
// Envoi la mesure au PC pour affichage et attends 250ms
Serial.print("valeur1=");
Serial.println(valeur1);
delay(250);
Serial.print("valeur2=");
Serial.println(valeur2);
}
I do not see that the resistors are connected to ground. It seems they are 220 ohms and should be more like 10K for good readings. Also, the uppermost photoresistor is not connected to Vcc.
Same here. The diagram shows the column NET TO the one connected to the resistor is connected to Ground. The resistor and the wire to Ground should be connected to the same column of five holes.
Thanks for your first answers.
Actually I used Fritzing for the wiring diagram and for some reasons they don't have 10 kOhms in their library (that's why i put 220 Ohms in the diagram) but I do confirm I use 10 kOhms in my electrical wiring.
I changed the wiring as you said (see the joined diagram) but still I only have max 8 or 9 (I noticed the voltage is around 5.06V at the terminals of the LDR - normal light - maybe this out of the range 0 - 5 V is the cause of that?)
Regards
Hey, I come back to you guys!
Turned out my wiring diagram was ok. I just decided to disconnect my arduino board from the arduino motor shield (you know when all pins are connected, doing a stack with motorshield upwards and arduino board down) and connect only the pins necessary (direction, brake, power, ground and 5V). Now I get normal values between 0 and 1023, making the LDR more sensitive!
Anyway, Thank you for your help !