Case study: Using a laser triangulation sensor to measure displacement of keys & finger movements in musical touch technology
Author : Xorge Castro | Senior NPI & Mechanical Engineer | Luminary ROLI
01 October 2022

Luminary ROLI touch technology includes light-up keyboards & handheld drum pads
Luminary ROLI, a pioneering designer & developer of musical touch technology, has chosen to use an optoNCDT 1320 laser triangulation sensor from measurement technology & sensor specialist, Micro-Epsilon in its R&D (research & development) process to precisely measure displacements of musical device keys & finger movements.
This case study was originally featured in the October 2022 issue of EPDT magazine [read the digital issue]. And sign up to receive your own copy each month.
As Xorge Castro, Senior NPI (new product introduction) & Mechanical Engineer at Luminary ROLI tells us here, by integrating the laser sensor with an Arduino board, the firm now has greater flexibility to use the measurement data in different ways to control test jigs and to test its products in a wider range of scenarios.
Based in East London, Luminary ROLI is a multi-disciplinary team of creators who design and develop the latest in music learning. Its musical touch technology ranges from handheld drum pads to stage-performance synthesizers, as well as software programs from free apps to advanced sound design programs.
As Xorge Castro, Senior NPI & Mechanical Engineer at the company comments: “Every year, our musical touch technology becomes more accessible. Smaller, more approachable, more affordable tools are bringing us closer to our long term goal of empowering everyone to make music. Making these new instruments accessible to everyone also means connecting with tools that music makers know and love.

Micro-Epsilon’s optoNCDT 1320 laser triangulation sensor is compact, lightweight & easy to install
Our musical touch technology is more and more compatible – and this gives music makers a way to explore and be expressive, without leaving their present setups behind.”
The challenge
As part of its R&D process, Luminary ROLI needs to characterise the products that it develops and to benchmark against its competitors. As Xorge explains: “The most important aspects of interaction in our products are force and displacement. These can be seen as how a key is pressed and released in a conventional music keyboard. However, in our products, we go beyond this to create expressive responses that will vary the sound depending on small changes in how the key or surface is pressed.”
Luminary ROLI purchased the optoNCDT 1320 laser sensor to help it measure precise displacements and finger movements. The test equipment must be versatile and adapt to different product sizes and use scenarios. Most of the test equipment is developed in-house, using Arduino boards to control them.
As Xorge puts it: “These boards allow us to quickly modify parameters and create bespoke solutions for each test that we need. Our force gauges and other sensors can send data to the Arduino boards through analogue or TX (transmit) RX (receive) signal format. The challenge we had was how to communicate the optoNCDT 1320 sensor measurement readings to an Arduino using TX RX, as this would provide more functionality and better accuracy than analogue output.”

Comparing force vs displacement on different keys
Approach taken
Xorge purchased a MAX490 board from Amazon for £18. The board translates the RS422 signal from the laser sensor into TX RX signal format that can be read in the Arduino. An Arduino Mega board was required, as several devices need to be connected through TX RX.
“In order to communicate through RS422, we had to change the laser settings on the web browser to use a Baud rate of 115,200 and connect through RS422. This provided raw data in binary, which at first, we could not make any sense of,” explains Xorge.
The next challenge was to translate this binary data into a number that could be used. Micro-Epsilon provided the formula for converting the binary value into a measurement reading based on the sensor’s measurement range. ROLI’s Firmware Engineer, Chris Slater then developed the necessary code for use in the Arduino: https://create.arduino.cc/projecthub/user2160000/reading-rs-422-binary-data-from-opto-laser-23fb34

The test equipment at Luminary ROLI, showing the optoNCDT 1320 laser sensor
“We then integrated the Arduino Mega with a force gauge sensor and another Arduino board that controls an XYZ gantry. The test equipment allows us to move a force gauge on any XY and Z-axis position. With the help of the laser sensor, we can precisely measure a key displacement as we apply a force. In other applications, we can measure the force under the key and use the laser sensor to measure how the key is pressed with a finger or a tool,” adds Xorge.
All-round benefits
According to Xorge, the optoNCDT 1320 met all his performance needs in terms of measurement accuracy and measuring rate (up to 2kHz), while also impressing with its compact, lightweight design (dimensions of 46mm x 30mm x 20mm, weight 30g) that allows the sensor to be easily mounted in tight spaces on his test jigs.
The sensor’s unique ‘Auto Target Compensation’ (ATC) feature ensures stable distance signal control regardless of target colour or brightness. The optoNCDT 1320 is designed for rapid set up and installation, which is achieved with just a few clicks of the multi-function sensor button. The user can select the zero setting/mastering function or the trigger set up. An intuitive web interface enables the user to carry out extended sensor set up and configuration.
As Xorge concludes: “By integrating the optoNCDT 1320 laser sensor with an Arduino board, this has given us greater flexibility to use the measurement data in different ways that allows us to control our test jigs and to test our products in a wider range of scenarios. We’ve been impressed with Micro-Epsilon and the relationship we’ve built – and are also pleased with the excellent technical support they’ve provided when we needed it.”
More information...
Contact Details and Archive...