Now that everything is connected inside, I upload the final code that you can download from below. Also download the Android App that I’ve designed, copy it to your smartphone using a USB cable and then install it. Let’s make a test. I connect 12V and turn on the Arduino. In bluetooth, I search for new devices and I pair toi the HC-05 module using 1234 or 0000 password. Now I open my App. Press the bluetooth icon and select the HC05 module and you will see that the LED will stop blinking. I can rotate the motor up and down. When I press the home button, as you can see on the tutorial video, the motor will rotate in one direction till I place a magnet in front of the hall sensor. When that happens, it stores the home position and we can use it normally. Use the arrows on the app to lower or rise the curtain. So everything seems to work ok.
#include <SoftwareSerial.h>
#include <EEPROM.h>
const byte rxPin = 10;
const byte txPin = 11;
// Set up a new SoftwareSerial object
SoftwareSerial HC05 (rxPin, txPin);