Like I said, this project is a advanced bettering of the project "Presence Detector with an Alarma 1.0 (for Dinohedges)." Word Dinoseto means something like Dinohedge, that is, a dinosaur made of hedge in Vigo city (Galicia, Spain). We have added a BLE (Bluetooth Low Energy) HM-10 module, which permits to control the presence detector through an app created by means of App Inventor2; but we also can substitute this module for a HC-06 that it's classic bluetooth. In the case of using the HC-06, the robot is managed with another app. For controlling the HM-10 with a Android mobile, Bluetooth 5 is needed. I used an Samsung Galaxy A50 mobile. Also you have to have the mobile ubication configuration enabled. I have attached now all the necessary complete Arduino code and updated apk file with new funtionalities, like an object recognizer based on Artificial Intelligence, machine learning exactly.
The aim is to create an presence detector that could have the shape of a kind of dinosaur made of hedges ("setos" in Spanish) called Dinoseto, famous in Vigo city (Spain, Galicia, Pontevedra.) And here I comment the prototype, although without a dinosaur built .
Configuration of HM-10 BLE module, DSD Tech. AT commandsConnect directly an Adafruit TTL serial to USB cable to an HM-10 to configurate with AT commands. Open also a Serial Monitor like the one of Arduino IDE. Help yourself if necessary with Huamao web (the web navigator can advise you not to go to the web, but I had no problems.)
I used this AT commands:
- AT+BAUD4 (115200);
- AT+ROLE0 (peripheral);
- AT+NAME(AlarmBLE for example);
- AT+PASS (6 numbers);
- AT+TYPE1 (Authentication, no need PIN. Nevertheless on reality it asks for pin)
- AT+IMME0 (When power on, module will start work immediately);
- AT+RESET (Restart);
The following it is not necessary, only if we used BLE capabilities:
- AT+UUID0xFFE0;
- AT+CHAR0xFFE2 (Optional. Switch off FFE2 characteristic. Adds write possibility to FFE1 characteristic)
- I also used the "nRF connect for mobile app" downloaded from Google Play Store. For detecting my HM-10 BLE module and proving the functioning of reading and writing that belong to the "unknown service" and its characteristics. That is, I send a string to the HM-10 module and it appears at the other end, on the serial monitor of Arduino IDE. I send an string from the serial monitor through the HM-10 and it appears on the nRF connect for mobile app.
Informative video:
Go to extensions, use the documentation and resources and download the BLE extension: edu.mit.appinventor.ble-20181124.aix
Also you can use a base to create your first BLE app.
The BLE extension have to be imported to your app on the Blocks tab ---> Extensions ---> Import Extensions.
I have created the app for the project and have to say that although the BLE extension is very useful, it seem to give some problems with some blocks when you open the .aia file again on another session. The issue was no more than I had two BLE extensions loaded. One that came with the project in what I based mine, and the one that I loaded for update the extension. Solution is to erase the old from the .aia file, that is a kind of.zip file.
The .apk file works properly. I have attached it on the "Schematics and circuit diagrams" headland. It has two screens in the new version. The picture below is a screen for mange the presence detector. Another screen manage a kind of object classificator.
To download the .apk file of the app go to Schematics section of Attachments, also downloadable here. If there is a problem, please let me know it through a message.
Arduino CodeDownload it from Arduino IDE to the Arduino UNO through an USB cable. Before, take off the HM-10 module to avoid disturbances with serial communication to a screen. Once downloaded, put on the HM-10 BLE module again.
Possible betteringsMaybe we could use the sleep mode of the HM-10 and awake it by UART.
DonateIf you have liked our posts, please consider to donate so we can go on.
Comments