Add a pull up resistor, then it will work. Depends on what you are driving as to what value to use.