• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / Car Reverse Parking Sensor Circuit with Alarm

Car Reverse Parking Sensor Circuit with Alarm

Last Updated on December 5, 2024 by Swagatam 3 Comments

In this post I will show how to construct a car reverse parking sensor alarm circuit using arduino, ultrasonic sensor and 2.4 GHz transceiver module. This project can be add-on feature for your car if it doesn’t sport a build-in parking sensors.

Table of Contents
  • Introduction
  • Illustration of NRF24L01:
  • Pin configuration:
  • Program for Transmitter:
  • Receiver:
  • Program for Receiver:
  • How to place sensor as stationary parking sensor:

Introduction

The proposed project has similar functionality as traditional car parking sensor has, such as distance between car and obstacle on a LCD display and audio beep alert.

The proposed project can be used as stationary parking sensor i.e. the sensor placed on you garage or mobile parking sensor i.e. sensor placed on the back of your car if you are ready to take a small risk of wiring the project with car’s electrical system.

However, the motivation this project is to build a stationary parking sensor which can be built with zero risk.

The car parking sensor alarm project using Arduino has two parts, the transmitter which consists of ultrasonic sensor, arduino, buzzer and 2.4 GHz transceiver module. This circuit will measure the distance between the car and obstacle.

The receiver consists of 2.4 GHz transceiver module, arduino and 16x2 LCD display.

The receiver circuit will be placed inside the car with 9V battery as power supply. The receiver will display the distance between the car and obstacle in meters.

The transmitter will transmit the sensor data to the receiver inside the car via 2.4 GHz link. The communication link is established using NRF24L01 module.

Now let’s see the overview of NRF24L01 module.

Illustration of NRF24L01:

NRF24L01 Module

This module is designed to establish bi-directional communication link between two microcontrollers. It works on SPI communication protocol. It has 125 different channels and has maximum data rate of 2Mbps. It has theoretical maximum range of 100 meter.

Pin configuration:

pin 1

 It operates on 3.3V, so 5 volt on Vcc terminal can kill it. However, it can accept 5V data signals from microcontrollers.

Now let’s move on to the transmitter of the project.

Car Parking Sensor Alarm Transmitter Circuit

The circuit is wired with NRF24L01 module with 5 wires connected to digital I/O pins of arduino and rest of the two to 3.3V and ground. Pin #2 is connected to base of the transistor which will power the buzzer.

The ultrasonic sensor’s power terminals are connected to 5V and GND and A0 is connected to trigger pin and A1 is connected to echo pin of the sensor.

The sensor’s distance data is transmitted via NRF24L01 module to the receiver.

-------------------------------------------------------------------------------------------Please download the library file from follow link: github.com/nRF24/RF24.git----------------------------------------------------------------------------------------------

Program for Transmitter:

//----------Program Developed by R.Girish-------------//
#include <RF24.h>
#include<SPI.h>
RF24 radio(7,8);
const byte address[][6] = {"00001", "00002"};
const int trigger = A0;
const int echo = A1;
const int buzzer = 2;
float distance;
float result;
long Time;
boolean state = false;
boolean dummystate = 0;
void setup()
{
pinMode(trigger, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(echo, INPUT);
radio.begin();
radio.openWritingPipe(address[1]);
radio.openReadingPipe(1, address[0]);
radio.setChannel(100);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_MAX);
radio.startListening();
while(!radio.available());
radio.read(&dummystate, sizeof(dummystate));
radio.stopListening();
if(dummystate == HIGH);
{
for(int j = 0; j < 10; j++)
{
const char text[] = "Connection:OK !!!";
radio.write(&text, sizeof(text));
delay(100);
}
}
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
delay(1000);
}
void(* resetFunc) (void) = 0;
void loop()
{
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result > 2.00)
{
const char text[] = "CAR NOT IN RANGE";
radio.write(&text, sizeof(text));
}
if(result <= 2.00 && result > 1.90)
{
const char text[] = "Distance = 2.0 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.90 && result > 1.80)
{
const char text[] = "Distance = 1.9 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.80 && result > 1.70)
{
const char text[] = "Distance = 1.8 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.70 && result > 1.60)
{
const char text[] = "Distance = 1.7 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.60 && result > 1.50)
{
const char text[] = "Distance = 1.6 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.50 && result > 1.40)
{
const char text[] = "Distance = 1.5 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.40 && result > 1.30)
{
const char text[] = "Distance = 1.4 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.30 && result > 1.20)
{
const char text[] = "Distance = 1.3 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.20 && result > 1.10)
{
const char text[] = "Distance = 1.2 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.10 && result > 1.00)
{
const char text[] = "Distance = 1.1 M";
radio.write(&text, sizeof(text));
}
if(result <= 1.00 && result > 0.90)
{
state = true;
const char text[] = "Distance = 1.0 M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(700);
digitalWrite(buzzer, LOW);
delay(700);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.90 || result > 1.0)
{
state = false;
}
}
}
if(result <= 0.90 && result > 0.80)
{
state = true;
const char text[] = "Distance = 0.9 M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(600);
digitalWrite(buzzer, LOW);
delay(600);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.80 || result > 0.90)
{
state = false;
}
}
}
if(result <= 0.80 && result > 0.70)
{
state = true;
const char text[] = "Distance = 0.8 M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
delay(500);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.70 || result > 0.80)
{
state = false;
}
}
}
if(result <= 0.70 && result > 0.60)
{
state = true;
const char text[] = "Distance = 0.7 M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(400);
digitalWrite(buzzer, LOW);
delay(400);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.60 || result > 0.70)
{
state = false;
}
}
}
if(result <= 0.60 && result > 0.50)
{
state = true;
const char text[] = "Distance = 0.6 M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(300);
digitalWrite(buzzer, LOW);
delay(300);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.50 || result > 0.60)
{
state = false;
}
}
}
if(result <= 0.50 && result > 0.40)
{
state = true;
const char text[] = "Distance = 0.5M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.40 || result > 0.50)
{
state = false;
}
}
}
if(result <= 0.40 && result > 0.30)
{
state = true;
const char text[] = "Distance = 0.4 M";
radio.write(&text, sizeof(text));
while(state)
{
digitalWrite(buzzer, HIGH);
delay(100);
digitalWrite(buzzer, LOW);
delay(100);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time = pulseIn(echo,HIGH);
distance = Time*0.034;
result = distance/200;
if(result < 0.30 || result > 0.40)
{
state = false;
}
}
}
if(result <= 0.30)
{
const char text[] = "     STOP!!!";
radio.write(&text, sizeof(text));
digitalWrite(buzzer, HIGH);
delay(3000);
digitalWrite(buzzer, LOW);
resetFunc();
}
delay(200);
}
//----------Program Developed by R.Girish-------------//

That concludes the transmitter.

Receiver:

The Receiver has 16x2 LCD display for displaying the distance measurement. The display connection is given below:

Car Parking Sensor Alarm LCD Display Circuit

Adjust the 10K potentiometer for better viewing contrast.

Receiver 1

The above schematic is rest of the receiver circuit. A push button is provided for resetting the arduino in case of the 2.4 GHz link connection is not established.

layout2Bdisp

The receiver circuit is placed inside the car; it can be power from a 9V battery. The receiver may be placed in a junk box which might make your car look good. The junk box may be placed in your car above the instrument cluster or any convenient place you wish.

Program for Receiver:

//--------Program Developed by R.Girish-------//
#include <LiquidCrystal.h>
#include <RF24.h>
#include<SPI.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
RF24 radio(9,10);
const byte address[][6] = {"00001", "00002"};
const int dummy = A0;
boolean dummystate = 0;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
pinMode(dummy , INPUT);
digitalWrite(dummy, HIGH);
radio.begin();
radio.openReadingPipe(1, address[1]);
radio.openWritingPipe(address[0]);
radio.setChannel(100);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_MAX);
radio.stopListening();
dummystate = digitalRead(dummystate);
radio.write(&dummystate, sizeof(dummystate));
delay(10);
radio.startListening();
if(!radio.available())
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Connection not");
lcd.setCursor(0,1);
lcd.print("established");
delay(50);
}
}
void loop()
{
if(radio.available())
{
char text[32] = "";
radio.read(&text, sizeof(text));
lcd.clear();
lcd.setCursor(0,0);
lcd.print(text);
lcd.setCursor(0,1);
lcd.print("----------------");
}
}
//--------Program Developed by R.Girish-------//

Now, that concludes the receiver.

How to place sensor as stationary parking sensor:

stationary2Bparking2Bsensor

How to place sensor as mobile parking sensor:

In mobile parking sensor the transmitter’s ultrasonic sensor is placed at back side of the car, the power is provided from car’s battery. It should be wired in such a way that when you turn off the ignition the arduino must disconnect from the supply.

The receiver may be placed insider the as mentioned before.

mobile2Bparking2Bsensor

How to operate this Car Parking sensor project (Stationary type) 

• Power the Transmitter ON first, go to your car and turn on the receiver. If the connection between transmitter and receiver is established it will display “Connection: OK” and shows the distance between the car and sensor.

• If it displays” Connection not established” press the push button provided on the receiver.

• It may display” Car not in range” if your can is far away from the ultrasonic sensor.

• Gently take your car reverse or forward to your parking plot.

• As the distance between car and sensor gets less than 1.0 meter the buzzer beeps.

• As you approach the sensor closer the rate of beep increases, once the car reaches 1 foot or 0.3 meter, the display prompt to stop the car and you must stop.

• The transmitter will reset and go to idle automatically. Turn off the receiver in your car. If you powered the transmitter by battery, turn off it too.

How to operate this car parking sensor alarm circuit (Mobile Parking sensor)

• It is similar previously stated instruction; if the receiver displays “Car not in range” your car is far away from the obstacle.

• When you turn off the engine, the transmitter circuit must turn off. Turn off the receiver circuit manually.

Author’s Prototype:

Transmitter:

img 20170706 035209 1

Receiver: 

Car Parking Sensor Alarm prototype

You'll also like:

  • 1.  Automotive Trailer Lights Interface Circuit
  • 2.  Using Single Switch for Fog lamp and DRL Lamp
  • 3.  Car Radiator Hot Indicator Circuit
  • 4.  4 Solid-State Car Alternator Regulator Circuits Explored
  • 5.  Making an Automatic Stopwatch for Runners, Athletes and Sportpersons
  • 6.  3 Interesting DRL (Day Time Running Light) Circuits for Your Car

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « Universal ESC Circuit for BLDC and Alternator motors
Next Post: High Current Motor Control Circuit using Arduino »

Reader Interactions

Comments

  1. Oyekunle Quadri says

    July 11, 2017 at 7:47 am

    Awesome project.
    Can you help me with a project on MicroController Based Timer Socket?
    I will be glad. Thanks

    Reply
    • Swagatam says

      July 11, 2017 at 10:04 am

      Thanks, If possible we'll try to post it for you…

      Reply
    • GR says

      July 11, 2017 at 10:26 am

      Hi oyekunle,

      I am already designing one, hopefully it will be published soon.

      Regards

      Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (104)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on Real MPPT Solar Charger Circuit Using Arduino, LCD, and Manual/Auto Switch
  • Obaidullah Khan on Real MPPT Solar Charger Circuit Using Arduino, LCD, and Manual/Auto Switch
  • Swagatam on 2 Compact 12V 2 Amp SMPS Circuit for LED Driver
  • Alan Bishop on AC Motor Speed Controller Circuits using Back EMF
  • Swagatam on Real MPPT Solar Charger Circuit Using Arduino, LCD, and Manual/Auto Switch

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations