Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
D

Doubletop

@Doubletop
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • JSN-SR04T (distance sensor) Reliability Issue Fix?
    D Doubletop

    @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.

    Troubleshooting

  • JSN-SR04T (distance sensor) Reliability Issue Fix?
    D Doubletop

    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

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular