Dabble Modules
Camera (Coming Soon)
Oscilloscope (Coming Soon)
IoT (Coming Soon)
Touch Tune (Coming Soon)
Projects (Coming Soon)

Getting Started with Dabble

Introduction

Whether you’re a student, a teacher, or a hobbyist, Dabble is the perfect place for all your DIYing needs. It transforms your Smartphone into a virtual I/O device and lets you control hardware via Bluetooth, communicate with it, access sensors like accelerometer, GPS, proximity and other features of your Smartphone. It also provides you with dedicated projects compatible with Scratch and Arduino to help you learn by doing.

Dabble Home Disconnected

What Dabble has in its store:

Sr.NoModule NameModule Description
1LED Brightness ControlControl brightness of LEDs.
7TerminalSend and receive commands over Bluetooth.
2GamePadControl devices in analog (Joystick), digital, and accelerometer mode.
8Pin State MonitorRemotely monitor the live status of devices and debug them.
3Motor ControlControl actuators such as the DC motor and servo motor.
9InputsProvide analog and digital inputs via buttons, knobs, and switches.
4Oscilloscope (Coming Soon)Visualize and analyze the input and output signals given to the device using the oscilloscope module.
11Phone SensorAccess different sensors of your Smartphone such as the accelerometer, gyroscope, proximity sensor, magnetometer, light meter, sound meter, GPS, temperature sensor, and barometer to make projects and conduct experiments.
5Camera (Coming Soon)Use the camera of your Smartphone for taking photos and videos, face recognition and color picking.
10IoT (Coming Soon)Make the Internet of Things possible.
6Touch Tune (Coming Soon)Receive commands from the device and play tones, songs, or other recorded files on your Smartphone.
12Projects ūüôā (Coming Soon)Make dedicated projects to experience different concepts of the real world first-hand.

Supported Development Boards

Dabble is compatible with the following prototyping boards:

  1. evive
  2. Arduino boards like Mega, Uno, and Nano
  3. Esp32 (coming soon)

Supported Bluetooth Modules

HC-05, HC-06, and HM-10 are the supported Bluetooth modules with evive and other Arduino boards. Hence hardware libraries and scratch extensions are developed as per behaviour of these modules. Brief descriptions of these modules are given in the table below:

Bluetooth ModuleIt’s working
HC-05It is a Serial Port Protocol Bluetooth working on Bluetooth protocol “Bluetooth V2.0+EDR”.
HC-06This is also a Serial Bluetooth module with Bluetooth protocol “Bluetooth V2.0+EDR”. It differs from HC-05 in terms of a few hardware configurations and a fact that it can only be used as a slave.
HM-10 It follows Bluetooth protocol BLE 4.0. Due to the low energy protocol data transfer rate on HM-10 is slower compared to HC-05 and HC-06.
ESP32It is a low-power system on a chip microcontroller with dual-mode Bluetooth and integrated Wi-Fi. ESP32-WROOM-32, ESP32-WROVER, ESP32-DevKitC or any development board based on Espressif ESP32 will work with Dabble.

evive Notes Icon
There are various clone modules available for HM-10. They may or may not perform properly with the app. Hence, if you are using HM-10, then make sure it is the original one.
Hardware Setup
Choose Your Preferred Prototyping Board

The first and foremost thing is connecting the Bluetooth module to the development board. 

Circuit diagram for connecting Bluetooth module with different boards is given below. Choose the board for which you want to setup your Dabble app with.

Diagrams mainly show setup with HC-05 however same pin connection setup goes for HM-10 and HC-06.

Components Required

  1. evive
  2. HC05 Module

Circuit Diagram

You have to connect the HC05 Bluetooth module to evive' Bluetooth headers in the following way:

Components Required

  1. Arduino Uno
  2. HC05 Module
  3. Jumper Cable - Male to Female

Circuit Diagram

You have to connect the HC05 Bluetooth module to Arduino Uno in the following way:

  1. GND of HC05 to GND of Arduino Uno
  2. VCC of HC05 to 5V of Arduino Uno
  3. TX of HC05 to Digital Pin 2 of Arduino Uno
  4. RX of HC05 to Digital Pin 3 of Arduino Uno

 

Components Required

  1. Arduino Mega 2560
  2. HC05 Module
  3. Jumper Cable - Male to Female

Circuit Diagram

You have to connect the HC05 Bluetooth module to Arduino Mega in the following way:

  1. GND of HC05 to GND of Arduino Mega
  2. VCC of HC05 to 5V of Arduino Mega
  3. TX of HC05 to Digital Pin 15 of Arduino Mega
  4. RX of HC05 to Digital Pin 14 of Arduino Mega

Components Required

  1. Arduino Nano
  2. HC05 Module
  3. Jumper Cable - Male to Female

Circuit Diagram

You have to connect the HC05 Bluetooth module to Arduino Nano in the following way:

  1. GND of HC05 to GND of Arduino Nano
  2. VCC of HC05 to 5V of Arduino Nano
  3. TX of HC05 to Digital Pin 2 of Arduino Nano
  4. RX of HC05 to Digital Pin 3 of Arduino Nano

 

Esp32 has onboard Bluetooth, that supports BT classic as well as Bluetooth Low Energy (BLE). Hence there is no need for any external hardware setup for Bluetooth on Esp32.

Install Dabble in your Smartphone
  • Currently, Dabble is available for the Android user and is functioning on Android version 5.0.0 and above. (Dabble will be available for ios devices very soon).
  • You can download the app by scanning the QR code given below or you can also download it from¬† Google Play Store.¬†
    Dabble Google play
Connecting Dabble with Hardware
  • After successfully installing the Dabble, follow below guidelines for connecting Dabble with your Bluetooth module.
  • As soon as you open the app you can see a series of introduction slides appearing in your smartphone that gives you a brief overview of how to interact with Dabble. Go through them.
  • After that main screen containing Dabble modules appear as shown below:

Dabble Home Disconnected

  Now follow the steps below:

  1. Click on Connect icon that appears at the top right corner of your screen beside Settings icon. As soon as you click on Connect icon a dialog box appears asking for permission of turning on location in your smartphone. If you are using HM-10 module then you must grant location permission else you can press skip for now. For HM-10 tap on the screen as asked in dialog box followed by selecting “ALLOW” in the next dialog box.
    Dabble Location PermissionAllow Dabble to Access Location
  2.  Now a list of nearby available Bluetooth can be seen on your screen.
    Dabble Select device
  3. ¬†Check if the name of your Bluetooth module appears in the list. If you have configured name of your Bluetooth module then search for that name. However, if you have not done this then look for names like “HC-05” for HC_05 modules and “HMSoft” for original HM-10 module and “BT-05” kind of name for HM-10 clones. Select that name and you can see the change in state of Connect icon suggesting app has connected to your module successfully.
    Dabble Home Connected
    evive Notes Icon
    Note: A dialog box asking for the Bluetooth password may appear. Enter your Bluetooth module password if you have kept any password or try some default passwords like 0000 or 1234 in case of HC-05 and HC-06 and try 000000 or 123456 for HM-10. 
    evive Notes Icon
    Note: If you are facing some trouble in connecting your module then first try to pair module from your smartphones Bluetooth settings. Follow the troubleshooting page for guidance
  4. As soon as the app is connected to your Bluetooth module you can see the notification in your smartphone telling you which board you have connected.
    Dabble Connected Notification
  5. After reading notification go to Settings icon in your app. You will be able to see information like your app version, hardware library version, and name of the hardware board your smartphone is connected to.

Dabble Settings

Programming the boards for the Module
Choose Your Preferred programming language
evive Notes Icon
Note: Currently evive, Arduino Uno, Arduino Mega, and Arduino Nano are supported in PictoBlox.

Enabling Dabble extension in PictoBlox

  1. Open PictoBlox.
  2. Go to the board menu and select the appropriate board for your project.
    Pictoblox Board Selection
  3. Click on add extension on the left bottom corner. A new window will open showing all the extensions. Select the Dabble extension.
    Load Extensions

New blocks will come in the block palette for the Dabble App:

BlockFunction
enable LED controlThe block allows the user to control the brightness of LED connected to digital pins of the device using Dabble app. You can enter the pin number to which your device is connected and vary the brightness in the app.
is data from terminalThe block compares the latest string message in the terminal with the data input by the user in the block. If the data matches, it returns the true, else it returns false. 
get number from terminalThe block returns a number received from the terminal module of the Dabble app.
send to terminalThe block sends the written message on the terminal module of the Dabble app.
is pressed on gamepadThere are 10 digital buttons in the gamepad module, whose data is sent to the device when they are pressed or released. The block reports whether the button is currently pressed on the gamepad or not. If the chosen button is pressed, then it returns true, else it returns false. 
get from gamepadThe block returns the real-time value of the selected parameter (X value, Y value, radial value, and angle) form the joystick and accelerometer mode of the Gamepad module of the Dabble app. You can choose the parameter from the drop-down menu.
enable pin state monitorThe block allows the user to remotely monitor the live status of devices and debug them by displaying the values of all the pins ‚Äď both digital and analog.
enable motor controlThe block allows the user to control actuators such as DC motors and servo motors from the Motor control module of the Dabble app.
is tactile switch pressedDabble inputs module have two tactile switches. This block reports the state of the tactile switch (pressed or not) in real-time. If the switch is pressed, then it returns true else false.
is slide switch pressedDabble input module have 2 slide switch type input, having states left, right and off. This block reports if the selected slide switch is in the selected state in real-time. If the slide switch is in that state, then it returns true else false.
get potentiometer valueDabble input module has 2 potentiometers whose value can be varied from 0 to 1023 by the user. This block reports the current value of the selected potentiometer.
get sensor reading 2Dabble phone sensor module give the real-time reading of the following sensors to evive: Accelerometer, gyroscope, proximity sensor, magnetometer, light meter, sound meter, GPS, temperature sensor and barometer. This block reports the current value of the selected sensor.
refresh dataThis block refreshes the data sent to the hardware device from Dabble app.

You can work on two modes in Pictoblox while using Dabble App:

  1. Stage Mode: In this mode, you can write scripts for the sprite and board and control it in real time. If you disconnect the board, you cannot control it anymore.
  2. Upload Mode: This mode allows you to write scripts and upload them to your board so that you can control even when it is not connected t your PC/laptop.

Example – Enabling LED Control

In this section, we will use a very basic ‚ÄúLED Brightness Control‚ÄĚ module and control onboard led pin 13¬† present on evive or Arduino boards.

At first, let‚Äôs look at the user interface of LED Brightness Control‚ÄĚ present in your smartphone.

This module allows you to control the output of the digital pins in two ways:

  1. If the pin is a digital pin with no PWM support, then you can control the HIGH and LOW state of the LED by clicking on the ON/OFF icon present in the centre of the module. 
    Dabble LED Brightness Value 0
    LED Brightness module controlling digital pin 13. The current state of LED is set to OFF.
    Dabble LED Brightness Value 100
    LED Brightness module controlling digital pin 13. The current state of LED is set to ON.
  2. If the digital pin is a PWM pin, then you can also control the brightness of the LED, using the module. You can adjust the brightness value between 0 to 100 using the potentiometer type knob with the green bar as seen in the image.

Make the following program to enable LED control:

Enable LED control example

Switch to the Upload mode, by clicking on the toggle switch right above the stage.

On doing so, the Arduino code will appear instead of the stage. In the Upload mode, there are three buttons replace the green flag and red octagon from the Stage mode. The second button is to upload the code to evive. Click on the button and upload the code.

Upload Code Button

Connect your app and control the LED.

After successfully installing Dabble in your smartphone and pairing it with the Bluetooth module, it is now time to follow a few final steps for establishing communication between your smartphone and the hardware. For working with Dabble on Arduino IDE, you need to first install Dabble library for Arduino boards. (Dabble library for Esp32 is coming soon).

Get Dabble Library for your Hardware

You can get theDabble library for Arduino IDE by clicking on this zip file.  

Now follow below-mentioned steps for adding Dabble library in Arduino Ide:

  1. Open Arduino IDE and navigate to Sketch>>Include Library>> Add .ZIP library.
  2. A dialogue box as shown in the image below appears. Select your zip folder from the location where it was downloaded and then click “Open”.
  3. As soon as the library is installed you can see “Library added to your libraries. Check “Include library”menu.” message at bottom of your Arduino IDE screen.

Flash code to your Board

In this section, we will use a very basic “LED Brightness Control” module and control onboard led pin 13¬† present on evive and Arduino boards.

At first, let’s look at the user interface of LED Brightness Control” present in your smartphone.

This module allows you to control the output of the digital pins in two ways:

  1. If the pin is a digital pin with no PWM support, then you can control the HIGH and LOW state of the LED by clicking on the ON/OFF icon present in the center of the module. 

    Dabble LED Brightness Value 100

  2. If the digital pin is a PWM pin, then you can also control the brightness of the LED, using the module. You can adjust the brightness value between 0 to 100 using the potentiometer type knob with the green bar as seen in the image.

Since we are going to control LED pin 13 and it is a PWM pin hence we will be able to turn led ON/OFF and also vary its brightness with potentiometer knob.

  • Now navigate to “File>Examples>Dabble” there you can see other three sub-folders namely “BluetoothBaudSettings”, “evive” and “Uno_Nano_Mega”.
  • Depending upon your board type navigate to that sub folder there you can see “LedBrightnessControl” example open that example.¬†

    evive Notes Icon
    Before running this example code make sure that you know the baud rate of your Bluetooth module. If you don’t know your Bluetooth module baud rate and are using the HC-05 module then go to “BluetoothBaudSettings” folder and open example code as per your board type and read Baud Settings of your Bluetooth module.
    evive Notes Icon
    Depending on board types default baud rate used in example codes is 115200 for evive and 9600 for Mega, Uno and Nano boards. If your current baud rate settings don’t match these cases then at first change your baud rate to either of these values as per your board.¬†
  • Upload the LedBrightnessControl code on your board. Now press ON/OFF button in LED Brightness Control Module to turn led on or off. And move the knob to vary the brightness of your Led.
  • Also, you can open your serial monitor to see data like pin Number, Led State and Brightness control value transmitted from your smartphone.

 

Now, let’s look at the basic structure of the above-written code. There are four basic parts of your code namely – Header, Initialize Bluetooth communication, Refreshing Data, and Functions.¬† Codes for all the modules can be categorized in these parts.

Header

In this part, you define certain macros names depending upon which module you want to use. There are unique define terms(macro) made for each module. Go through all module examples to know them. 

For example, to use the LED Control module in the Arduino program, you have to define the following header:

#define CUSTOM_SETTINGS

#define INCLUDE_LEDCONTROL_MODULE

After defining the above mention headers, you have to include the dabble library:

#include <Dabble.h>

Enabling Bluetooth Communication

To enable Bluetooth communication, you have to initialize serial communication using the following code:

Dabble.begin(Baud_Rate);

Here Baud_Rate is the baud rate set for the Bluetooth module. With evive, you normally get 115200 baud rate modules and for other boards Baud_Rate is set to 9600. You must keep your Bluetooth baud rate same as Baud_Rate. 

Refreshing the data

To refresh the data that the device gets from the mobile app, you have to use the following line of code:

Dabble.processInput();

This function is included in the loop of each example code for processing the data obtained from your mobile.

In this example, this function changes the state and the brightness of the LED.

Functions

As shown in the example code it prints data like pin number, its state and brightness on Serial Monitor. For this it uses the following functions:

  1. LedControl.getpinNumber(): This function returns the pin selected for LED Brightness control in the mobile app. The function returns int data type.
  2. LedControl.getpinState(): The function returns the state of the pin set by the user in the mobile app. This function returns the following output:
    1. 1 if the state is set to ON
    2. 0 if the state is set to OFF
  3. LedControl.readBrightness(): This function returns the brightness value set by the user in the mobile app. It returns int data type with a value ranging between 0 and 100.

If you don’t want to read data coming from your phone and just want to execute Led module functioning then you can avoid the use of these functions in your code.

This module also allows you to change pin which you are controlling. For this tap on the “Pin” button and write your desired pin number. You can also change brightness value by tapping on “Value” and entering the desired value.

This section will guide you on using Gamepad module of Dabble with ESP32. A complete library for using Dabble modules will be coming soon. For now you can download DabbleGamepad.zip library for using Gamepad. For working on ESP32 with Arduino IDE you first have to install ESP32 board on Arduino IDE. If you don't know anything about ESP32 board installation then first refer getting started with ESP32. 

Game Pad_Connected

The image above shows Digital Mode of Gamepad Module. There are two more mode present in this module. You can go to Gamepad module description to explore more about it.

Add the downloaded zip file of library to Arduino IDE. To learn how to add zip file of library to Arduino IDE follow this link.¬†After successfully installing library goto ‚ÄúFile>Examples>DabbleGamepad>GamePad_ESP32‚ÄĚ.

Functions

begin(Bluetooth_Name) -   initializes  BLE(Bluetooth Low Energy) on ESP32 with the name written in place of  "Bluetooth_Name".

processBleData() - This function should be continuously called in loop to refresh data received from Dabble app.

Function Return Type Function Brief Decription Returning Value
isUpPressed() Boolean The function tells whether the Up button is pressed or not. 1 when Up button is pressed; 0 when Up button is not pressed.
isDownPressed() Boolean The function tells whether the Down button is pressed or not. 1 when Down button is pressed; 0 when Down button is not pressed.
isLeftPressed() Boolean The function tells whether the Left button is pressed or not. 1 when Left button is pressed; 0 when Left button is not pressed.
isRightPressed() Boolean The function tells whether the Right button is pressed or not. 1 when Right button is pressed; 0 when Right button is not pressed.
isTrianglePressed() Boolean The function tells whether the Triangle button is pressed or not. 1 when Triangle button is pressed; 0 when Triangle button is not pressed.
isCirclePressed() Boolean The function tells whether the Circle button is pressed or not. 1 when Circle button is pressed; 0 when Circle button is not pressed.
isCrossPressed() Boolean The function tells whether the Cross button is pressed or not. 1 when Cross button is pressed; 0 when Cross button is not pressed.
isSquarePressed() Boolean The function tells whether the Square button is pressed or not. 1 when Square button is pressed; 0 when Square button is not pressed.
isStartPressed() Boolean The function tells whether the Start button is pressed or not. 1 when Start button is pressed; 0 when Start button is not pressed.
isSelectPressed() Boolean The function tells whether the Select button is pressed or not. 1 when Select button is pressed; 0 when Select button is not pressed.
getAngle() Integer This function returns the angle value between the x-axis and the line joining the dot and the center of the joystick. The value varies form 0 to 360 degrees with a step of 15 degrees.
getRadius() Integer The function returns the distance between the center of the joystick and the dot. The value varies from 0 to 7.
getx_axis() float The fuction returns the x postion of the dot on the joystick. The value varies from -7 to 7.
gety_axis() float The fuction returns the y postion of the dot on the joystick. The value varies from -7 to 7.

 

Code Explanation

The example code present in library shows all the functions that can be used in getting different parameters transmitted from Gamepad. To explain this data received from various function is printed on Serial Monitor.

Leave a Reply

Oscilloscope (Coming Soon)
Touch Tune (Coming Soon)
Camera (Coming Soon)
IoT (Coming Soon)
Projects (Coming Soon)

Leave a Reply

Close Menu
√ó

Cart

STEMpedia Starter Kit is now available on Indiegogo!
STEMpedia Starter Package is now on Indiegogo!
Get 41% OFF with Super Early Bird discounts!
x