A schmitt trigger inverter might be a better choice, as Harald suggested in post #7. That'll 'square up' the signal nicely. A 74HC14 for voltages up to 5V, or you could use one gate from a CD4093, with the inputs tied together, for higher voltages. A CD40106, too, if you can easily get one. Up...