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

Distance displays 65535cm at low sigstr #2

Closed
simiansinspace opened this issue Apr 26, 2018 · 2 comments
Closed

Distance displays 65535cm at low sigstr #2

simiansinspace opened this issue Apr 26, 2018 · 2 comments

Comments

@simiansinspace
Copy link

Issue
When the SIGSTR drops below 20, the distance reads out 65535. Distance displays correctly otherwise and verified with a tape measure.

Output

216 cm      sigstr: 29
217 cm      sigstr: 25
218 cm      sigstr: 21
65535 cm      sigstr: 19
65535 cm      sigstr: 16
65535 cm      sigstr: 15
65535 cm      sigstr: 14
65535 cm      sigstr: 12
65535 cm      sigstr: 12
65535 cm      sigstr: 12
65535 cm      sigstr: 13
65535 cm      sigstr: 13
65535 cm      sigstr: 13
65535 cm      sigstr: 13
65535 cm      sigstr: 14
65535 cm      sigstr: 15
65535 cm      sigstr: 18
597 cm      sigstr: 21
599 cm      sigstr: 21
600 cm      sigstr: 21
605 cm      sigstr: 22
606 cm      sigstr: 22
606 cm      sigstr: 22
608 cm      sigstr: 24
609 cm      sigstr: 22
608 cm      sigstr: 22
608 cm      sigstr: 21
606 cm      sigstr: 21
602 cm      sigstr: 20

Environment
Tested using a Particle Photon and the tfmini lib. The Photon code was slightly modified to use Serial1 instead of SoftwareSerial

#include "TFMini.h"

TFMini tfmini;

void setup()
{
  Serial.begin(115200);
  Serial1.begin(115200);
  delay(200);
  tfmini.begin(&Serial1);
}

void loop()
{
  // Take one TF Mini distance measurement
  uint16_t dist = tfmini.getDistance();
  uint16_t strength = tfmini.getRecentSignalStrength();

  // Display the measurement
  Serial.print(dist);
  Serial.print(" cm      sigstr: ");
  Serial.println(strength);

  // Wait some short time before taking the next measurement
  delay(25);
}
@PeterAJansen
Copy link
Contributor

Thanks -- this sounds like an issue (or, a feature) with the sensor itself, signaling that there's low quality data due to poor signal strength. If you suspect that it's an issue with the driver, please submit another issue report. best wishes.

@nitinjs
Copy link

nitinjs commented Oct 26, 2019

Serial.begin(115200);
Serial1.begin(115200);
delay(200);
tfmini.begin(&Serial1);

can you please provide details about the PIN connections you made with TFMini and Photon??

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

No branches or pull requests

3 participants