The JSN - SR04T is compatible with the basic stamp homework ?

Hey there

I'm experimenting with JSN - SR04T and BASIC Stamp Homework module , this is my code

' {$STAMP BS2}
' {$PBASIC 2.5}

trig PIN 14
echo PIN 15

'*******************************

tiempo VAR Word
cm VAR Word
cm_max CON 20000
fuera_tiempo CON 0
'*******************************

DO

IF echo = 0 THEN

PULSOUT trig,5
PULSIN echo,1,tiempo

cm = tiempo/29

'IF cm <= cm_max THEN tiempo = fuera_tiempo

ENDIF

DEBUG HOME, "time = ", DEC5 tiempo, CR
DEBUG ? cm
PAUSE 50


LOOP


I have probrado with HC SR04 and works very well , but when tested sim with JSN - SR04T fails, the module is unable to send any signal ultrasound.
there I have my question if this module supports basic stamp ?

Excuse my bad English


Postscript ; this is the image module

[img]SRF04T%20Waterproop-300x300.JPG

Comments

  • Here is a pointer to a data sheet electroschematics.com/wp-content/uploads/2013/07/HCSR04-datasheet-version-1.pdf.
    I think the range is indicated by the period between the trigger pulse and the echo output, rather than the pulse width of the echo signal as is the case with Ping))). If this is, in fact, the case, you will not be able to use PULSIN and I cannot think of a way to use it with BS-2.
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
  • Here is a pointer to a data sheet electroschematics.com/wp-content/uploads/2013/07/HCSR04-datasheet-version-1.pdf.
    I think the range is indicated by the period between the trigger pulse and the echo output, rather than the pulse width of the echo signal as is the case with Ping))). If this is, in fact, the case, you will not be able to use PULSIN and I cannot think of a way to use it with BS-2.

    HC- SR04 works with the BS2 and PULSIN , the problem is with JSN - SR04T model which is similar but does not work

  • Take out IF echo = 0 THEN because echo is a pin (15) and will never equal zero.
    Sapphire
  • Sapphire wrote: »
    Take out IF echo = 0 THEN because echo is a pin (15) and will never equal zero.

    Because it is defined as a PIN, not CON, it is used as an input.

    Here is a pointer to the HC SR04 this link, which does return a variable-length pulse. The two parts are not the same.

    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
Sign In or Register to comment.