Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Doubletop
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Doubletop

    @Doubletop

    3
    Reputation
    2
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Doubletop Follow

    Best posts made by Doubletop

    • RE: JSN-SR04T (distance sensor) Reliability Issue Fix?

      I'll open this up again. I've just received some JSN-SR04T V3.0 and was having similar issues to those described here. Using PlatformIO and the Arduino framework and a simple code that did the 10us pulse and measured the time of the return pulse.

      10us pulseIn.JPG

      The top trace is just a line toggle as the code goes around the loop. The second trace is the echo and the bottom the trigger pulse. You can see that multiple triggers don't get a return echo. Using the function pulseIn() it times out after a second and we go around the loop again.

      Using pulseInLong, that also defaults to a 1sec timeout but making the timeout 10000 ensure the code doesn’t hang for longer than necessary. but still, losses plenty of echoes.

      10us trigger - pulseInLong 10000.JPG

      Next was increase the trigger to 12us It still gets the occasional lost echo

      12us = pulseInLong.JPG

      So next was 20us trigger, very few lost echoes

      20us = pulseInLong.JPG

      and 30us trigger, no missing echoes

      30us = pulseInLong.JPG

      So for better reliability us a 30us trigger pulse and the pulseInLong() function with a timeout of 10000.
      I concluded that the limited datasheet saying the trigger should be 10us really should say greater than 10 us.

      Hope that helps somebody

      Pete

      posted in Troubleshooting
      Doubletop
      Doubletop
    • RE: JSN-SR04T (distance sensor) Reliability Issue Fix?

      @zboblamont

      3V from ESP32

      The other thing I realised is that zero values from pulseInLong aren't only from no echoes timeouts, they are also from out of range echoes. (obvious now I've written it down).

      The conclusion is set the correct trigger time, ignore zero values and use a timeout that is relevant to your own application. if you don't want to read beyond a certain distance timeout and dont hang for up to a second waiting for the default to do it for you.

      posted in Troubleshooting
      Doubletop
      Doubletop

    Latest posts made by Doubletop

    • RE: JSN-SR04T (distance sensor) Reliability Issue Fix?

      @zboblamont

      3V from ESP32

      The other thing I realised is that zero values from pulseInLong aren't only from no echoes timeouts, they are also from out of range echoes. (obvious now I've written it down).

      The conclusion is set the correct trigger time, ignore zero values and use a timeout that is relevant to your own application. if you don't want to read beyond a certain distance timeout and dont hang for up to a second waiting for the default to do it for you.

      posted in Troubleshooting
      Doubletop
      Doubletop
    • RE: JSN-SR04T (distance sensor) Reliability Issue Fix?

      I'll open this up again. I've just received some JSN-SR04T V3.0 and was having similar issues to those described here. Using PlatformIO and the Arduino framework and a simple code that did the 10us pulse and measured the time of the return pulse.

      10us pulseIn.JPG

      The top trace is just a line toggle as the code goes around the loop. The second trace is the echo and the bottom the trigger pulse. You can see that multiple triggers don't get a return echo. Using the function pulseIn() it times out after a second and we go around the loop again.

      Using pulseInLong, that also defaults to a 1sec timeout but making the timeout 10000 ensure the code doesn’t hang for longer than necessary. but still, losses plenty of echoes.

      10us trigger - pulseInLong 10000.JPG

      Next was increase the trigger to 12us It still gets the occasional lost echo

      12us = pulseInLong.JPG

      So next was 20us trigger, very few lost echoes

      20us = pulseInLong.JPG

      and 30us trigger, no missing echoes

      30us = pulseInLong.JPG

      So for better reliability us a 30us trigger pulse and the pulseInLong() function with a timeout of 10000.
      I concluded that the limited datasheet saying the trigger should be 10us really should say greater than 10 us.

      Hope that helps somebody

      Pete

      posted in Troubleshooting
      Doubletop
      Doubletop