219y1a04e3 Report
219y1a04e3 Report
A report submitted in partial fulfillment of the requirements for the Award of Degree
of
BACHELOR OF TECHNOLOGY
in
Submitted by
SAYYAD RAHIMAN
Under Supervision of
2024- 202
K.S.R.M. COLLEGE OF ENGINEERING (AUTONOMOUS)
(Approved by AICTE, New Delhi & Affiliated to JNTUA, Ananthapuramu)
CERTIFICATE
This is to certify that the “Automatic Door System with Alcohol Detection
Department of E.C.E.
K.S.R.M College of Engineering, Dept., Of E.C.E
K.S.R.M College of Engineering, Dept., Of E.C.E
ACKNOWLEDGEMENT
It is really a pleasure for me to get an opportunity to thank all the persons who
contributed directly or indirectly for the successful completion of my Internship in “APSSDC”.
My sincere thanks to all those who have extended their ready help and cooperation in
completing this Internship Training.
SAYYAD RAHIMAN
219Y1A04E3
VI Sem ECE
Problem/Opportunity
The growing concern of drunk driving and alcohol-related accidents in public places
necessitates innovative solutions. Existing systems rely on manual checks, which are prone to
human error. An automated system integrating alcohol detection sensors can effectively prevent
intoxicated individuals from accessing sensitive areas.
Methodology
1. Literature review on embedded systems, alcohol sensors, and automatic door systems.
2. System design and architecture development.
3. Prototyping using Arduino, sensors (MQ-3, HC-SR04), and actuators (DC motor).
4. Testing and validation.
Key Parts of the Report
1. System Architecture
2. Hardware Design
3. Software Development (Algorithm)
4. Testing and Results
5. Conclusion and Recommendations
List of figures 9
Fig.4.2.4.1 Resistors 36
Fig.4.2.7.1 piezo 39
1.1 Introduction:
Before going to the overview of Embedded Systems, Let’s first know the two basic
things i.e embedded and system, and what actually do they mean.
System is a set of interrelated parts/components which are designed/developed to
perform common tasks or to do some specific work for which it has been created.
Embedded means including something with anything for a reason. Or simply we can
say something which is integrated or attached to another thing. Now after getting
what actual systems and embedded mean we can easily understand what are
Embedded Systems.
1.2 Embedded system:
void CopyFlashFuncToRam(void)
{
unsigned long int func_size = 0, cntr;
unsigned char *dest_ptr;
dest_ptr = (unsigned char *) func_to_be_copied ;
func_size = (unsigned long int)dummy_endfunc - (unsigned long int)func_to_be_copied;
for(cntr = 0; cntr < func_size; cntr++)
{
RAM_area[cntr] = dest_ptr[cntr];
}
}
void ExecuteRamFunc(void)
{
void(*func_ptr)(void) = (void(*)(void)) &RAM_area[0];
3. Size of the function can also be calculated by the use of return statement that can be placed
at the end of func_to_be_copied(). Start copying the function till you encounter the opcode of
return statement. There exist a risk that the data used inside function can be same as the return
statement’s opcode. For this, you need to understand the alignment requirements of the
instructions by referring the user manual.
4. Copy code section to RAM –
Consider you have a piece of code placed in flash memory say a bootloader code which needs
to be executed from RAM. The size of bootloader should be well known in advance. A signature
byte can also be written at the end of bootloader code while downloading to flash to know the
code size. If the size of bootloader is not known then the size of section allocated can be
considered. The section of code can be copied to RAM in same way as explained in point no.
(2). Make sure that the RAM is reserved in the linker script to be used for instruction execution.
While executing from RAM, consider the following –
The RAM used for instruction execution shall be reserved either through linker script
or by declaring global buffer.
The start address of copied section shall be known so that the Program Counter can be
pointed correctly or execute by pointing function pointer to the correct address.
RAM test can be performed at boot time to ensure its correctness.
Advantages:
1. Performance –
Time optimization if the frequently executed critical routines are placed in RAM. RAM
execution is significantly faster than flash.
2. Short addressing is usually required if code is executing from RAM i.e. accessing the
controller’s RAM, data flash or EEPROM can be accessed by short pointers whereas if
the code is executing from flash (flash are typically large memories, 100’s of KB to
MB’s), it would need long addressing. In short addressing, assembler usually generates
the instructions like sjmp, acall etc. which typically takes lesser number of machine
cycles.
Disadvantages:
1. RAM is a scarce resource, expensive and is usually of much smaller size compared to
flash. If the non-static code is placed in RAM, it is the wastage of RAM space, thereby
limiting the usage of variable data.
2. Hosting of the same routine at two places- one in flash and other in RAM.
3. Debugging code in RAM is hard. Debugging can be done in disassembly. ELF files are
generally used for debugging which contains debug information, symbol tables etc.
The sliding door operator, is made up of the following main components: a power
source, an electric motor, a belt-pulley system, sensors, a controller. Power from the
supply is first routed to the power source, which then distribute the power to the electric
motor, sensors, and micro controller. The rechargeable battery is charged by a charging
circuit from the power source and serves as an auxiliary power source in case of power
failure. The electric motor is used to drive the system. The motor drives a pulley at one
end of a belt, and at the other end, is a fixed pulley.
3.1 Introduction:
3.3 Arduino:
3.3.1 Introduction:
Arduino is an open-source electronics platform that consists of both hardware and software
components. It was created to make it easy for people, especially those without a background
in electronics or programming, to create interactive projects and prototypes.
The Arduino hardware typically consists of a microcontroller board with various input and
output pins, which can be used to connect sensors, actuators, and other electronic components.
These boards come in different variations, offering different capabilities and form factors.
The Arduino software, also known as the Integrated Development Environment (IDE), is a
user-friendly interface that allows you to write, compile, and upload code to the Arduino board.
The programming language used is a simplified version of C/C++, making it accessible for
beginners.
Disadvantages:
1. Limited Processing Power: Arduino boards have limited processing power, making them
unsuitable for complex computations.
2. Memory Constraints: Arduino boards have limited memory, restricting the size and
complexity of programs.
3. Not Suitable for High-Speed Applications: Arduino's processing speed is not sufficient for
high-speed applications like video processing or real-time data analysis.
4. Limited Analog Input Resolution: Arduino's analog input resolution is limited, affecting the
accuracy of analog readings.
5. Dependence on Libraries: Arduino's functionality relies heavily on libraries, which can be
outdated or incompatible.
6. Not Ideal for Commercial Products: Arduino boards are not designed for mass production
or commercial use, with limitations on scalability and reliability.
7. Limited Connectivity Options: Arduino boards have limited connectivity options, making
it difficult to integrate with other devices or systems.
8. Debugging Challenges: Arduino's simplicity can make debugging more challenging due to
the lack of advanced debugging tools.
Key Features:
1. Microcontroller: ATmega328P (8-bit, 16 MHz)
2. Memory:
- Flash: 32 KB (of which 0.5 KB is used by the bootloader)
- SRAM: 2 KB
- EEPROM: 1 KB
3. Input/Output:
- Digital I/O: 14 (of which 6 provide PWM output)
- Analog I/O: 6
4. Communication:
- USB (via ATmega16U2)
- Serial (UART)
5. Power:
- USB-powered
- External power (6-20V)
6. Dimensions: 68.6 mm x 53.4 mm
Connectivity:
1. USB Connector: For programming and serial communication
2. Power Jack: For external power supply
3. ICSP Header: For in-circuit serial programming
4. Digital and Analog Pins: For connecting sensors, actuators, and other components
Applications:
1. Robotics
2. Home Automation
3. IoT Projects
4. Prototyping
Advantages:
1. Easy to Use: Perfect for beginners and hobbyists
2. Affordable: Priced around $20-$30
3. Large Community: Extensive resources, libraries, and tutorials available
4. Flexible: Suitable for a wide range of projects and applications
Limitations:
1. Processing Power: Limited by the 8-bit microcontroller
2. Memory Constraints: Limited flash, SRAM, and EEPROM memory
Overall, the Arduino Uno is an excellent board for beginners, prototyping, and small-scale
projects, offering a great balance of ease of use, flexibility, and affordability.
Key Features:
1. Grid Pattern: A series of rows and columns of conductive strips, usually with a 0.1-inch
pitch.
2. Socketed Strips: Each strip has sockets to hold electronic components, such as resistors,
capacitors, and integrated circuits.
3. Jumper Wires: Used to connect components and strips.
4. Power Rails: Dedicated strips for power distribution, often marked with "+" and "-"
signs.
Types of Breadboards:
1. Full-Size Breadboard: 830-point, 16.5 cm x 5.5 cm (6.5 in x 2.2 in)
2. Half-Size Breadboard: 400-point, 8.3 cm x 5.5 cm (3.3 in x 2.2 in)
3. Mini Breadboard: 170-point, 3.3 cm x 4.4 cm (1.3 in x 1.7 in)
4. Reusable Breadboard: With removable adhesive strips for easy component placement.
Advantages:
1. Easy to Use: No soldering required, making it perfect for prototyping and testing.
2. Temporary Connections: Components can be easily added, removed, or rearranged.
3. Space-Saving: Components are held snugly, minimizing space usage.
4. Cost-Effective: Inexpensive compared to printed circuit boards (PCBs).
Common Uses:
1. Prototyping: Test and refine circuit designs before moving to PCBs.
2. Education: Teach electronics and circuit design concepts.
3. Repair and Troubleshooting: Temporarily replace or test components in existing
circuits.
4. Proof-of-Concept: * Demonstrate ideas and concepts before investing in PCBs.
In summary, breadboards are versatile, easy-to-use tools for building and testing
electronic circuits. They're perfect for prototyping, education, and repair, offering a cost-
effective and space-saving solution for electronics enthusiasts and professionals.
4.2.3 LED’s:
LED (Light Emitting Diode) lights are a type of semiconductor device that
converts electrical energy into light. Here's a comprehensive overview:
Characteristics:
1. Energy Efficiency: LEDs use significantly less energy than incandescent bulbs and CFLs.
2. Long Lifespan: LEDs can last up to 50,000 hours or more, compared to 1,000-2,000
hours for incandescent bulbs.
3. Durability: LEDs are resistant to shock, vibration, and extreme temperatures.
4. Instant On: LEDs turn on instantly, unlike CFLs which can take time to warm up.
5. Environmentally Friendly: LEDs are free of toxic chemicals like mercury and lead.
Types of LEDs:
1. Standard LEDs: General-purpose LEDs for various applications.
2. High-Power LEDs: Brighter LEDs for applications like lighting and automotive.
3. RGB LEDs: Combine red, green, and blue LEDs for color-changing capabilities.
4. UV LEDs: Emit ultraviolet light for applications like curing and disinfection.
5. IR LEDs: Emit infrared light for applications like remote controls and night vision.
Advantages:
1. Energy Savings: Reduce energy consumption and costs.
2. Longer Lifespan: Minimize replacement and maintenance.
3. Design Flexibility: LEDs can be designed to fit various applications.
4. Environmentally Friendly: Reduce carbon footprint and toxic waste.
Disadvantages:
1. Higher Upfront Cost: LEDs are often more expensive than traditional lighting.
2. Colour Temperature: LEDs can have a cool, bluish tone.
3. Dimming Issues: LEDs can be sensitive to dimming systems.
Overall, LEDs offer numerous benefits, including energy efficiency, long lifespan, and
design flexibility, making them a popular choice for various applications.
Functions:
1. Voltage Division: Reduce voltage levels in a circuit.
2. Current Limiting: Limit the amount of current flowing through a circuit.
3. Power Dissipation: Absorb excess energy in a circuit.
4. Signal Attenuation: Reduce the amplitude of a signal.
Types of Resistors:
1. Fixed Resistors: Have a constant resistance value.
2. Variable Resistors: Can be adjusted to change their resistance value.
3. Power Resistors: Designed to handle high power levels.
4. Precision Resistors: Have a high accuracy and low tolerance.
5. Thermistors: Change resistance in response to temperature changes.
6. Photoresistors: Change resistance in response to light.
Resistance Values:
1. Ohms (Ω): Unit of measurement for resistance.
2. Tolerance: Percentage of acceptable deviation from the nominal value.
3. Power Rating (W): Maximum power a resistor can handle.
Colour Coding:
1. 4-Band Code: Used for resistors with a tolerance of ±5% or ±10%.
2. 5-Band Code: Used for resistors with a tolerance of ±1% or ±2%.
Resistor Materials:
1. Carbon Film: Common material for general-purpose resistors.
2. Metal Film: Used for precision and high-power resistors.
3. Wire wound: Used for high-power and high-current resistors.
Applications:
1. Voltage Regulators: Regulate voltage levels in power supplies.
2. Audio Equipment: Control signal levels and tone.
3. Sensing Circuits: Measure temperature, light, and other parameters.
4. Protection Circuits: Protect against overcurrent and overvoltage.
When working with resistors, it's essential to consider factors like power rating,
tolerance, and temperature coefficient to ensure proper circuit operation.
Key Characteristics:
1. Precise Positioning: Servo motors can rotate to a specific angle or position and hold it.
2. High Torque: Servo motors provide high torque at low speeds.
3. Fast Response: Servo motors respond quickly to changes in input signals.
4. Low Speed: Servo motors typically operate at low speeds.
Components:
1. Motor: The actual motor that rotates.
2. Gearbox: Reduces speed and increases torque.
3. Encoder: Provides feedback on motor position.
4. Controller: Processes input signals and controls motor movement.
Applications:
1. Robotics: Servo motors are widely used in robotics for precise movement.
2. CNC Machines: Servo motors control movement in CNC machines.
3. Automotive Systems: Servo motors are used in power steering, brakes, and
transmission systems.
4. Aerospace Systems: Servo motors are used in aircraft and spacecraft for precise control.
Disadvantages:
1. High Cost: Servo motors are more expensive than other types of motors.
2. Complexity: Servo motors require complex control systems.
When selecting a servo motor, consider factors like torque, speed, precision, and power
requirements to ensure the right motor for your application.
How it works:
1. Heating Element: The sensor has a built-in heating element that raises the temperature
of the sensing material.
2. Sensing Material: The sensing material is a tin dioxide (SnO2) semiconductor that
changes its electrical conductivity when exposed to flammable gases.
3. Electrical Conductivity: When the sensor detects a flammable gas, the electrical
conductivity of the sensing material increases.
Characteristics:
1. High Sensitivity: The MQ2 sensor is highly sensitive to flammable gases.
2. Fast Response Time: The sensor responds quickly to changes in gas concentrations.
3. Low Power Consumption: The sensor consumes low power, making it suitable for
battery-powered devices.
4. Simple Circuitry: The sensor has simple circuitry and can be easily integrated into
electronic projects.
Applications:
1. Gas Leak Detection: The MQ2 sensor is widely used for detecting gas leaks in residential
and industrial settings.
2. Home Security Systems: The sensor can be integrated into home security systems to
detect gas leaks and alert authorities.
3. Industrial Safety: The sensor is used in industrial settings to detect gas leaks and
prevent accidents.
4. Air Quality Monitoring: The sensor can be used to monitor air quality and detect the
presence of flammable gases.
Precautions:
1. Handling: Handle the sensor with care to avoid damaging the sensing material.
2. Calibration: Calibrate the sensor regularly to ensure accurate readings.
3. Environmental Factors: The sensor's accuracy can be affected by environmental factors
like temperature and humidity.
By understanding the MQ2 sensor's characteristics and applications, you can effectively
integrate it into your projects and ensure accurate gas detection.
How it works:
1. Piezoelectric Material: The piezo buzzer contains a piezoelectric material, such as
ceramic or crystal, that changes shape when an electric current is applied.
2. Electric Field: When an electric current is applied, an electric field is created across the
piezoelectric material.
3. Mechanical Stress: The electric field causes mechanical stress in the material, leading
to a change in its shape.
4. Sound Waves: The change in shape creates sound waves, which are emitted through the
buzzer's surface.
Characteristics:
1. High Frequency: Piezobuzzers can produce high-frequency sound waves, typically in
the range of 1-5 kHz.
2. Low Power Consumption: Piezobuzzers consume very low power, making them
suitable for battery-powered devices.
3. Small Size: Piezobuzzers are typically small and compact, making them easy to
integrate into devices.
4. Durability: Piezobuzzers are resistant to mechanical stress and can withstand harsh
environments.
Applications:
1. Electronic Devices: Piezobuzzers are used in various electronic devices, such as alarm
clocks, timers, and notification systems.
2. Medical Devices: Piezobuzzers are used in medical devices, such as heart rate monitors
and ventilators.
3. Industrial Automation: Piezobuzzers are used in industrial settings to signal equipment
status or alerts.
Fig.4.2.7.1 piezo
Key Features:
1. Simple and Intuitive Interface: Easy to use, even for beginners.
2. 3D Modeling: Create 3D objects from scratch or modify existing models.
3. Shape Generators: Use pre-built shapes to create complex designs.
4. Hole and Cut Tools: Create holes and cutouts in objects.
5. Export Options: Export designs as STL, OBJ, or SVG files for 3D printing or other uses.
Capabilities:
1. 3D Printing: Design objects for 3D printing, including support for various printing
technologies.
2. CAD Design: Create precise, technical designs for engineering and architecture
applications.
3. Prototyping: Rapidly create and test prototypes for product design and development.
4. Education: Teach 3D design and printing concepts in the classroom.
Benefits:
1. Easy to Learn: Great for beginners and students.
2. Free and Web-Based: Accessible from anywhere, without software installation.
3. Community Support: Active community and forums for help and resources.
4. Constant Updates: Regular updates with new features and improvements.
Limitations:
1. Limited Advanced Features: Not suitable for complex, high-precision designs.
2. Limited Export Options: Limited file formats for export compared to other software.
3. Dependence on Internet Connection: Requires a stable internet connection to work.
CASE 2:
In second case we activate virtual gas as a black colour gas by double clicking on the
MQ2 sensor. We drag slowly that gas near to the sensor when it reaches the condition
value>=20 and value<40 the ledY1 will glow and servo motor rotates 45 degrees.
CASE 4:
In this case again we drag the gas towards the sensor then it reaches the condition
value<=60 and value>80 the ledR1 will glow and the servo motor rotates the and other
45 degrees. As shown in the beside figure.