As i mentioned the digitalRead on input pin is not work properly it seems to be randomly changes from LOW and HIGH and the input pin is connected to a voltage source 2v from small dc generator which driven by a dc motor.
"Actually I don't need to measure the value."
Actually, you DO , if you expect to troubleshoot the problem. How are WE supoosed to help YOU if you won't even MEASURE the voltage on the pin ?
You need to learn something about digital electronics, specifically about TTL LOGIC. Posting on the forum because you don't understand why a 2V signal is not being read correctly by an arduino digital input pin is putting the cart before the horse. You need to learn the basics of TTL digital logic BEFORE you try to use it. As stated. 2V is undefined. Digital logic is HIGHs and LOWs, specified in the TTL (or CMOS) standard. If you are trying to interface ANALOG signals to DIGITAL ELECTRONICS, you need to use COMPARATORs.. If you do not understand digital logic levels or Comparators, then you are not ready to do your project. Doing Electronics requires some knowledge of electronics. I would think that would be obvious. We don't expect you know much , but if you are asking about digital signals, it would seem logical that you would research what is a digital signal , really ? What is a high ? What is a Low ? Where does LOW leave off and where does HIGH start ? How else can expect to get anything to work ? Think about it for a second. You are asking us questions about digital signals. Do you think we should have to start the conversation with
"Excuse me sir , do you mind if I ask you if you know what a HIGH or a LOW is ?"
So, yeah, that was the long version. The short version is "The problem stems from unfamiliarity with digital electronics, starting with not knowing the definition of a LOW or a HIGH. Is it unkind for me to point this out ? That really depends on how on what our priority is here. Everyone that takes their time to try to answer posts is dedicated to the objective of answering the OP's question. In you case , that question is "Why doesn't my digital circuit work ?" I'm going to go out on a limb here and say:
"Because you don't know anything about digital electronics ?"
Your problem can be solved simply by implementing an op amp COMPARATOR . A comparator is a circuit that performs the function of translating a non digital signal (such as your 2V) into a high or a low. You set those thresholds with resistor voltage dividers. It is a bulletproof circuit and it will always work and you can set the levels to what ever you want. When it comes out of the comparator, it is a TTL class signal that will be understood by any digital circuit. One LT1215 has two op amps so you could make two comparators.
In a way, you could say a comparator is a simple A/D converter. The output is directly compatable with any arduino or any other circuit. All it requires is resistors. It can run off the arduino 5V, so you don't need another power supply. If the LT1215 is too exotic for you, you can rough it with a cheap Lm339 and some pull up resistors, and you can't tell the difference in performance.
You said you put a 10k resistor between the pin and GND. Was this BEFORE or AFTER you measured the voltage on the pin ?
Did you ever actually measure the voltage on the pin with a DMM ? How exactly did you conclude the pin was 2V ?
Why are using a DC generator as a DIGITAL input instead of ANALOG input ?
What is THAT supposed to accomplish ?
Is this for school ?
Would I be "off base" asking why you are using a uC if you don't know the definition of a digital signal ? Should you drive a car if you don't know what oil is ?