Friday, February 16, 2018

Arduino Bluetooth (BLE) Robot Buggy with L298 (Android example) 

 
Use you Mobile Phone to control the ESP32 Arduino Robot

 

Bought one of the cheap Arduino Robot Car Kits from aliexpress (scroll at https://www.aliexpress.com/wholesale?SortType=price_asc&SearchText=arduino+robot+car).

Using the ESP32 with four GPIO Pins (18,19,22,23) to the four Inputs of the L298 Module:

ESP32 and L298
The L298 is a dual full-bridge driver and a datasheet can be found here http://www.st.com/en/motor-drivers/l298.html 

L298 Module

3V-6V Motor with gears

Than wrote the Arduino software using the BLE_UART example based on Neil Kolban example for IDF (https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp). This is based on NUS (Nordic UART Service) to provide a defined BLE Service with two Characteristics and known UUIDs. 

#define SERVICE_UUID           "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" 
#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"

Bluetooth Low Energy Server




To send BLE commands I use the Android App nRF Toolbox from Nordic Semiconductor (https://play.google.com/store/apps/details?id=no.nordicsemi.android.nrftoolbox&hl=en).
nRF Toolbox for Android

And define the keys for the commands "up","down","left","right" by pressing EDIT and after configuration press DONE.

nRF Toolbox by Nordic Semiconductor
Don't forget to enable Bluetooth on your Phone.

ESP32 Arduino BLE Robot Buggy

See the Robot car in action: https://youtu.be/lUi2jhFIz80