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() {
if(!digitalRead(blinkPin)){
time=millis();
while(!digitalRead(blinkPin)){
digitalWrite(buzzerPin, LOW);
digitalWrite(motorPin, LOW);
delay(1000);
}
}
else {
if(TimeDelay()>=3)digitalWrite(buzzerPin, HIGH);
if(TimeDelay()>=4)digitalWrite(motorPin, HIGH);
}
}
int TimeDelay(){
long t=millis()-time;
t=t/1000;
return t;
}