OK i put the signal out i have 8 cycles of 40Khz but now i receives back and i amplify that signal to 5v but now how i have a question, when i put on pwmout i can put a crono to calcule how time need the signal to come back. CLK or any command special?.
You need some means to measure between the start of the signal being sent and the start of the echo being sent. You can do that by counting the time with something like ...
Gosub StartPulses
w0 = 0
Do While PinX = 0
w0 = w0+1
Loop
but that will have very coarse resolution ( probably around 1ms at 4MHz ) which will only allow inaccurate distance measurements,
Alternatively you can create a hardware signal such that a pulse is generated for the period between the pulses being sent and the echo received. This pulse length can then be read using a PULSIN. This is how the SRF005 does it.
The problem is that a PICAXE can only read a pulse with PULSIN where that pulse starts after it is executing the PULSIN. Thus you cannot send the pulses out and have the pulse activated then and be able to read it with PULSIN later.
You need a mechanism for triggering the pulses out and waiting for the PULSIN with the pulses being sent some time later after triggering. A second PICAXE could do this. You would effectively be replicating the SRF005 circuit for this second PICAXE which sees the trigger pulse, delays issuing the pulses and then provides the time pulse to be read by the initiating PICAXE.
Once you have that the master PICAXE can use the same code which it would with a genuine SRF005 ( as described in SRF005.PDF ) with maybe some minor adjustment ...
PulsOut trig,2
PulsIn echo,1,range
range = range * 10 / 58
The PICAXE on your 'clone SRF005' board has to wait for the trigger, delay, emit the U/S pulses and provide a pulse between start of sending and echo received. The diagram in SRF005.PDF shows this sequence of events and it is also in the SRF004 and SRF005 data sheets.
Alternatively you can produce a timing pulse using external logic which uses the first U/S pulse to start the pulse and the start of an echo pulse to stop it and use additional hardware to gate the pulse so that the timing pulse does not appear to the PICAXE until it is executing its PULSIN.
This is quite straight forward, fairly easy to do, but does take effort to do it. The cost in time is usually far greater than simply buying an SRF005 which is what most people would do as that also delivers a tried and tested result. For research, for the challenge or fun of doing it from first principles where time and effort is not important the previous solutions should get you what you need.