Anti Sleep Alarm for Drivers

An anti-sleep alarm for drivers using Arduino Uno is a safety device designed to prevent accidents caused by drowsy driving. It typically consists of a sensor that detects signs of drowsiness, such as eye movements or head nods, and an alarm system that alerts the driver when these signs are detected.

The Arduino Uno, a popular microcontroller board, serves as the central processing unit for this system. Sensors like infrared sensors or accelerometers are commonly used to monitor the driver's behavior. These sensors feed data to the Arduino, which then analyzes it to determine if the driver is becoming drowsy.

When signs of drowsiness are detected, the Arduino triggers an alarm to alert the driver. This alarm can take various forms, such as sound alerts, vibration, or even visual cues like flashing lights. The goal is to jolt the driver awake and prompt them to take a break or pull over safely.

The system's effectiveness relies on the accuracy of the sensors and the responsiveness of the Arduino in detecting drowsiness. Continuous refinement and testing are crucial to ensure reliable performance in real-world driving conditions.

 Circuit Diagram :-

Code :-

// By Arduino Techy 
const int blinkPin = 2;     
const int motorPin =  13;      
const int buzzerPin =  12;

long time;

void setup() {
  pinMode(motorPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(blinkPin, INPUT);
  digitalWrite(motorPin, HIGH);

void loop() {
   digitalWrite(buzzerPin, LOW);
   digitalWrite(motorPin, LOW);
 else {
  if(TimeDelay()>=3)digitalWrite(buzzerPin, HIGH);
  if(TimeDelay()>=4)digitalWrite(motorPin, HIGH);

int TimeDelay(){
 long t=millis()-time;
 return t;

Components :-

brown Around computer motherboard

Arduino Uno 

Buying Link -

Eye Blink Sensor

Buying Link -


Buying Link -

Gear Motor 

Buying Link -

Automatic Parking Gate