This document provides a detailed overview of a circuit designed to interface various sensors and modules with an Arduino Mega 2560 microcontroller. The circuit includes components for sensing alcohol levels (MQ-3 Breakout), displaying information (16X2 LCD), communication (Sim800l), GPS tracking (GPS NEO-6M V2), motor control (l293d), temperature sensing (LM35), user input (Potentiometer), and vibration detection (SW-420 Vibration Sensor). A 9V battery powers the system.
5V
connected to VCC of various components for powerGND
connected to GND of various components for common groundVIN
connected to the positive terminal of the 9V BatteryA0
connected to analog outputs of MQ-3 Breakout and LM35D19/RX1
connected to TX of GPS NEO-6M V2 and TXD of Sim800lD18/TX1
connected to RX of GPS NEO-6M V2 and RXD of Sim800lD0 RX0
connected to digital output of MQ-3 BreakoutD2 PWM
to D7 PWM
connected to data pins D7
to D4
of 16X2 LCDD10 PWM
connected to Enable 1,2
of l293dD9 PWM
connected to Input 1
of l293dD8 PWM
connected to digital output of SW-420 Vibration SensorD7 PWM
connected to Input 2
of l293dD11 PWM
connected to E
of 16X2 LCDD12 PWM
connected to RS
of 16X2 LCDVCC
and GND
for power supplyAO
connected to A0
of Arduino Mega 2560 for analog outputDO
connected to D0 RX0
of Arduino Mega 2560 for digital outputVDD
and VSS
for power supply and groundV0
connected to output of Potentiometer for contrast adjustmentRS
, E
, D4
to D7
connected to D12 PWM
to D5 PWM
of Arduino Mega 2560 for data/command interfaceA
and K
for backlight anode and cathodeVCC
and GND
for power supplyTXD
connected to D19/RX1
of Arduino Mega 2560 for transmitting dataRXD
connected to D18/TX1
of Arduino Mega 2560 for receiving dataVCC
and GND
for power supplyTX
connected to D19/RX1
of Arduino Mega 2560 for transmitting dataRX
connected to D18/TX1
of Arduino Mega 2560 for receiving dataVcc1
and GND
for logic power supply and groundInput 1
and Input 2
connected to D9 PWM
and D7 PWM
of Arduino Mega 2560 for motor control signalsEnable 1,2
connected to D10 PWM
of Arduino Mega 2560 for enabling motor driver channelsOutput 1
and Output 2
connected to vcc
and GND
of Motor and Wheels for motor output+Vs
and GND
for power supplyVout
connected to A0
of Arduino Mega 2560 for temperature readingVCC
and GND
for power supplyOutput
connected to V0
of 16X2 LCD for contrast controlvcc
and GND
connected to Output 1
and Output 2
of l293d for receiving motor powervcc
and Ground
for power supplyDigital output
connected to D8 PWM
of Arduino Mega 2560 for vibration detectionvoid setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code template provides the basic structure for the Arduino sketch. The setup()
function is called once when the program starts and is used to initialize settings. The loop()
function runs continuously after setup()
has finished and is where the main logic of the program will be implemented.