The circuit is designed for an anti-sleep system intended to prevent a driver from falling asleep at the wheel. It utilizes an Arduino Nano as the central microcontroller to process signals from an IR sensor that detects if the driver's eyes are closed. Upon detection, the system activates a buzzer and a vibration motor to alert the driver. Additionally, it sends a signal through a 433 MHz RF transmitter to communicate with the vehicle's system, potentially to slow down the car. The circuit is powered by two separate 5V batteries, each connected to different components through rocker switches.
GND
connected to the rocker switch (common ground)5V
connected to the 5V battery (power supply)A0
connected to the IR sensor (signal input)D13/SCK
connected to the buzzer, vibration motor, and RF transmitter module (signal output)vcc
connected to the 5V battery (power supply)out
connected to Arduino Nano pin A0
(signal output)gnd
connected to common groundPIN
connected to Arduino Nano pin D13/SCK
(signal input)GND
connected to common ground+
connected to Arduino Nano pin D13/SCK
(power supply)-
connected to common groundDATA
connected to Arduino Nano pin D13/SCK
(signal input)VCC
connected to the 5V battery (power supply)GND
connected to common groundpositive
connected to various components for power supplynegative
connected to common ground through rocker switchesVCC
connected to the 5V battery (power supply)DATA
connected to the DC motor (signal output)GND
connected to common groundoutput
connected to common groundinput
connected to the negative terminal of the 5V batteriespin 1
connected to the 433 MHz RF receiver module (power supply)pin 2
connected to common ground through a rocker switch/*
* Anti-Sleep Project
* This Arduino Sketch reads the value from an IR sensor connected to pin A0.
* If the sensor detects closed eyes, it activates a buzzer and a vibration
* motor connected to pin D13. It also sends a signal via the 433 MHz RF
* transmitter to slow down the car.
*/
#define SENSE A0
#define BUZZER_PIN 13
#define VIBRATOR_PIN 13
#define RF_TRANSMITTER_PIN 13
void setup() {
pinMode(SENSE, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
pinMode(VIBRATOR_PIN, OUTPUT);
pinMode(RF_TRANSMITTER_PIN, OUTPUT);
}
void loop() {
if (digitalRead(SENSE) == HIGH) {
digitalWrite(BUZZER_PIN, HIGH);
digitalWrite(VIBRATOR_PIN, HIGH);
digitalWrite(RF_TRANSMITTER_PIN, HIGH);
} else {
digitalWrite(BUZZER_PIN, LOW);
digitalWrite(VIBRATOR_PIN, LOW);
digitalWrite(RF_TRANSMITTER_PIN, LOW);
}
delay(2000);
}
The code is written for the Arduino Nano and is responsible for reading the IR sensor's output, activating the buzzer and vibration motor, and sending a signal through the RF transmitter. The SENSE
pin is set to read the IR sensor's output, and the BUZZER_PIN
, VIBRATOR_PIN
, and RF_TRANSMITTER_PIN
are set to control the buzzer, vibration motor, and RF transmitter, respectively. The loop
function checks the sensor's output and activates the alert systems accordingly.