So, no schematic and no code.
I am trying to make a range finder using a single ultrasonic sensor, Tx/Rx in one.
I couldn't manage to make it work with any schematic...
So, which schematics did you try? Furthermore, which transducer did you use?
Something to realize when trying to make any ultrasonic sensor device - you -will- need an oscilloscope (and possibly a frequency counter) in order to set things up properly; this isn't something you can "trial and error" your way to, generally.
Also something to note is whether your sensor is a transceiver device (that is, capable or transmitting -and- receiving) or is a "receive" or "transmit" only (that is, you need a complementary pair to build the sensor).
Single transducer sensors use a transducer that is designed and manufactured to be able to be used as both a transmitter and a receiver; while those sensors that you commonly see (like SRF-04 modules, or the Parallax PING) that use two transducers have one transducer that is a transmitter, while the other is a receiver. They are designed and tuned explicitly to operate in that mode -only-.
So before we can really answer any questions, not only do you need to point us to the schematics and code you tried, but you also need to tell us what parts you are using.