Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DistanceSensor returns Zero when distance less than 25cm #644

Closed
AmirSasson opened this issue Apr 18, 2018 · 3 comments
Closed

DistanceSensor returns Zero when distance less than 25cm #644

AmirSasson opened this issue Apr 18, 2018 · 3 comments
Labels

Comments

@AmirSasson
Copy link

i have checked and the hardware is fine i am using HCSR04 on RPI Zero W
it seems like the echo is returning "too fast" and results zero when the distance less than ~25cm
i know there were many discussions on this, but all the issues are closed,
i am using the latest release 1.4.1

@bennuttall
Copy link
Member

This issue was fixed in 1.4.1 but there's a chance you're doing something different which is causing a replication of it.

Can you confirm:

  • You are using Raspbian Stretch
  • You have not installed gpiozero with pip
  • You are definitely using v1.4.1 (please check)
  • You are using the RPi.GPIO Pin Factory (please check by running):
    from gpiozero import Device
    print(Device.pin_factory)
  • You have tested the most basic version of the DistanceSensor code (nothing else could be slowing it down)

@SteveAmor
Copy link
Contributor

This is the behaviour that I have seen for a PiZero as I reported in #595 (comment) which is identical code which subsequently ended up in V1.4.1.
The more accurate fix would be as @waveform80 states at the end of #385 (comment)

@bennuttall
Copy link
Member

This should be fixed on master now. Two big improvements to the way we calculate distance thanks to great effort from @waveform80. Please test if you can:

git clone https://github.com/RPi-Distro/python-gpiozero
cd python-gpiozero
sudo pip3 install .

The v1.5.0 release is expected very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants