This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

distance value between android smartphone and msp430

i'm working on this project.......The aim is to estimate the distance of a smartphone from the embedded system using the different propagation velocity of acoustic and electromagnetic waves.

It is expected the use of Bluetooth for radio communication.

For acoustic communication: The embedded system transmits with a buzzer while the smartphone receives with his microphone.

Hardware to be used:

  • system embedded: TI EXP-MSP430FR5739
  • Smartphone Android
  • BLUETOOTH module: RN42
  • Ultrasonic transmitter: 5340-TX40

Any suggestions please? (expecially for the android code)

i'm trying to proceed in this way: 1)to send an electromagnetic signal(for example an ASCII character) from smartphone to msp430;

2)to start a timer;

3)msp430 receives the signal and send a ultrasonic signal;

4) smartphone receives the signal and stop the timer;

5)"flight"time (conversion in seconds) evaluation ;

6) distance evaluation ;

7)infinite loop

P.S. do u know how to use android code with Code Composer Studio and how can i receive the ultrasonic signal with the smartphone android microphone?

  • Hello Gianfranco,

    There could be some issues with your setup you have suggested.

    First, let me say Android development is outside the scope of this forum, and CCS is not compatible with Android dev work. I would kindly suggest finding an Android forum for development questions and development environment suggestions.

    Second, Ultrasonic sensing is tough and will need a front end to control in addition to the MSP430 you wish to use. You can check our Ultrasonic products here: www.ti.com/.../ultrasonic-sensing-overview.page Some of the biggest challenges, especially for short distance measurement, is precision clocking and impedance matching of your front end + board + transducer. Some experimentation is needed in order to achieve high precision. It will be significantly easier to use some sort of Ultrasonic Transducer baord kit that you can find on some robot kits or Arduino sensing kits. You can check out the Grove Starter Kit for Launchpad which includes one of these modules and is compatible with our Launchpad Ecosystem.  http://www.seeedstudio.com/depot/Grove-Starter-Kit-for-LaunchPad-p-2178.html

    Third, one major issue you will run into is the synchronization of clocks between the two devices. There are two ways I see to solve this. One is to get rid of the idea of synching clock all together, and have one device send and receive the signal to be analyzed. Example: MSP430 based device send ultrasonic signal to phone. Phone receives a signal and immediately sends it back MSP430 based device. MSP430 receives and calculates distance, remembering it is twice the distance between devices that is being calculated. There are some issues here such as the phone must remain stationary during the process. Also, the program on the phone may be interrupted by OS or some other delay that causes an un-deterministic time between receiving a signal and sending one out. This will skew your results. You would also have to be careful with interference on the returning signal from the initial blast. MAybe if you waited a predetermined amount of time before sending back from the phone, you could resolve these issues. The second way is to add a GPS module to the MSP430 device side. This way you know the time base between the MSP430 device and phone are synched by the GPS modules.

    Another method to get the distance between the devices can be done by just using the Bluetooth module. You can determine approximate distances between the two Bluetooth modules by looking at the RSSI values of the signal.

    Hope this helps and good luck from your application!

    Regards,
    JH

  • You can't receive ultrasonic sounds using any smartphone because their microphone and sound sampling system is band-limited to audio frequencies <= 20KHz or even lower freq for most of phones. What's left - audible beeps. I would use beeps for both ways of communication w/o any BT, such way greatly simplifying whole project. By The Wway BT transmission is not that time-deterministic as you would want. Clock sync is easy - introduce calibration phase for sensor which requires user to place sensor in defined and close proximity to phone when time sync is done using dedicated clock sync audio signal beep. Maybe DTMF tones could be good enough for signalling - you have 16 different signals at your disposal

  • >Also, the program on the phone may be interrupted by OS or some other delay
    In case audio sonar with active sensor, ping-pong approach is used then there's no problem whatsoever. Phone microphone shall continuously record not only signal from sensor but also signal directed to sensor - as most sonars do. Knowing sample rate, sample count between TX/RX signals and sensor processing delay if any - you can calculate propagation time, thus distance. [edit] In such case time sync is not needed IMHO

**Attention** This is a public forum