Interface Dabble (Project Making App) with Arduino

Dabble Bluetooth Home Automation
Description
Learn how to control a servo motor with your smartphone using Dabble and PictoBlox in this tutorial. We show you step-by-step how to interface the Bluetooth module to Arduino Uno and use the Terminal module of Dabble to send commands to the board.

Introduction

Once you are there on the bed or sofa, you hate to get up to open the door. Well, this tutorial is the perfect solution. By the end of this tutorial, you will be able to open/close the door or any ON/OFF any motor by just typing a few words on your Smartphone. All of this is possible because of Dabble: a project-making app, that transforms your Smartphone into many virtual shields.

In this tutorial, we are going to interface a servo motor to Arduino Uno and control it wirelessly using Smartphone via Bluetooth Module. Also, the entire process just got easy as you are going to code the entire program in PictoBlox, a graphical programming software that eliminates the need to worry about syntax.

You can download Dabble from Play Store and PictoBlox from here.

Let’s begin!

Interfacing the Bluetooth Module and the Servo

  1. Let’s connect the Bluetooth module(HC05) to Uno. It will help us pair our Smartphone with the board via Bluetooth.
    1. Connect the VCC pin to Uno’s 5V pin using a red male-to-female jumper cable.
    2. Next, connect the ground pin to Uno’s ground pin using a black male-to-female jumper cable.
    3. Now, connect the transmit pin (Tx) to Uno’s digital pin 2 using a green male-to-female jumper cable.
    4. Then, connect the receive pin to Uno’s PWM pin 3 using a blue male-to-female jumper wire.
  2. Now, let’s connect the servo to Uno.
    1. Connect the servo’s brown wire to Uno’s ground pin using a black male-to-male jumper cable.
    2. Next, connect the red wire to Uno’s VIN pin using a red male-to-male jumper cable.
    3. Then, connect the orange wire to Uno’s PWM pin 5 using a yellow male-to-male jumper cable.bluetooth + Uno + Servo
  3. Connecting Uno to the computer.
    1. First, open PictoBlox.Then, connect Uno to your computer via a USB cable.
    2. Next, click on the Board button in the toolbar and select Arduino Uno from the drop-down menu.
    3. Then, click on the Connect button and select the appropriate port.connect uno to PictoBlox

Activity: Control Servo with a Smartphone via Dabble

Writing the Code

Now, let’s write the script to control the servo in PictoBlox.

  1. Click on the Dabble palette. You’ll see that it has blocks for all the different modules of the app such as LED control, Terminal, Gamepad, Motor Control, etc. We’re going to give textual commands using the Terminal module to control the door. 
  2. First, let’s work on closing the door. It should close if the command given is ‘close’So, drag and drop an if block into the scripting area.if block
  3. Then, drag and drop the is data from terminal block into the hexagonal space of the if block and write close in the white space.is data from terminal block 
  4. Next, drag and drop the set servo block and set the angle to zero degrees.
  5. Now, to open the door, we must send the command ‘open’.
  6. Duplicate the entire set of blocks and stack the two.
  7. Now, write open in the white space of the second is data from terminal block and change the servo angle to 45 degrees.set two if blocks
  8. Add a forever block to the script from the Control palette.
  9. Drag and drop the set bluetooth baud rate to block above the forever block and set the baud rate to 9600.set baudrate block
  10. Finally, drag and drop the hat block. Our script is now complete!Complete script
  11. Upload it to Uno by switching to the Upload mode and clicking on the Upload Code button.Uploading

 

Pairing Dabble with Uno

  1. Install Dabble from Play Store and open it on your Smartphone.
  2. Next, click on the connect-disconnect icon.
  3. A dialogue box will appear on the screen asking for permission to turn on Bluetooth. Click on ‘Allow’.
  4. Once you do so, a list of nearby devices will appear. Select your device’s name.
  5. In case you don’t see it on the list, go to the Bluetooth settings of your Smartphone and search for it there.
  6. If your Smartphone asks for a password to pair it with the device, enter the default password. For HC-05 and HC-06, it is 0000 or 1234. For HM-10 it is 000000 or 123456.
  7. A notification will appear in the drop-down menu of the phone once the connection is made.
  8. Now, open the Terminal module and you’re ready to go!Control Actuator using Smartphone

Project

Let’s try implementing this tutorial in the miniature house that we have made. Connect the Bluetooth module of the house to Dabble. Once done, open Terminal Module and type the command. Don’t even want to type the commands, voice commands are here to save your day!Dabble Hut

You can try controlling the other components like the lights of your house.

Conclusion

In this tutorial, we have learned how to control a servo motor wirelessly using Dabble and PictoBlox. We have interfaced the Bluetooth module to Arduino Uno and used the Terminal module of Dabble to send commands to the board. We have also seen how to use voice commands to control the components of the miniature house. With this tutorial, you are now able to open and close the door of your house with ease, just by using a few words on your Smartphone.

Table of Contents