Pianola

Always ultrasounds: a sender and a receiver

The new scheme requires the presence of a transmitter, as before, and a single receiver, instead of the two previously used. Of course, the position of the sensors is different: the receiver is placed at one side of the keyboard, at some distance from it, on the same axis along which the user is supposed to move the transmitter. Both the output of the receiving circuit and the PIC driving the transmitter are connected to the DSP and can therefore send information.

Virtual piano final scheme

So we can perform a more classical distance measurement.

We maintain the method with two alternated frequencies. When the frequency change at the transmitter occurs, the PIC that controls it generates a pulse which is sent directly to the DSP. Also the signal received by the receiver, after being appropriately amplified and conditioned, is sent to the DSP, which uses one of its two timers to monitor the signal frequency. When the DSP receives the pulse from the transmitter, it starts the other timer and it stops the count when the frequency transition at the receiver is detected. In this way it is possible to obtain the time difference, which when multiplied by the speed of sound gives the spatial distance between sender and receiver. After subtracting to this value the distance of the receiver from the beginning of the keyboard, which is known, the distance of the transmitter from the beginning of the keyboard is obtained as a result. In accordance to this position, the corresponding key is determined and the right note is selected and emitted by the DSP.

Such a scheme is more simple, straightforward and manageable. So we finally arrived to this configuration.