Remote engine start from a smartphone is the dream of any car owner, especially in frosty winters or hot summers. But ready-made solutions from alarm manufacturers often require a subscription fee, have limited functionality, or work only with specific models. What if you create your own autorun application on Androidthat will be completely under your control?

In this article we will figure out how to implement such a solution - from choosing the hardware to writing code and setting up communication between the phone and the car. You will learn which GSM modules and relays are suitable for most alarms (StarLine A93, Pandora DXL 3500, Scher-Khan Magicar 13), how to set up data exchange via SMS or TCP/IP, and what safety measures must be taken into account so as not to turn your car into easy prey for hijackers.

Important: the project requires basic knowledge in electronics and programming. If you have never worked with Arduino or MIT App Inventor, some steps may seem complicated - but we will try to explain everything in as much detail as possible, with visual diagrams and code examples.

๐Ÿ“Š What experience do you have in creating applications for Android?
None, only the user
I know the basics (MIT App Inventor, B4A)
I write in Java/Kotlin for Android
Worked with Arduino and IoT projects

1. What you will need to create an autorun application

Before you begin development, collect all the necessary components. They can be divided into three categories: hardware part (installed in the car), software part (application on the phone) and communications (transfer of commands).

Without the right choice of equipment, even the most advanced application will not be able to control autorun. For example, if your alarm does not support external control via CAN bus or Lin bus, you will have to use workarounds with relays, which will complicate the circuit.

  • ๐Ÿ“ฑ Android smartphone (version no lower 8.0 for stable work with Bluetooth 5.0 and GSM modules)
  • ๐Ÿ”Œ GSM module (SIM800L, SIM7000E or Quectel M66 - proven options for working with 2G/3G networks)
  • ๐Ÿ”ง Relays (opto-isolated, for example, Songle SRD-05VDC-SL-C for safe control of 12V circuits)
  • ๐Ÿ”Œ Power supply 12Vโ†’5V (for power supply Arduino and GSM module from the on-board network)
  • ๐Ÿ–ฅ๏ธ Microcontroller (Arduino Nano, ESP32 or STM32 โ€”the latter is preferable for complex tasks)
  • ๐Ÿ”— Wires and connectors (cross-section of at least 0.75 mmยฒ for power circuits, heat-shrinkable tubes for insulation)
  • ๐Ÿ“ก GSM antenna (included with most modules, but for reliable reception in underground parking lots an external one may be required)

If your alarm system already supports remote control via StarLine, Pandora or another brand, you donโ€™t have to buy some of the equipment - just connect to it CAN bus or emulate the operation of a standard key fob. However, this will require a detailed diagram of the data exchange protocol of your model, which manufacturers rarely disclose publicly.

โš ๏ธ Attention: Connecting to standard vehicle systems (CAN, LIN) without knowledge of the protocols can lead to failures in the operation of electronics or protection. For experiments, use separate relays without affecting critical circuits.

2. Selecting a communication method: SMS, TCP/IP or Bluetooth

The reliability, speed of response and security of the system depend on the method of transmitting commands. Let's consider the pros and cons of each option:

Communication method Pros Cons Complexity of implementation
SMS commands

โœ… Works wherever there is coverage

โœ… Does not require Internet on the phone

โœ… Easy debugging (commands are visible in the message history)

โŒ Delay up to 30 seconds

โŒ Fee for SMS (with active use)

โŒ Vulnerability to SIM card interception

Low
TCP/IP (GPRS/3G)

โœ… Instant command transmission

โœ… Encryption capability traffic

โœ… Support for feedback (temperature, status)

โŒ Requires Internet on the phone and SIM card module

โŒ More difficult to configure (port forwarding, DDNS)

โŒ Risk of DDoS attacks if configured incorrectly

High
Bluetooth (HC-05/HC-06)

โœ… No subscription fee

โœ… Low power consumption

โœ… Easy to connect

โŒ Only works within a radius of 10-20 meters

โŒ Not suitable for remote start

โŒ Connection problems in busy parking lots

Average

For most users, the optimal solution will be combined approach: SMS for remote control and Bluetooth for setting parameters near the car. TCP/IP should be considered only if you are ready to understand network protocols and ensure the security of data transmission.

An example of a command to start the engine via SMS:

AT+CMGS="79123456789"

> START123#

+CMGS: 12

OK

Where START123# is the start command, and 123 is the PIN code for protection.

๐Ÿ’ก

Use virtual SIM cards (for example, from Tele2 or MTS) with unlimited SMS for testing - this will save money at the debugging stage.

3. Equipment connection diagram in the car

Before installation, be sure to disconnect the battery check all connections for short circuits with a multimeter. Below is a basic circuit for controlling autostart via a relay, compatible with most alarm systems:

1. Power:

- Arduino/ESP32 connects to 12V on-board network via a stabilizer 5V (for example, AMS1117).

- GSM module also requires 5V, but with a separate stabilizer (current consumption up to 2A during data transmission).

2. Start control:

- The relay is connected in parallel with the engine start button (if the alarm does not support CAN).

- To emulate pressing, use transistors (IRLZ44N) or optical relays.

3. Feedback:

- Connect the temperature sensor (DS18B20) to 1-Wire port Arduino to control engine warming up.

- The start status signal can be removed from the charging lamp or tachometer (via an optocoupler PC817).

Scheme in text form:

On-board network 12V

โ”‚

โ”œโ”€โ”€โ”€[Fuse 5A]โ”€โ”€โ”€[Stabilizer 5V]โ”€โ”€โ”€ Arduino

โ”‚ โ”‚

โ”œโ”€โ”€โ”€[Stabilizer 5V 2A]โ”€โ”€โ”€ GSM module

โ”‚ โ”‚

โ””โ”€โ”€โ”€[Relay 12V]โ”€โ”€โ”€[Transistor]โ”€โ”€โ”€ Arduino (output D7)

โ”‚

โ””โ”€โ”€โ”€ Engine start button (in parallel)

โš ๏ธ Attention: Do not connect the relay directly to Arduino without transistors or optocoupler - this can burn the microcontroller outputs. Use a circuit with NPN transistor (for example 2N2222) and a reverse current diode (1N4007).

For alarms with CAN bus (for example, StarLine B9) instead of a relay you will need CAN transceiver (MCP2515) and a library for working with the protocol. However, without documentation for your model, it will be difficult to understand the commands. difficult.

Are all bare wires insulated?|Has the voltage at the output of the stabilizers been checked (exactly 5V)?|Is the relay connected with the correct polarity?|Is there a fuse on the power lines?|Is the battery disconnected before installation?-->

4. Programming the microcontroller (Arduino/ESP32)

Code for Arduino will consist of three main parts:

1. Processing incoming commands (SMS or TCP).

2. Relay control for starting the engine.

3. Sending feedback (status, temperature).

Example code for working with SIM800L and SMS commands:

#include 

SoftwareSerial sim800l(7, 8); // RX, TX

void setup() {

sim800l.begin(9600);

pinMode(13, OUTPUT); // Start relay

digitalWrite(13, LOW);

delay(1000);

sim800l.println("AT+CMGF=1"); // Text mode SMS

delay(100);

sim800l.println("AT+CNMI=2,2,0,0,0"); // Setting up notifications

}

void loop() {

if (sim800l.available()) {

String message = sim800l.readString();

if (message.indexOf("START123#") != -1) {

digitalWrite(13, HIGH); // Close the relay

delay(1000); // Simulate a button press

digitalWrite(13, LOW);

sim800l.println("AT+CMGS=\"79123456789\"\r");

delay(100);

sim800l.print("The engine is running. Temperature: 25C");

sim800l.write(26); // Ctrl+Z to send

}

}

}

For ESP32 it is better to use WiFi or Bluetooth instead of SMS. Example code for TCP server:

#include 

WiFiServer server(80);

void setup() {

WiFi.begin("AutoStart", "password123");

while (WiFi.status() != WL_CONNECTED) delay(500);

server.begin();

}

void loop() {

WiFiClient client = server.available();

if (client) {

String request = client.readStringUntil('\r');

if (request.indexOf("/start") != -1) {

// Engine start logic

client.print("The engine is running!");

}

client.stop();

}

}

For debugging, use Arduino IDE or PlatformIO. Only upload code to the microcontroller after checking all connections! At the testing stage, connect Arduino to USB a laptop and monitor the output via Serial Monitor.

How to protect the code from copying?

For basic protection you can use:

1. IMEI check GSM module (binding to specific device).

2. Command encryption (for example, XOR with a fixed key).

3. Dynamic PIN codetime-varying (as in Google Authenticator).

However, all these methods do not provide 100% protection - for serious projects, consider using secure boot on ESP32 or ATMEGA with memory reading blocked.

5. Android application development

There are three main ways to create an application to manage autorun:

  • ๐Ÿ“ฑ MIT App Inventor โ€”a visual designer that does not require knowledge of code. Suitable for simple interfaces with buttons and sending SMS.
  • ๐Ÿ’ป Android Studio (Java/Kotlin) - full control over the functionality, but requires programming experience.
  • ๐Ÿ”ง Tasker + AutoNotification - automation without writing code (suitable for SMS-control).

Let's consider the simplest option on MIT App Inventor:

1. Create a project and add components:

- Button ("Start engine" button)

- Texting (for sending SMS)

- Notifier (status notifications)

2. Button logic (blocks):

- When pressed, send an SMS to the number GSM module with the text START123#.

- Wait for a response SMS and show it in the notification.

Example code for Android Studio (sending TCP commands):

public class MainActivity extends AppCompatActivity {

private Socket socket;

public void startEngine(View view) {

new Thread(() -> {

try {

socket = new Socket("192.168.4.1", 80); // IP ESP32

PrintWriter out = new PrintWriter(socket.getOutputStream(), true);

out.println("GET /start HTTP/1.1");

socket.close();

runOnUiThread(() -> Toast.makeText(this, "Command sent!", Toast.LENGTH_SHORT).show());

} catch (Exception e) {

e.printStackTrace();

}

}).start();

}

}

To work with Bluetooth use the library Android Bluetooth API. Connection example:

BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

BluetoothDevice device = adapter.getRemoteDevice("00:11:22:33:44:55"); data-i="242">โš ๏ธ Attention: Applications using

BluetoothSocket socket = device.createRfcommSocketToServiceRecord(UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"));

socket.connect();

OutputStream out = socket.getOutputStream();

out.write("START".getBytes());

โš ๏ธ Attention: Applications that use SMS or Bluetoothrequire permission android.permission.SEND_SMS and android.permission.BLUETOOTH_CONNECT v AndroidManifest.xmlIn new versions of Android (12+) you also need it. request these permissions during execution.

6. Security settings: how to protect your car from hacking

Homemade auto start systems often become a tasty target for car thieves. Here are the key protection measures:

  • ๐Ÿ” Two-factor authentication: in addition to the PIN code in SMS, require confirmation through a second device (for example, Telegram-bot).
  • ๐Ÿ“ก Geofences: allow startup only when the phone is within a radius of 500 meters from the car (via GPS).
  • ๐Ÿ”„ Dynamic commands: change the PIN code every day according to the algorithm (for example, MD5(current_date + secret_key)).
  • ๐Ÿ›ก๏ธ Traffic encryption: for TCP/IP use SSL/TLS (library BearSSL for ESP32).
  • ๐Ÿšจ Time blocking: if more than 5 commands arrived in 10 minutes, ignore all the following (brute force protection).

Example of implementing a geofence on Android:

LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE);

Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);

if (location != null) {

float distance = location.distanceTo(new Location("car") {

{

setLatitude(55.7558); // Car coordinates

setLongitude(37.6173);

}

});

if (distance > 500) {

Toast.makeText(this, "Launch is allowed only within a radius of 500m!", Toast.LENGTH_LONG).show();

return;

}

}

For GSM module configure filtering of numbers:

sim800l.println("AT+CPBS=\"SM\"" // Select SIM card memory

sim800l.println("AT+CPBW=1,\"+79123456789\",129,\"Owner\""); // Save resolved number

This will allow the module to accept commands only from pre-added numbers.

Do not store passwords and PIN codes in clear text in the application code! Use Android Keystore or SharedPreferences with encryption:

KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");

keyStore.load(null);

KeyGenerator keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore");

keyGenerator.init(new KeyGenParameterSpec.Builder("my_key", KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)

.setBlockModes(KeyProperties.BLOCK_MODE_CBC)

.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)

.build());

SecretKey secretKey = keyGenerator.generateKey();

๐Ÿ’ก

Even with the most reliable protection, do not leave the car with the engine running unattended in crowded places. Homemade systems are not certified and may have vulnerabilities unknown to the developer.

7. System testing and debugging

Before final installation in the car, carry out tests in safe conditions:

  1. Laboratory assembly: connect all components on the table with the power supply 12V. Check the response to commands without connecting to the car.
  2. Communication test: send an SMS command and make sure that Arduino processes it correctly (use Serial Monitor for debugging).
  3. Checking the relay: connect the LED instead of the start button - it should light up for 1 second when commanded.
  4. Failure simulation: turn off the power during operation, check if it freezes whether a microcontroller. Add watchdog (lines wdt_enable(WDTO_8S); for AVR).
  5. Test in the car: connect the circuit to the alarm, but do not start the engine - first check the relay operation by sound (click).

Typical errors and their solutions:

Problem Possible cause Solution
SMS is not sent No network coverage or incorrect APN Check SIM card balance and settings AT+CGDCONT
Arduino does not respond to commands Port conflict or incorrect speed baud rate Install sim800l.begin(9600) and check the RX-TX connection
The relay clicks, but the engine does not start Insufficient current or wrong polarity Use a relay with 12V coil and check the connection to button
The application does not connect via Bluetooth UUID mismatch or unpaired devices Delete the old pairing and use the standard one UUID for SPP

For debugging TCP/IP connections, use Wireshark or tcpdump on the phone (required rootrights). Example command:

adb shell tcpdump -i any -s 0 -w /sdcard/capture.pcap

If the system is unstable, add logging to Arduino:

File logFile = SD.open("log.txt", FILE_WRITE);

logFile.println("Command received: " + message);

logFile.close();

File log.txt will help figure out at what stage the failure occurred.

8. Alternative solutions: ready-made applications and modules

If independent development seems too complicated, consider ready-made solutions:

  • ๐Ÿ”ง Ready-made GSM modules:

    - StarLine M31 โ€” supports control via SMS and application StarLine.

    - Pandora D-004 โ€” works with Pandora Online (there is an API for integration).

    - Scher-Khan GSM โ€”a budget option with basic functions.

  • ๐Ÿ“ฑ Alarm applications:

    - StarLine (official, but requires their equipment).

    - Pandora Online (supports TCP/IP i GPS).

    - AutoBot (universal, but paid).

  • ๐Ÿ”Œ Universal IoT platforms:

    - Blynk โ€” allows you to create a control panel with buttons and sensors.

    - ThingSpeak โ€” for logging data (temperature, voltage).

The cost of ready-made modules starts from 3 000 โ‚ฝ (for example, StarLine M31), but they eliminate the need for soldering and programming. However, they have limitations:

- Subscription fee for cloud services (from 200 โ‚ฝ/month).

- Dependence on the manufacturer's servers (if a failure occurs, access is lost).

- Limited customization (you cannot add your own sensors).

If you choose a ready-made solution, pay attention to:

1. Support for your alarm model (check compatibility with the seller).

2. Availability of API for integration with your scripts.

3. Reviews about stability (some modules "glitch" with a weak signal networks).

โš ๏ธ Attention: Cheap Chinese GSM modules (for example, with AliExpress za 500 โ‚ฝ) often have problems with compatibility with Russian operators. Before purchasing, check frequency support 900/1800 MHz.
โ“ Which GSM module is better to choose for a homemade system?

SIM800L is the most popular option due to its low price (800โ€“1200 โ‚ฝ) and ease of connection. However, it only works on 2G networks that are being phased out. Alternatives:

  • SIM7000E - supports 3G and GPS, but more expensive (2500 โ‚ฝ) and more difficult to configure.
  • Quectel M66 - reliable module with good documentation, but requires external antenna.
  • ESP32 + SIM7600 - a combo for 4G, but consumes a lot of energy (you need a powerful power supply).

For most projects it will be enough SIM800Lif it still works in your region 2G.

โ“ Is it possible to control autorun via Telegram?

Yes, for this you need:

  1. Create a bot via @BotFather and get API-token.
  2. Configure ESP32 or Arduino + GSM for a survey servers Telegram (library UniversalTelegramBot).
  3. Add check chat_idso that the bot responds only to your messages.

Example code for ESP32:

#include 

WiFiClientSecure client;

UniversalTelegramBot bot("TOKEN", client);

void setup() {

bot.sendMessage(chat_id, "System autostart is ready!", "");

}

void loop() {

int numNewMessages = bot.getUpdates(bot.last_message_received + 1);

for (int i = 0; i < numNewMessages; i++) {

if (bot.messages[i].text == "/start") {

digitalWrite(RELAY_PIN, HIGH);

bot.sendMessage(bot.messages[i].chat_id, "The engine is running!", "");

}

}

}

The disadvantage of this method is the delay until 5 seconds due to API restrictions Telegram.

โ“ How to make autorun on a schedule (for example, every 2 hours)?

There are two options:

  1. through the app on your phone: use Tasker or Automate to send