Hello all,
I recently purchased 2 OPT3101 distance sensors and was trying to get them working. I was running the advanced example from Github, and the sensors gave the correct values when I ran the code. However, when I put one of the sensors on my robot, I started experiencing some issues. One of the channels was behaving unreliably, and it started giving negative values.
Here are the values that I was getting:
Distance 0, Distance 1, Distance 2, || amplitude 0, amplitude 1, amplitude 2,
1067, 947, 159, || 214, 70, 65,
1048, 986, -106, || 208, 73, 64,
1060, 871, 36, || 213, 67, 63,
1032, 1005, -71, || 208, 71, 63,
1026, 862, -9, || 215, 70, 63,
1040, 1046, -96, || 207, 71, 61,
1073, 903, 81, || 214, 67, 66,
1034, 970, -44, || 207, 73, 62,
1066, 855, 166, || 209, 69, 65,
1007, 1083, -190, || 215, 72, 62,
1023, 924, 86, || 221, 66, 65,
1036, 1054, -184, || 206, 69, 60,
1123, 816, -64, || 189, 67, 63,
1112, 1011, -130, || 169, 69, 59,
1216, 942, -41, || 168, 65, 62,
1153, 908, -224, || 162, 70, 62,
1221, 983, 135, || 165, 66, 62,
1182, 987, -161, || 160, 70, 62,
1239, 827, 75, || 161, 67, 61,
1208, 1043, -203, || 159, 68, 59,
1234, 954, 10, || 160, 64, 63,
1174, 986, -238, || 161, 70, 61,
1239, 935, -13, || 164, 64, 62,
1178, 1000, -141, || 160, 70, 59,
1236, 859, -50, || 159, 66, 62,
1203, 973, -233, || 157, 69, 59
And also I get positive values when the amplitude value is greater than 100, but the issue is that I am only getting a range of 10-30 cm reliably otherwise it just gives a value of 20 - 30Cm even when the object is far away.
like:
1693, 617, 344, || 62, 66, 116,
1434, 809, 215, || 59, 71, 116,
1634, 672, 338, || 64, 68, 118,
1414, 774, 269, || 59, 71, 116,
1613, 614, 369, || 65, 68, 119,
1463, 755, 284, || 56, 72, 120,
1594, 629, 366, || 64, 72, 119,
1552, 814, 253, || 59, 73, 118,
1712, 677, 353, || 63, 70, 119,
1453, 721, 310, || 59, 70, 119,
1685, 701, 346, || 62, 70, 120,
1549, 810, 291, || 59, 71, 116,
1618, 519, 373, || 61, 68, 118,
1481, 800, 255, || 60, 71, 117,
1617, 735, 323, || 66, 69, 119,
1453, 754, 282, || 62, 74, 117,
1577, 686, 385, || 64, 74, 119,
1505, 821, 291, || 59, 77, 115,
1705, 638, 369, || 64, 72, 120,
1503, 800, 254, || 59, 74, 118,
1691, 660, 305, || 64, 72, 119,
1519, 836, 278, || 60, 76, 117,
1555, 696, 301, || 65, 72, 121,
1562, 871, 219, || 59, 76, 115,
1664, 727, 378, || 64, 74, 118,
1492, 751, 242, || 60, 74, 117,
1682, 670, 365, || 62, 72, 123,
1479, 879, 252, || 58, 77, 116,
1630, 734, 370, || 64, 72, 118,
The First and the second channels are working fine,
Here is my EEPROM hex dump:
"\xB4\xF0\xB2\xF1\xB4\x65\xD1\x22\xB4\xCE\x00\x00\x0B\x09\x00\x10\x0C\x00\x00\xBF\x29\xE4\x93\x2F\x2A\x20\x49\x7C\x2B\x78\x69\x00\x2C\xA7\x0B\x00\x2D\xBB\xE4\x5E\x2E\xA0\x01\x84\x2F\x8F\xF3\x4C\x30\xAF\x0E\x20\x31\xBA\x03\x5F\x32\x8F\x60\xB0\x33\xDD\xF0\x4B\x34\x0E\xFD\x60\x35\xE2\xCA\x00\x36\x6E\xDC\x00\x37\xED\xE5\x00\x38\x02\xFA\x29\x39\x95\x8D\xF1\x3A\x20\xC2\x4D\x3F\xC8\x08\x00\x41\x10\x80\x8C\x42\x56\x3B\x00\x43\x83\x00\x00\x45\xDD\x85\x8C\x47\xC8\x08\x80\x48\xC8\x08\x00\x49\xC8\x08\x00\x51\xF0\x32\x00\x52\x52\x3D\x00\x53\xED\x33\x00\x54\x6C\x3C\x00\x55\x9D\x34\x00\x5E\x00\x63\x13\x5F\xF8\x16\xBB\x60\x1D\xEA\xD8\x61\xDF\x88\x00\x72\x50\x00\x00\x85\x7A\x26\x00\x86\x82\x26\x00\xB4\xD3\xE4\xE8\xB5\x01\x00\x00\xB8\x1A\x6C\x01\xB9\xA6\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF";
I would really appreciate some help with this issue. Does anyone have any suggestions for how I can resolve this issue?
Thank you in advance for your help!