I want to find the light source and measure its brightness with any other light source ( making comparison that which light source is more bright ) and then measure distance between my robot and the light source. After that I want my robot to move to the light source.
Thus, what kind of sensors do I need for such a project ? I know that I need a photo resistor but I don't know how to measure the brightness of light source to make comparison and measure the distance between my robot and the light source itself; so my robot can move that brightness light source. I cannot find solid info about this topic in the internet, the way I want. I will very happy if someone guide me then I can use it as a reference, thank you very much.
You will need a very sensitive and precise light sensor. Light intensity drops inversely to the square of distance, it is not linear, and this means your sensor must have a very wide range of intensities that it can distinguish. This makes a circuit with a photo-transistor or light dependant resistor difficult to make as a beginner because you will need amplifier circuits and noise will be difficult to manage. The Arduino's analog inputs may not be precise enough to give good enough results for what you want to achieve.
I have a suggestion. Try a bh1750 light sensor module. A very accurate and sensitive sensor with a more precise analog to digital converter built-in. Perhaps that will be good enough.
PaulRB:
You will need a very sensitive and precise light sensor. Light intensity drops inversely to the square of distance, it is not linear, and this means your sensor must have a very wide range of intensities that it can distinguish. This makes a circuit with a photo-transistor or light dependant resistor difficult to make as a beginner because you will need amplifier circuits and noise will be difficult to manage. The Arduino's analog inputs may not be precise enough to give good enough results for what you want to achieve.
I have a suggestion. Try a bh1750 light sensor module. A very accurate and sensitive sensor with a more precise analog to digital converter built-in. Perhaps that will be good enough.
When I use this sensor, I don't need an extra sensor to add to measure the distance between the robot and the light source itself ( such as, with ultrasonic sensor ), right ?
You may be able to measure the distance by the intensity of the light. If the light source is fixed, you can calibrate the sensor at a known distance. After that, you can calculate the distance using the 1/(r^2) rule. When you double the distance, the reading will drop to 25% of the previous reading. For example, if you place the sensor 100mm from the light source, perhaps the sensor reading will be 40000. From that, you know that the reading would be 10000 at 200mm, 2500 at 400mm, 625 at 800mm and so on.
a sensitive and precise light sensor. Look at the TSL2591, it has a great range, it goes from bright sunlight to dim indoor lighting. I don't know the BH1750.
very narrow field of vision: you don't want ambient light (or the other light source) to mess up your measurements.
a means of aiming the sensor at the light source (this is a tough one, and you'll have to do a lot of scanning of the surroundings to even find your two light sources).
Or:
a sensitive camera with proper image recognition software (and something way more powerful than an Arduino).
For distance, indeed it may work with intensity, otherwise you need two light sensors, and measure the angle at which they see the light source.
Light seeking robots date back to the 1960s, and there are many very simple ways to make them. Your approach is very difficult, but would probably be a good learning experience.
I recommend going to the local library and borrow a copy of the 1987 issue of Scientific American, March 256 which features a fantastic article by A. K. Dewdney, "Computer Recreations - Braitenberg Memoires: Vehicles for Probing Behavior". Also on line for $$ at https://www.scientificamerican.com
Overview at Braitenberg vehicle - Wikipedia
Also see this great early article by W. Grey Walter Imitation life: light seeking tortoises.
Google "BEAM phototropes" for some simple circuits that don't even need a microprocessor. Basically they consist of a couple of LDRs and motor drivers. Some articles are at Solarbotics.
I checked the TSL2591 and bh1750 comparison as read this discussion in this link Which LUX sensor - Let's Control It, and TSL2591 is like upgraded version of bh1750 and with more features. One person there said that bh1750 can share the SCL and SDA pins at the same time with another module too; but I don't know how much is it true. We should check TSL2591 too.
I want to use lcd screen too but lcd screen, TSL2591 and bh1750 are using the same SCL and SDA pins at Arduino.
If I connect the lcd screen's and "TSL2591 / bh1750"s SCL and SDA pins as shared, thy work with each other ?
I ordered these two modules and I will get them soon then I will try myself too.
I made some deep research and to find the light source's exact direction with TSL2591 and bh1750 modules is kind of hard and it is very hard to compare two different light source to get the bright one and make robot to go for it. I think that I asked sth very hard to accomplish; but I will try to apply the PaulRB's suggestion at above comment.
Note:
Would you suggest me a nice lcd screen and lcd library that is working nicely with easily to use on arduino too please ? I was bought this lcd from amazon long time ago https://www.amazon.co.uk/gp/product/B01GPUMP9C/ref=oh_aui_detailpage_o08_s00?ie=UTF8&psc=1 then I wanted to use it again after one year and it was really hard to find the correct library and the sample code.
I ordered the components, once thy come I will try myself and then update this post again. I really enjoyed to read this Braitenberg vehicle the most, it was very educational.
What about SCL and SDA pins I mentioned in my comment to share these two pins at the same time with two different modules ? As some people experimented as using x2 bh1750 but is it possible to use the lcd screen at the same time too ? thank you.