Homemade installation parking sensors on Arduino Nano with ultrasonic sensors, the HC-SR04 solves the problem of blind spots when parking in reverse - the measurement accuracy of such systems reaches Β±3 cm with proper calibration. Car enthusiasts often encounter false alarms from factory parking sensors on uneven surfaces or when attaching bicycle racks, and the Arduino platform allows you to flexibly configure response thresholds and detection zones. For example, code with the library NewPing.h processes data from 4 sensors simultaneously, displaying information on an OLED screen or sending sound signals through a piezo emitter.

Another popular project - on-board computer on Arduino Mega, connected to the OBD-II diagnostic connector via the ELM327 adapter. Such a device displays fuel consumption, engine temperature and error codes in real time (for example, P0300 - misfires), which is especially important for owners of used cars with worn-out electronics. With a budget of up to 3,000 rubles, such systems surpass factory solutions in functionality, supporting custom firmware for specific car models.

1. Parking sensors with ultrasonic sensors: diagram and code

To assemble the parking sensors you will need Arduino Uno/Nano, 4 sensors HC-SR04, LED strip (optional) and active buzzer. The sensors are mounted into the bumper at an angle of 20Β° to cover blind spots. The key feature of the circuit is the use of 220 Ohm resistors on the lines Trig to protect against power surges that often occur in the vehicle’s on-board network.

The base code uses the library NewPing for simultaneous polling of sensors. An important nuance: when powered from a cigarette lighter (12V), you need to add a stabilizer LM7805, since Arduino does not tolerate voltage higher than 5.5V. Suitable for data visualization OLED display 128x64 with library U8g2.

  • πŸ”§ Accessories: Arduino Nano, HC-SR04 (4 pcs.), buzzer, 220 Ohm resistors
  • πŸ“ Detection distance: 2–400 cm (adjustable in code)
  • ⚑ Food: 5V from USB or 12V via stabilizer
  • πŸ’‘ Add. Features: LED indication, sound notification
⚠️ Attention: When installing sensors in a plastic bumper, use sealant ABRO ES-350 β€” it prevents moisture from entering the connectors, which is critical for winter operation.
Extended connection diagram for 8 sensors

To cover the front and rear bumpers at the same time you will need a multiplexer CD4051 (8 channels). Connection diagram: Arduino A0 β†’ CD4051 INH, sensors are connected to the outputs Y0-Y7. The code adds a channel polling cycle with a 50 ms delay to stabilize the signal.

2. On-board computer with OBD-II: monitoring of engine parameters

System based Arduino Mega 2560 + adapter ELM327 Bluetooth reads data via protocol ISO 9141-2 (for most European cars) or CAN 11/29 (modern models). Key parameters to track: RPM (revolutions), MAF (air flow), ECT (coolant temperature).

Used to display information TFT display 3.5" with library MCUFRIEND_kbv. Example code for reading errors:

#include 

COBD obd;

void setup() {

obd.begin();

obd.init(OBD_PROTOCOL_AUTO); // Auto-detection of protocol

}

void loop() {

int response = obd.read(PID_ENGINE_LOAD);

if (response == SUCCESS) {

float load = obd.getValue();

// Display

}

}

ParameterPID codeUnit of measurementCritical value
Engine speed0x0Crpm>3500 (for automatic transmission)
Coolant temperature0x05Β°C>105Β°
Long-term fuel trim0x07%Β±10% (indicates faulty sensors)
Absolute pressure in the intake manifold0x0BkPa<50 (vacuum) or >110 (turbo)
⚠️ Attention: ELM327 adapters version 1.5 do not support the protocol CAN 29-bit, used in BMW and Mercedes after 2010. For these cars you need an adapter on the base STN1110.
πŸ“Š Which parameter would you like to track first?
Fuel consumption
Engine temperature
Error codes
Tire pressure

3. Tire Pressure Monitoring System (TPMS) on Arduino

Homemade TPMS (Tire Pressure Monitoring System) is assembled based on sensors TPMS-SENSOR (for example, JJC Ver.3) and receiver on Arduino Pro Mini + module nRF24L01 for wireless data transmission. The sensors are installed instead of standard nipple caps and transmit pressure and temperature data every 5 seconds.

Work algorithm:

1. The sensor measures pressure (range 0–8 bar) and temperature (-40°…+125Β°C).

2. Data is transmitted to the receiver via a 433 MHz radio frequency channel.

3. Arduino processes the signal and displays a warning on LCD 1602 in case of deviation from the norm (for example, a pressure drop of 0.3 bar in 1 minute).

  • πŸ“‘ Communication range: up to 10 m (in the car)
  • πŸ”‹ Sensor power supply: CR1632 battery (service life 2–3 years)
  • ⚠️ Operation threshold: adjustable in code (recommended 1.8–2.5 bar for passenger cars)
πŸ’‘

To increase communication range, replace the standard antenna on the nRF24L01 with 2.4GHz extender antenna (length 8–10 cm). This eliminates signal reception problems in metal bodies.

4. Automatic climate control

Project based Arduino Leonardo allows you to automate the activation of the air conditioner when the temperature in the cabin exceeds (for example, +25Β°C) or the heater when the temperature is below +18Β°C. For this we use:

- Sensor DHT22 (accuracy Β±0.5Β°C).

- Relay 5V 10A to control the air conditioning compressor.

- Buttons for manual override of automatic mode.

The code implements a PID controller to smoothly maintain the temperature:

#include 

double Setpoint = 22.0; // Target temperature

double Kp=2, Ki=0.5, Kd=1;

PID pid(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

void setup() {

pid.SetMode(AUTOMATIC);

}

void loop() {

Input = dht.readTemperature();

pid.Compute();

// Relay control depending on Output

}

Important: for integration with the standard climate control system (for example, in Toyota Corolla E150) will be required CAN bus adapter (MCP2515) to emulate commands from the control panel.

5. Security alarm with GSM notification

System on Arduino Mega + module SIM800L sends SMS when sensors are triggered:

- Shock sensor (vibration sensor SW-420).

- Door sensor (reed switches).

- Motion sensor (HC-SR501, installed in the cabin).

Implementation features:

- The GSM module is configured to send SMS to 2 numbers with coordinates (if a GPS module is connected NEO-6M).

- To save battery power, Arduino goes into sleep-mode (library LowPower.h) between sensor polling cycles.

- Code supports voice notification via AT commands:

sim800.print("ATD+79123456789;\r"); // Call the number

delay(20000); // Call duration

sim800.print("ATH\r"); // Reset call

⚠️ Attention: When installing in a car, use voltage stabilizer 5V/3A β€” peak currents of the GSM module during data transmission reach 2A, which can cause the Arduino to reset.

2. Checking the shock sensor (lightly tapping the body)

3. Test GPS coordinates (command AT+CGNSINF)

4. Measurement of current consumption in sleep mode (<0.5 mA)-->

6. Automatic light control (DRL and dimensions)

Scheme on Arduino Nano + photoresistor (GL5528) turns on daytime running lights (DRL) at illumination <500 lux and dimensions at <50 lux. A MOSFET transistor is used to control powerful LED strips (12V, 5A) IRLZ44N.

Work algorithm:

1. Photoresistor connected to analog input A0 through a voltage divider (10 kOhm resistor).

2. When the light falls below the threshold, the Arduino activates the headroom relay.

3. Additionally, a shutdown delay (30 seconds) has been implemented after turning off the ignition for safe exit from the car.

  • β˜€οΈ DRL threshold: 300–800 lux (adjustable by photoresistor illumination)
  • πŸŒ™ Dimensions threshold: 10–100 lux
  • ⚑ Consumption: <0.1 mA in standby mode

7. Battery diagnostics: monitoring voltage and leakage current

Device on Arduino Pro Mini + module INA219 measures:

- Battery voltage (range 6–16V).

- Leakage current (accuracy Β±1 mA).

- Internal battery resistance (pulse load method).

Critical thresholds for lead-acid batteries:

- Voltage <11.8V with engine off - deep discharge.

- Leakage current >50 mA - indicates a malfunction of the alarm or radio.

The code uses the library Adafruit_INA219.h for calibration:

ina219.setCalibration_16V_400mA();

float voltage = ina219.getBusVoltage_V();

float current = ina219.getCurrent_mA();

ParameterNormCritical valueReason
Voltage (engine off)12.6–12.8V<11.8VDeep discharge
Leakage current<30 mA>100 mAShort circuit or faulty equipment
Internal resistance<0.05 Ohm>0.1 OhmSulfation of plates
πŸ’‘

To accurately measure the leakage current, turn off all consumers (including the alarm) and wait 10 minutes - some modules (for example, ECU) wake up from sleep mode with a delay.

8. Keyless entry with RFID tags

System on Arduino Nano + module RC522 replaces the standard immobilizer, unlocking the central locking when the tag is presented EM4100 to the reader. To control the locks, a relay is used, connected to the wires of the standard key fob (determined with a multimeter in dialing mode).

Security Features:

- Storing UID tags in EEPROM Arduino (up to 10 tags).

- Blocking after 3 unsuccessful activation attempts (brute force protection).

- Additional authentication by PIN code (entered on the keyboard 4x4).

  • πŸ”‘ Reading range: 3–5 cm (depending on body shielding)
  • πŸ”„ Compatibility: any cars with electric locks
  • ⚑ Food: from the cigarette lighter circuit (12V β†’ 5V via AMS1117)
#include 

byte sectorKeyA[16] = {0xFF, 0xFF, ...}; // Access key

bool authenticate = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, blockAddr, Β§orKeyA, &(mfrc522.uid));

-->

FAQ: Frequently asked questions about Arduino projects for cars

How to protect Arduino from power surges in the on-board network?

Use Stabilizer with wide input voltage range (for example, LM2596 to 3A) and add varistor at 27V parallel to the power supply. For critical projects (such as alarms), add a backup battery 18650 with charging module TP4056.

Is it possible to connect Arduino to a car's CAN bus without an adapter?

No, to work with CAN 2.0 a transceiver is required (eg MCP2515 + TJA1050). Connecting the Arduino directly to the CAN bus will damage the ports. Start by reading data in mode listen-onlyto avoid conflicts with the ECU.

How to reduce current consumption in standby mode?

Disable unnecessary peripherals (such as power_down() for display) and use sleep-mode:

#include 

set_sleep_mode(SLEEP_MODE_PWR_DOWN);

sleep_enable();

sleep_mode(); // Goes to sleep

Current consumption will drop to ~0.05 mA.

Which Arduino boards are best for cars?
  • Arduino Nano β€” for compact projects (parking sensors, TPMS).
  • Arduino Mega 2560 β€” for processing the CAN bus and complex algorithms (on-board computer).
  • Arduino Pro Mini β€” for projects with limited space (built into the dashboard).
  • ESP32 β€” if you need Wi-Fi/Bluetooth (for example, for remote monitoring).
Where can I get ready-made firmware for these projects?

Source codes are available at GitHub (search for queries "Arduino OBD2", "Arduino TPMS"). For specific car models (for example, VAZ 2110 or Ford Focus 2) look for firmware on the forums Drive2 or Arduino Forum marked "[Tested]".