Monthly Archives: May 2014

Audio speed

After a first fail, we decided to find another way to measure distance. Since the robot is able to use Bluetooth and it had a loudspeaker, we thought that we could to use the velocity difference between these two kinds of waves to determine distance between the two devices.

For this second test, we will start by sending a 1 KHz audio signal from the robot and then send a Bluetooth signal again from the robot to a Nexus 7 tablet. Given that Bluetooth is faster than audio, Bluetooth wave will arrive earlier than the audio wave. Thus, we need only measuring time from Bluetooth reception to audio reception, and we will be able to find a correspondence between time and meters.

But there are several questions about this job:

– How can the audio wave from the robot be distinguished from ambient sound ?

– Is it possible to do a Bluetooth communication between a robot and an Android device ?

– Which measurement will be precise ?

– What is the maximum distance the devices could be placed from one another?

The first step is to send an audio signal recognizable from the robot. In order to send what I want, I use a  library from LeJOS : lejos.hardware.sound. There is a method playTone that is easy to use and powerful. It will enable you to play what frequency you want, during the time you want, and a the level you want.

package com.ev3;

import lejos.hardware.Sound;

public class Main
{
    public static void main(String[] args)
    {
         Sound.playTone(1000, 10000, 100);
    }
}

Now I have to find a way to receive, analyze, and recognize sound from the robot. Like the first attempt, it will take too much time to do my own application, so I found an application on Google Play called Frequency Analyser that allow to know the frequency of an audio signal received by micro.

2014_06_10_10.31.20

2014_06_10_10.31.20

We can see in the previous picture, that the application showed us the frequency of the received signal. To do this application we use a Fast Fourier Transform. It is really powerful and allows you to know the frequency of a signal.

With this application, we are able to detect an audio signal from about 7 meters. So now, I have to do my own application so as to be able to integrate what I want in addition to the audio part.

I tried to do the same application as the previous one, but it is too complicated and it would have taken me too much time to do the same. So, with my application, I am not able to recognize a signal. I am only able to know what the highest frequency range is. So thanks to the application, I am theoretically able know if my robot is sending me a 1Khz sound wave or not.

2014_06_12_08.34.06[1]

It works well when the robot is close to the tablet and there is no ambient sound, but when they are 2 meters away from one another, and when people are talking and making noise, it does not work anymore.

2014_06_12_08.43.13[1]

 

Seeing previous screens shots, we can conclude that this method could work with a very good sound analysis application. However, with a basic application, we cannot assure the reliability of the measurement, since there will be some noise, and if the devices are placed far from one another the application will not work anymore. I have to recall that this method is based on the very short time difference between two waves, so we MUST have a precise measure.

Because this way is not acceptable, we will talk about Bluetooth in the next post.

RSSI

RSSI : Received Signal Strength Indicator, is a measurement of the power present in a received radio signal.

The first method I used to solve my problem is based on RSSI. RSSI is used to pick up the intensity of a received signal, so if a device is far from another, the RSSI value should be lower than a closer device. This kind of measurement is mainly used with wi-fi, but it could still be implemented with Bluetooth.

In order to get the RSSI value, you need a reliable Bluetooth communication between two devices. It’s not easy to send data between devices that is why once communication is established, the hardest part is over. Now, you have to get back the RSSI value. Look on Bluetooth.device and find  EXTRA_RSSI.(links)

For my tests, I used an application from Google Play  because it would take me too much time to do my own application and there are other applications which are better, such as: Blueooth RSSI Monitor  (https://play.google.com/store/apps/details?id=com.xqapp.brm)

 

In theory, it should work, but now we will test the reliability of RSSI in practice:

For this test, I used my computer and a Nexus 7 tablet. They are both static and 3 meters from each other. The application shows the RSSI value in DB, and we can see on the following graph about 80 measurements, with a value every 2 seconds.

2014_05_20_10.48.43

Y axis : RSSI value (in DB)

X axis : Values (number of values)

According to theory, we should see a constant value because the devices have not moved, but we can observe that signal is very unstable. The value varied from -60DB to -89DB, so we cannot use this method to do a precise measurement.

 

Biography

My name is Julien LE MELLEC, I’m a master’s student from French doing an internship at FAU for 3 months with Dr. Shankar. I’m working with an EV3 lego robot and a Nexus 7 tablet, and my job is determine the distance between the robot and the tablet. The robot will move from a place to an other place and with an Android application on the tablet I will know the distance between the devices. In order to do this project, I will use several tests, to determine which method is most reliable and precise.