android bluetooth oscilloscope

21,875

Circuit Image

The transmitter circuit utilizes Microchip's dsPIC33FJ16GS504 for analog-to-digital conversion of input signals on two channels. The processed data from the dsPIC is transmitted to a mobile phone for waveform display via the LMX9838 Bluetooth SPP module. The source code for Bluetooth communication is based on the Bluetooth Chat example, which includes three Java source files. The "DeviceListActivity.java" file, used for searching remote Bluetooth devices, has been entirely copied. The "BluetoothChatService.java" file has been modified to implement only the RFCOMM Client functions, utilizing the well-known UUID "00001101-0000-1000-8000-00805F9B34FB" for Bluetooth RFCOMM/SPP. For waveform plotting, a SurfaceView object is employed to draw on its canvas. The tutorial on using canvas in Android has been significantly helpful for this task. The remaining work primarily involves porting a previous Python S60 script to Java, which has proven challenging due to the need to convert a single script file into multiple Java and XML source files. However, this process has provided valuable experience in learning the Android SDK (Java programming). Although the dsPIC used may not be the most suitable choice for the project due to several unused peripherals, it was the only readily available component and features the fastest ADC (2 x 2MSps) among the chips on hand. After nearly a year, the project continues to attract interest, despite being considered somewhat obsolete, leading to the decision to host the source repository on Google Code. Users can browse or use Git to create their local copies and review the changes made to learn how to modify the code. The initial commit started with a simple "hello world" from the SDK project template, followed by subsequent changes until the final oscilloscope application was developed.

The transmitter circuit is designed to facilitate the conversion of analog signals into digital data, leveraging the capabilities of the Microchip dsPIC33FJ16GS504 microcontroller. This microcontroller features a dual-channel ADC capable of sampling at rates up to 2 MSps, making it suitable for applications requiring rapid data acquisition. The circuit architecture involves connecting the input signals to the ADC channels of the dsPIC, which processes the signals and prepares them for transmission.

The processed data is transmitted to a mobile device using the LMX9838 Bluetooth SPP module, which operates under the Serial Port Profile (SPP) to enable wireless communication. The integration of the Bluetooth module allows for seamless data transfer to the mobile application, where the waveform can be displayed in real-time. The Bluetooth communication is implemented through a modified version of the Bluetooth Chat example, which provides a robust foundation for establishing connections with remote Bluetooth devices.

The Java source files utilized in this project include essential components for device discovery and communication. The "DeviceListActivity.java" file is crucial for scanning and listing available Bluetooth devices, while the modified "BluetoothChatService.java" manages the connection and data transmission processes, ensuring efficient communication between the dsPIC and the mobile device.

For visualization, the application employs a SurfaceView object, which provides a customizable canvas for drawing the waveform. This approach allows for high-performance rendering of graphical data, ensuring that the waveform is displayed smoothly and accurately. The tutorial on using the canvas in Android serves as a reference for effectively utilizing this feature.

The transition from Python to Java involved significant restructuring of the original code, resulting in multiple Java and XML files that adhere to the Android application architecture. This process not only enhanced the functionality of the application but also provided an opportunity to delve deeper into Android development practices.

Despite the dsPIC33FJ16GS504 being selected for its ADC capabilities, it is acknowledged that other microcontrollers may offer more optimized solutions for this type of project, with fewer unused peripherals. Nonetheless, the choice was driven by component availability and the specific requirements of the application. The ongoing interest in the project underscores its relevance, and the decision to host the source code on Google Code facilitates community engagement and collaborative development efforts.The transmitter circuit uses Microchip`s dsPIC33FJ16GS504 for the analog-to-digital conversion of the input signals on two channels. The processed data on the dsPIC are then transmitted to the phone (for waveform display) via the LMX9838 bluetooth SPP module.

The source codes for the bluetooth communication is based on Bluetooth Chat example from That example contains three java source files. And, I`ve completely copied the "DeviceListActivity. java", which is used for searching remote bluetooth devices. Then I`ve modified the "BluetoothChatService. java" to use only the RFCOMM Client functions, and used the well-known UUID " 00001101-0000-1000-8000-00805F9B34FB " for the Bluetooth RFCOMM/SPP. For the plotting of waveforms, I`m using SurfaceView object to draw on its canvas. This tutorial found on helps me a lot for this task: " How to use canvas in your android ". The rest of the job mainly involves porting of my previous Python S60 script to JAVA language. It was too painful on my side, because I had to convert a single script file to multiple java + xml source files!

Nonetheless, it was a good experience for me on learning the Android SDK (JAVA programming). *The dsPIC I have used is most probably NOT the best choice for this project because of the many left unused peripherals (extra pins). But, this is the only part readily available in my bin and it has the fastest ADC (2 x 2MSps) among the chips I have.

It`s almost a year now, and yet some people are still interested in this project (considered to be obsolete). So I`ve decided to place the source repository also on Google Code site. You can either Browse or use git to have your own local copy: See also the Changes, if you want also to learn on how to modify the code.

I`ve started the first `commit` with a simple "hello world" from the SDK project template. And then changes were made until the desired final oscilloscope application is achieved. 🔗 External reference