Testing the TR-EVO-60M-I2C rangefinder

Testing the TR-EVO-60M-I2C rangefinder

More or less by chance, we came across the TR-EVO-60M-I2C rangefinder manufactured by TeraBee. It promises a detection distance of 0.5 to 60 meters with a viewing angle of 2°. All this in the volume of a 3cm cube with an I2C and serial interface. At around 100 CHF apiece, we couldn't resist buying one to play with.




The TR-EVO-60M-I2C takes the form of a black parallelepiped clipped onto a yellow plastic support that serves as the electrical interface. This interface is accessed via a Hirose DF13 9-pin connector.

The TeraBee TR-EVO-60M-I2C module
The TeraBee TR-EVO-60M-I2C module



The electrical interface allows the module to be controlled via either I2C or TTL serial, giving us a choice between a Yocto-I2C and a Yocto-Serial to interface the sensor. Both are capable of automatically interrogating the sensor while powering it.

With a Yocto-I2C

Connection with a Yocto-I2C is relatively trivial, simply interconnect respectively the GND, SDA, SCL and PWR contacts of the Yocto-I2C to the contacts 3, 4, 5 and 8 of the sensor.

The TeraBee TR-EVO-60M-I2C module connected to a Yocto-Serial
The TeraBee TR-EVO-60M-I2C module connected to a Yocto-Serial



The same thing in real life
The same thing in real life



Note that the documentation mentions that the sensor has built-in 10KΩ pull-up resistors. This is not necessarily a good idea if you intend to put several of these sensors on the same I2C bus, which is supposed to be possible since you can change the sensor's I2C address. In any case, a single sensor connected to the Yocto-I2C, which also has built-in pull-ups, works without a hitch. We haven't tried several.

Using the job system

You can, of course, use the job system of the Yocto-I2C to automatically poll the sensor, the protocol is just trivial. The sensor's default I2C address is 0x31 on 7 bits. This means that 0x62 must be used for a write operation, and 0x63 for a read operation. To obtain a measure, simply send the 0x00 value to the sensor, wait at least 500µs, and then read the result, which is the value in mm encoded on 16 bit, followed by a CRC encoded on one byte. Finally, we use expect to map the result to the "genericSensor1" of the Yocto-I2C.

writeLine {S}6200{P} wait 1 writeLine {S}63xx{A}xx{A}xx{N}{P} expect 31:{A}($1:WORD)($CRC:BYTE)


All you have to do is code all this into a periodic task with a period of 20ms, and you're done.

With a Yocto-Serial

To connect the sensor, connect the GND, RT, TD and PWR contacts to contacts 3, 2, 1 and 7 of the Hirose connector. Note the TX/RX cross-over typical of serial communications.


The same thing in real life
The same thing in real life



By default, when connected in series, the sensor sends its measure results in binary format at such a fast rate that the Yocto-Serial sometimes has difficulty separating the frames. It's easier to work in ASCII mode, because in this mode the measures are clearly separated by carriage returns.

You should therefore set the Yocto-Serial to

  • Power output voltage= 5V
  • Line-based ASCII protocol
  • Encoding = 115200, 8N1
  • Flow control=no
  • Voltage level= TTL 3.3V


Automatic querying

Writing a job for the Yocto-Serial to automatically query the sensor doesn't take long at all. You need to write a periodic, once-only job that sends the 4 bytes 0x00, 0x11, 0x01 ,0x45 to configure the sensor in ASCII mode.

writeHex 00110145


And to write a second task, this one reactive, to parse each value sent by the sensor and map it to the "genricSensor1" of the Yocto-Serial.

expect ($1:INT)



And it works?

The TR-EVO-60M-I2C is the best inexpensive rangefinder we've tested in years. It's fast and unambiguously detects movements such as a door opening and closing a good fifteen meters away. We weren't able to test the maximum distance of 60 meters because our premises aren't big enough.

It works pretty well
It works pretty well



We also tried outdoors, where conditions are notoriously more difficult for this kind of sensor. We set it up on the side of the road that passes in front of the Yoctopuce premises, and had no trouble distinguishing passing cars.



Counting things going by relatively quickly? no problem



On the other hand, we had trouble reaching the advertised distance of 60 meters outdoors, especially in bright sunlight. After thirty meters, we had to use a reflector.

A reflector can help when conditions are problematic
A reflector can help when conditions are problematic



There's also a USB version

If you've already visited the TeraBee website, you'll no doubt have noticed that the little yellow base also comes in a USB version, and perhaps you're wondering why you'd buy a Yocto-Serial or Yocto-I2C to connect the sensor to your computer via USB when this interface is already offered by TeraBee.

TeraBee also offers a USB interface (picture TeraBee)
TeraBee also offers a USB interface (picture TeraBee)


For basic use, you'd be better off using the TeraBee version. However, for more advanced uses, the Yoctopuce version offers many advantages.

  • The TeraBee version works with a virtual COM port, which may require the installation of a driver. What's more, while this COM port-based technology is very easy to access, it can quickly turn into a nightmare when several devices, whether identical or not, are connected to the same computer.
  • Yoctopuce modules don't use COM ports, don't require drivers, and are easily identifiable, so you can connect several of them to the same machine without the slightest problem.
  • As we've seen, a Yocto-Serial or a Yocto-I2C can query the sensor and present the result directly, just like a standard generic sensor.
  • The Yocto-Serial and the Yocto-I2C feature an integrated data logger for automatic measure recording.
  • The Yocto-Serial and the Yocto-I2C can be connected to a YoctoHub for remote access over the network.
  • The Yoctopuce API not only enables direct query of sensors, but also operates in callback mode, making it easy to create highly responsive applications.


Conclusion

We were pleasantly surprised by the performance of this relatively inexpensive little plastic sensor, which at first glance looked more like a toy than a high-performance measuring instrument. If you need to measure a distance of several dozen meters or detect moving objects from a distance, it's definitely worth a look. Finally, if you'd like to use the jobs we've written to test the TR-EVO-60M-I2C, you can download them here.


Add a comment No comment yet Back to blog












Yoctopuce, get your stuff connected.