Oscilloscope Module

OscilloscopePlot
Description

With this module, you can analyze and visualize the data read by your hardware board. You can also record the data and store it in the form of CSV so that so can access it later. 

Available in

Introduction

The Oscilloscope module allows you to visualize the input and output signals of your hardware device on your smartphone. Like an oscilloscope has different channels to plot data from different sources, similarly, in this module also, you can plot data from two different sources connected on your hardware.  You can send data for both the channels or any one channel at a time, adjust the scaling of time and magnitude axis and also store the coming data in form of CSV files. You can visual signals of frequency up to 50 Hz properly. On higher frequencies, there is a distortion in plotting.

Channel Selection and Time axis Adjustments

The module is configured at following settings by default:

  1. Both the channels in the module are on. The red colored channel is channel 1 and the green colored channel is channel 2.
  2. The Voltage axis is set in volts/div with each division of 6V.
  3. The Time axis is set in ms/div with each division of 100 ms (millisecond).

In order to adjust the voltage scale or time scale or active channel settings follow the below steps:

  • At the bottom of the oscilloscope screen, you can see an arrow pointing upwards. Drag that arrow up and you can see a user interface that has slide switch and slider interfaces.
  • Using a slide switch icon you can turn on or off channel depending upon how many channel data you want to plot. For example, if you want to send data on channel 1 only then you can switch off channel 2.
  • Use the time scale slider to adjust time per division. You can adjust it to different values as per your needs.
  • There is also a panel of three buttons at the top right corner of the settings menu as shown below:
    1. The first button is the Start/Stop button to control plotting on the module.
    2. The second button is for recording Data. You can log the data received by this module by recording it using this button. The recorded data is stored in form of CSV file.
    3. The third button is used to open the list of CSV files recorded by this module. By clicking on this button you navigate to the following screen where the list of all recorded files is present.
               
  • The magnitude scale is a bit tricky to understand so read this section carefully.
    1. You can set the voltage scale in millivolts/div or volts/div. When you open the module you can see the scale in volts/div.
    2. In order to change this scaling, you can pinch on screen to zoom in or zoom out. To get the scale in millivolts/div you have to zoom in to the screen several times so be patient while doing that.

 

evive Notes Icon
Note:  The Oscilloscope module is currently under development hence it will not work the way other Dabble modules works. The code of using it with Arduino has been given below. Pictoblox also consists of blocks to use this module. And also this module is currently working on evive, Mega, Uno, and Nano. Codes for running this module with ESP32 will be added soon.
 

As stated earlier this module works differently as compared to other modules therefore in order to use this module correctly follow the steps below for both PictoBlox as well as Arduino:

  1. Disconnect Bluetooth if it is already connected.
  2. Upload code shared below (For both Arduino and Pictoblox)
  3. Open Oscilloscope Module
  4. Now connect Bluetooth
  5. Adjust scale as per your Data Range you are plotting.
evive Notes Icon
Note: For Arduino Uno and Nano connect Bluetooth module to RX0 and TX0 pin on the board i.e pin 0 and pin 1 on the board.

Arduino IDE Functions

Download the zip file of Oscilloscope Library for evive, Mega, Uno, and Nano from here: Oscilloscope_Dabble

Functions

  • Oscilloscope.begin(SerialChannel) – This function is used for initializing the data transfer process between your hardware and  Smartphone. The argument SerialChannel is the name of the Serial channel on which your Bluetooth is connected to the hardware board.
  • Oscilloscope.sendDataChannel1(data) – This function is for sending Data on channel 1 of the module.
  • Oscilloscope.sendDataChannel2(data) – This function is for sending Data on channel 2 of the module.

PictoBlox (Scratch) Blocks

There are mainly two types of blocks for this module one it to change baud rate and one is for selecting the channel and sending data.

evive

With “set bluetooth baudrate to () for Oscilloscope” connect the Bluetooth on the Bluetooth slot of evive and select the baud rate as per baud for your Bluetooth from drop-down.

Oscilloscope_evive

Mega

The stacked blockconnected bluetooth on serial () at baudrate ()” select the serial channel on which you connect the Bluetooth module and also select the baud as per your Bluetooth module.Oscilloscope_Mega

Uno and Nano

Connect Bluetooth on Serial 0 and select the baud rate for your Bluetooth module.Oscilloscope_Uno

The stacked block “send data () on channel ()” is for sending data on the oscilloscope channel. It has one text box where you have to write the data to be plotted followed by a drop-down where you have to select the channel on which you want to plot the data.Oscilloscope_sendData

 

Examples

Click here to view Arduino IDE Example for Oscilloscope Module

In the below codes we will visualize the voltage level across an analog pin of your board. For this, we will follow the following steps:

  1. Read data of analog pin. You can connect any sensor or a simple potentiometer anything like that in which you can get a variable output voltage between 0 and 5V.
  2. Convert it into millivolts.
  3. Send it to Smartphone so that it’s graph can be plotted.

In both the code given below, a function block is that converts analog reading read by hardware into millivolts.  

evive and Mega

Uno and Nano

Click here to view PictoBlox (Scratch) Example for Oscilloscope Module

In the below scripts we will visualize the voltage level across an analog pin of your board. For this, we will follow the following steps:

  1. Read data of analog pin. You can connect any sensor or a simple potentiometer anything like that in which you can get a variable output voltage between 0 and 5V.
  2. Convert it into millivolts.
  3. Send it to Smartphone so that it’s graph can be plotted.

In both the scripts given below, a function block is defined that converts analog reading read by hardware into millivolts.  

evive

Uno

The code for Nano and Mega block also remains the same you just have to change the head block and baud rate block as per your board. 

Leave a Reply

Close Menu
×

Cart