ArduinoGeneral

TMF8801 Arduino Code stability

userHead Account cancelled 2022-01-07 06:52:25 462 Views0 Replies
Hi, I was trying out the TMF8801 example code but I noticed a strange thing happening after ~1100 measurements are reported. The reported distance suddenly jumps up beyond the range of the sensor even though the sensor to target distance remained constant.

You can see the terminal data below, sensor reads a fairly constant 435mm and then after 1101 & 1084 measurements it goes off the scale?

Index Test Data 1 Test Data 2
1077 Distance = 433 mm Distance = 435 mm
1078 Distance = 435 mm Distance = 437 mm
1079 Distance = 432 mm Distance = 438 mm
1080 Distance = 434 mm Distance = 437 mm
1081 Distance = 434 mm Distance = 433 mm
1082 Distance = 434 mm Distance = 438 mm
1083 Distance = 435 mm Distance = 432 mm
1084 Distance = 434 mm Distance = 43163 mm
1085 Distance = 436 mm Distance = 9818 mm
1086 Distance = 433 mm Distance = 42604 mm
1087 Distance = 435 mm Distance = 60896 mm
1088 Distance = 434 mm Distance = 34595 mm
1089 Distance = 434 mm Distance = 17788 mm
1090 Distance = 434 mm Distance = 5341 mm
1091 Distance = 435 mm Distance = 61925 mm
1092 Distance = 435 mm Distance = 55134 mm
1093 Distance = 434 mm Distance = 49216 mm
1094 Distance = 436 mm Distance = 44397 mm
1095 Distance = 433 mm Distance = 40923 mm
1096 Distance = 436 mm Distance = 37755 mm
1097 Distance = 434 mm Distance = 34957 mm
1098 Distance = 435 mm Distance = 32608 mm
1099 Distance = 433 mm Distance = 30627 mm
1100 Distance = 435 mm Distance = 28762 mm
1101 Distance = 2618 mm Distance = 27333 mm
1102 Distance = 21092 mm Distance = 25952 mm
1103 Distance = 47632 mm Distance = 24501 mm
1104 Distance = 947 mm Distance = 23241 mm
1105 Distance = 38446 mm Distance = 22286 mm
1106 Distance = 20524 mm Distance = 21234 mm
1107 Distance = 7578 mm Distance = 20448 mm
1108 Distance = 63685 mm Distance = 19640 mm

Code is compiled and run on an Arduino Uno.

Any ideas?

Thanks
~ Psmudge1972