Hello, I'm an art student and have to design a work based on Arduino. My idea is to build a robot, who's system is activated by light and halts when it's dark. My logic is that I can achieve this with an LDR, but I quickly ran into a problem there: I need a code for that and can't find any hints on the internet how to program the LDR as the power source so that everything stops when no light is detected/powers up under a light source. Is my idea even possible? Does anyone have any ideas/ leads? I'm thankful for any input!
An LDR is a sensor, not a power source.
When LDR readings collected by the Arduino indicate darkness, the Arduino should use relays or transistor switches to shut down equipment, possibly including itself.
The Arduino Cookbook is a good place to start. Start at page 1 and read every page and build every project. By the end you will know where to start your robot.
Search "arduino LDR relay" and you will find many online.
Found something that might work, thank you!
You can practice your Arduino coding with hardware in this free web site...
Not with an LDR but with a solar cell it would be possible.