ftDuinoBlue - Control your Arduino or ESP32 from Android

ftDuinoBlue allows you to add a custom remote bluetooth user interface to your ftDuino, Arduino or ESP32 Micropython project. On Android it's using a matching bluetooth module. On ESP32 the built-in Bluetooth is being used. Both work with the free ftDuinoBlue Android app.


ftDuinoBlue controlled fischertechnik robot (Video)

If you e.g. add the follwing XML to your sketch:

<layout orientation='portrait' name='ftDuinoBlue Led Demo'> <switch id='1' size='20' width='parent' place='hcenter;top'>LED on/off</switch> <label id='2' size='20' place='left;below:1'>LED brightness</label> <slider id='3' width='parent' max='255' place='hcenter;below:2' /> <label id='4' size='20' place='left;below:3'>Blink speed</label> <slider id='5' width='parent' place='hcenter;below:4' /> </layout>

This will create the following user interface in the Android app:

More details can be found in the examples.

How it works

What you need

Only very few and cheap parts are needed:

Getting started

Although ftDuinoBlue was designed for and with the ftDuino and its Bluetooth adapter it can equally well be used with the Arduino Uno or most other Arduinos and even a MicroPython equipped ESP32. This section describes a most simple Arduino Uno based setup as well as the ftDuino setup ftDuinoBlue was designed for.

Getting started with an Arduino Uno

The most simple setup to give ftDuinoBlue a test on real hardware is based on the Arduino Uno and a HM-10 bluetooth module.

Parts needed:
  • Arduino Uno
  • HM-10 bluetooth LE module
  • LED
  • 1 kOhm resistor

Plug the HM-10 straight into digital pins 8 to 13 of the Uno starting with the HM-10's STATE pin in the Unos pin 8. This requires some addtional software configutaion to provide e.g. power via pin 12 of the Uno to the HM-10. The demo sketch takes care of that if you enable the setup for the Uno by uncommenting the appropriate line:

      // #define USE_I2C_BT   // ftDuino with ftduino i2c bluetooth adapter 
      // #define USE_SERIAL1  // ftDuino as explained at https://harbaum.github.io/ftduino/www/manual/experimente.html#6.19.2
      #define USE_UNO_SU      // Arduino Uno with HM-10
    

Then simply load the demo sketch onto the Uno. The LED on the HM-10 should start flashing as well as the on-board user LED of the Uno. You can now connect to the Uno using the ftDuinoBlue app and control the Unos on-board LED. Adjusting the brightness does not work work on the Uno since the LED is not connected to a PWM capable pin. But you can still use the user interface to start and stop the LED blinking and to adjust the blink frequency.

Getting started with an ftDuino

ftDuino with bluetooth adapter

ftDuinoBlue was designed to be used with the ftDuino and its bluetooth adapter. The entire setup is plug'n play and doesn't require any soldering. The demo sketch works with this setup out of the box and controls the intenal LED as well as a lamp connected to ftDuino output O1.

The ftDuino integration for the Arduino-IDE also includes ftDuinoBlue examples including:

Getting started with Micropython on ESP32

Make sure you have Micropython installed on your ESP32. Then install the three files from here onto the ESP32's file system using your favorite tool like ampy or µPIDE.

The demo expects a LED to be connected to GPIO2 of the ESP32. This is the case with the ESP32 Devkit. You can use a LED on a different port by changing this line.

Once the script is running the ESP32 will be detected by the ftDuinoBlue Android App and the blinking LED can be controlled.