I want to connect this metal detector to PIC16F877 analog pin, but don't know hot to do it. On LED there is from 1,5V to 2V voltage and 20mA current, and I need this voltage to be read by PIC16F877.
I need that microcontroller would read voltage from diode and send signals to other microcontroller.
You should design the metal detector circuit such that it gives 5V O/P by turning on a transistor when metal is inserted. If there is no metal it should give 0V o/p i.e., transistor turned off. Then you don't have to use ADC to read the analog voltage. You can use Digital i/p to read the 0v and 5v logic levels.
but i want that when voltage is growing from 1,5 to 2 V, microcontroller would light 1 LED, when voltage is 1,6, 2 LEDs when voltage is 1,7, 3 LEDs when 1,8 and so on. So I suppose I need analog input for this, right?