Do you see changing numbers on Serial monitor when you change light level on LDR?
with only the light in the room, it's around 400, but when I move the flashlight closer to ldr it reaches 1000
yes
I see 2 grey wires on GND and AREF, are you sure they are not switched?
dont have wires in aref, it was because of the angle, one is on digital port 13 and the other on gnd
The wire on 13 goes to red LED?
yes
the rx light in arduino is flashing
Because it's writing to Serial monitor.
what is going on?
Do you have a volt meter?
no, i dont have
Sorry, I'm baffled, good luck.
thanks bro
I have deleted your other cross-post @marcusgollub.
Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.
Try the following in your loop. Leave the rest of the code untouched. This should blink all LEDs sequentially. Check the wiring and the LED polarity until it works.
void loop(){
digitalWrite(led1,HIGH);
delay(500);
digitalWrite(led1,LOW);
digitalWrite(led2,HIGH);
delay(500);
digitalWrite(led2,LOW);
digitalWrite(led3,HIGH);
delay(500);
digitalWrite(led3,LOW);
}
First, you must have a DMM if you're going to do any significant electronics stuff!
So presumably you do not know the resistance of your photo transistors under the conditions you anticipate?
Ideally you should have then chosen a rough value for your voltage divider: 10k might be OK, but you won't know until you've measured the voltage at each light level you want to detect
The original post of OP (now deleted due to changing language and cross-posting), you would have seen OP was pulling and pushing wires in a live circuit, was asked for wiring diagram, to verify wiring, to verifying diode polarity, and to show the code... but OP insisted code and wiring were all correct. Have fun.
if it's not too much to ask, can you draw me a diagram? i need to hand this in at school on monday and i have no idea how to make it work
That’s almost two days to read about how to connect an LED to an Arduino and how use an LDR and do some experimenting so you can learn how this works.
I recommend you to do that. And, to turn power off before you change any wires.
There is a lot of material about the subject in the web and in this forum. It is not that complex. And it will be fun. Trust me.