You are on page 1of 51

List of Components

1. Arduino Mega 2560


2. 16*2 LCD Screen
3. Ultra Sonic Sensor Hc-Rs04
4. Thermal sensor LM35
5. Servo motor (as pump)
6. Liquid level sensor
7. RED LED
8. GREEN LED
9. SPEAKER

1
For entrance detection a motion sensor is used it will be mounted middle of
the sterilizing cabin

The motion detecting sensor Model I will use is HC-RS04

https://www.alibaba.com/product-detail/Factory-Directly-Supply-HC-SR04-PIR_62133789914.html

What is motion sensor?


Motion sensor can be defined as an electronic device that detects
surrounding persons or things using a sensor. Motion detectors are an
essential part of any security system. When a motion sensor detects
movement, it sends a signal to your security system. [ CITATION Dan191 \l 1033 ]

2
HC-RS04 specifications:

Operation voltage 5V to 20V

Power consumption 65mA

TTL output 3.3v to 0v

Delay time adjustable 0.3 up to 5 minutes

Trigger methods L (disable repeat trigger)


H (enable repeat trigger)
Sensing range Less than 120 degree
Maximum 7 meter
Temperature -15 to 70 C

Dimension 32*24 mm
28mm distance between two screws
23 mm Lens diameter

HC-RS04 pin identification:

3
HC-RS04 Schematic diagram

F1https://electronics.stackexchange.com/questions/304115/pir-sensor-not-triggering-p2n2222

Key features:
1. Compatible with Arduino
2. Detects motion reliably inside, at any time of day or night.
3. It consumes less energy (0.8W to 1.0W) compare to microwave
sensor.
4. They are cheaper compare to microwave sensors

4
5
6
4 valves the type of valve I will use is solenoid valve

Figure 2https://www.robotics.org.za/ROB-10456

What is solenoid valve?


A solenoid is an electrically powered device that transfers mechanical
energy. This set-up operates as an electromagnet since it contains a coil
coiled over a conducting substance. An electromagnet has the benefit over
a natural magnet in that it can be switched on and off by energizing the coil.
When the coil is powered, the current-carrying conductor is surrounded by
a magnetic field, which, due to the fact that the conductor is a coil, is strong
enough to magnetize the material and cause a linear motion.
[ CITATION Pan19 \l 1033 ]

7
Solenoid valve specifications:

Valve Type 2 Way, Normally Closed (NC)

Action Direct acting

Orifice 5.0mm

Operating pressure Vacuum 50 psi

Voltage 5 to 12 Volts

Coil power 20W

Service Air/Water/Liquid

8
Solenoid valve schematic diagram:

9
10
I will use 4X4 Matrix 16 Key membrane switch keypad

Figure 3https://www.joom.com/en/products/5b7b79e18b2c3701f41541f6

What is keypad?
Keypads are a great way to let users interact with your project. You can
use them to navigate menus, enter passwords, and control games and
robots.

Keypad specification:
Input Voltage: 5 to 24 V

11
Interface pins 8 Pins

Operation temperature -20 to 40 c

Dimensions 2.7 X 3.0 cm

4X4 Matrix 16 Key membrane switch keypad schematic:

12
4X4 Matrix 16 Key membrane switch keypad Arduino wiring:

13
14
Figure 4Figure 5https://store.ncd.io/product/water-level-sensor-analog-sensor/

What is liquid level sensor?


The level of chemicals that can flow is detected using level sensors.
Liquids, slurries, granular material, and powders are examples of such
substances. The level of a river or lake can be measured within containers
or by measuring the level of a river or lake. These measurements may be
used to figure out how much stuff is in a closed container or how much
water is flowing in open channels.

15
Liquid level sensor specifications:
Supply voltage 3.3 to 5 V

Operation current 4 to 20 mA

Dimensions 60 X 20 mm

Contact 45 mm

16
17
Display 16x2 Arduino

Figure 5https://www.aranacorp.com/en/using-a-lcd16x2-screen-with-arduino/

What is Arduino LCD Display?

You can easily interface a liquid crystal display (LCD) with an Arduino to
provide a user interface.

Liquid crystal displays (LCDs) are a commonly used to display data in


devices such as calculators, microwave ovens, and many other electronic
devices.

18
Display 16x2 Arduino specification:
Supply voltage 5V

Screen resolution 2 lines X 16 characters

Character resolution 5 X 8 pixels

Dimensions 80 X 36 X 12 mm

Viewing area dimension 64.5 X 16.4 mm

19
20
21
22
23
24
25
26
27
When cabin is 1-ultrasonic is not detecting
empty 2-LCD print ( Person detected count)

When person 1. Temperature displayed on LCD if safe range Green led is on


detect 2. Pump work for 5 seconds to spray sanitizer
(safe range

When person

28
detect
(out of save range
temp>37.5)

Liquid Level check


(full) status 1. Sanitizer liquid level status displayed on screen

29
Arduino Mega2560

Atmega2560 Chip Pinouts

30
Atmega2560 specifications:
 Microcontroller: ATMEGA2560
 Crystal: 14.7456MHz
 Power on reset circuit
 6 pin FRC socket for ISP (In System Programming)
Atmega2560 Features:
 Advanced RISC Architecture
 Up to 16 MIPS Throughput at 16 MHz
 256K Bytes of In-System Self-Programmable Flash
 8K Bytes RAM
 4K Byte Internal SRAM
 86 Programmable I/O Lines arranged in nine 8 bit ports
 In-System Programming by On-chip Boot Program
 JTAG
 16-channel, 10-bit ADC
 Two 8-bit Timer/Counters with Separate Prescalers and Compare
Modes
 Four 16-bit Timer/Counter with Separate Prescaler, Compare Mode,
and Capture
 Real Time Counter with Separate Oscillator
 Twelve 16 bit and Four 8 bit PWM Channels,
 Four Programmable Serial USART
 Eight external interrupts
 Master/Slave SPI Serial Interface
 Byte-oriented Two-wire Serial Interface
 Programmable Watchdog Timer with Separate On-chip Oscillator
 100 pin TQFP package

31
Program counter:

A program counter is a register in a computer processor that contains the address of the
code and the next instruction to be executed from memory.
A program counter (PC) is also known as an instruction counter, instruction pointer,
instruction address register or sequence control register.
 The program counter is a register (memory cell)
 This register contains the address (location in memory) of the next instruction after the
CPU finishes executing the current instruction in the instruction register
 The value in the program counter will be increased after the CPU finishes executing one
instruction

32
Instruction Register:

An instruction register is a component of a microcontroller’s or other device's central


processing unit (CPU) that stores the programming instruction that will be executed at the
start of the next clock cycle, as determined by other parts of the CPU. This register holds the
current instruction so that it can be decoded and input to the control and timing unit.
Specifically, the instruction register holds the opcode which defines the type of instruction

 Contains the current instruction being executed by the CPU


 The CPU will perform the operation indicated by the instruction code
contained in the instruction register

(E.g.: code 0 = "add", code 1 = "subtract", and so on)

33
Instruction decoder:

A processor's instruction decoder is a combinatorial circuit that takes the form of a read-only
memory at times and an ordinary combinatorial circuit at other times.
Its function is to convert an instruction code into the address in the micro memory where the
instruction code will be executed.

ALU:

An arithmetic logic unit (ALU) is a combinational digital circuit that performs arithmetic and
bitwise operations on integer binary numbers. A processor's input and output are controlled
by an integrated circuit. It collects programmed instructions and moves them on to the
arithmetic logic unit (ALU). The ALU executes the required calculations and transmits the
results to the control unit.
 Is a complex electrical circuit that can perform Mathematical (+, -, ×, /) and logical
operations (<, ≤ >, ≥, and, or)
 The output (result) of the computation (obtained by the ALU) is often stored in a general
purpose register

34
Program Memory:

The read-only memory (ROM) is used to save programmed codes that are being run
permanently, and it is split into two sections: the Boot Program section and the Application
Program section. After we've burnt the software (which we'd created), it's stored in a memory.
As a reminder, Program Counter performs one-by-one execution of commands stored in the
programmed memory.

35
Data Memory

RAM is the data space that is used for temporarily storing constant and variable values that
are used by the microcontroller during normal program execution. The General Purpose
Registers and Special Function Registers are divided into various banks in the data memory.
To access a register that is located in another bank, one should access it inside the program.

36
Buses:
A bus is a data transmission channel for digital signals. Processors are connected to one of
three internal buses:
 the data bus
 address bus
 control bus
The "system bus" is made up of these three internal buses. The system bus is an internal
bus that connects the processor to the rest of device's hardware.

Instruction Set

An Instruction is a command given to the computer to perform a specified operation on


given data. The instruction set of a microprocessor is the collection of the instructions that
the microprocessor is designed to execute.

37
Interrupts

Interrupt is the method of creating a temporary halt during program execution and allows
peripheral devices to access the microprocessor. An unusual situation or a specific
instruction in the instruction set that creates an interrupt when executed by the processor
causes a software interrupt. If the processor's arithmetic logic unit executes an instruction
to divide a number by zero, for example, a divide-by-zero exception will occur, prompting
the computer to quit the computation or show an error message. A shopper is similar to
an interrupt. If he need a service or product, he approaches him and informs him of his
requirements. When flags or signals are received in the case of interruptions, they alert
the controller that they need to be addressed.

ADC

Is a system that converts an analog signal, such as a sound picked up by a microphone


or light entering a digital camera, into a digital signal. An analog-to-digital converter (ADC)
converts an analogue signal, such as voltage, into a digital form that a microcontroller can
read and interpret. The user application must initiate the ADC conversion process, which
might take several hundreds of microseconds to finish. When an ADC converter
completes a conversion, it generally generates interrupts so that the user application may
receive the transformed data as rapidly as possible. ADC converters are very useful in
control and monitoring applications since most sensors in real life

38
Timers

A timer is a specialized type of clock which is used to measure time intervals. A counter is
a device that stores (and sometimes displays) the number of times a particular event or
process occurred, with respect to a clock signal. It is used to count the events happening
outside the microcontroller. The timer is a critical component of embedded systems
because it keeps an operation's timing in sync with a system clock or an external clock.
The timer may be used for a variety of purposes, including measuring time and producing
delays. It can also be used to generate baud rates.

39
USART

Receiver/Transmitter. It's a physical circuit in a microcontroller or a stand-alone IC, not a


communication protocol like SPI or I2C. The primary function of a UART is to transmit and
receive serial data. Acts as a mediator between microprocessor and peripheral to transmit
serial data into parallel form and vice versa. It takes data serially from peripheral (outside
devices) and converts into parallel data. Two UARTs interact directly with each other in
UART communication. The transmitting UART turns parallel data from a controlling
device, such as a CPU, into serial data and sends it to the receiving UART, which then
converts the serial data back into parallel data for the receiving device. To send data
between two UARTs, just two wires are required. The Tx pin is where data is sent.

40
Harvard Architectures:
Computer instructions and data are stored in separate memory units linked by various
buses in the Harvard architecture. There are at least two memory address spaces to
deal with in this case, so there is a memory register for system instructions and another
for records. Computers built with the Harvard architecture will run programmed and
access data on their own. And, as a result, concurrently The Harvard architecture
maintains a clear distinction between data and code. As a result, Harvard's architecture
is more complex, but independent pipelines eliminate Von Neumann's bottleneck.
[ CITATION SCO18 \l 1033 ]

41
Modified Harvard Architecture:
Since the majority of modern machines have no physical distinction between the
memory spaces used for data and programs/code/machine instructions, they may be
classified as Von Neumann. An "updated Harvard architecture" is a simpler way to
describe the bulk of modern computers. Modern processors can share memory, but
they have mechanisms in place to prevent data from being misinterpreted as code, such
as special instructions. This is referred to as "updated Harvard architecture" by others.
However, the updated Harvard architecture has two separate signal (code) and storage
(memory) paths (buses), while the memory itself is one shared, physical piece. The
memory controller is where the modification is seated, since it handles the memory and
how it is used.[ CITATION SCO18 \l 1033 ]

42
Von-Neumann architecture:
In a Von-Neumann architecture, all data and programmed instructions are stored in the
same memory and bus. Since you can't access software and data memory at the same
time, the Von Neumann architecture is prone to bottlenecks, and machine performance
suffers as a result.[ CITATION SCO18 \l 1033 ]

The Von Neumann Bottleneck:


If a Von Neumann computer needs to execute a memory operation, it must first transfer
the data through the bus to the CPU. When the calculation is complete, the outputs of
the computation must be moved to memory using the same bus. The amount of data
that can be transferred by the bus at one time (speed and bandwidth) determines how
fast the Von Neumann architecture can be. The throughput of a computer is determined
by the accuracy of the processors as well as the speed at which data is sent through the
bus. When waiting for a memory fetch, the processor will either be idle or perform
conditional processing, which is dependent on what the processor may need to do after
the current computation is completed. [ CITATION SCO18 \l 1033 ]

43
Comparison between Harvard and Von Neumann:

point of
Compariso Harvard Architecture Von Neumann Architecture
n

The CPU is attached to both the data There is no independent storage and
memory (RAM) and the application application memory in Von-Neumann
memory (ROM) independently in architecture. Instead, the CPU is given a
Harvard architecture single memory link.

Arrangemen
t

Hardware It necessitates more hardware since Unlike the Harvard architecture, this one
requirement each memory would take its own needs fewer hardware so only a shared
s storage and address bus. memory must be accessed.

Space
Less space required than the Harvard
requirement More space is required
model
s

Since the processor fetches data and Since it can't fetch data and commands
Speed of
instructions at the same time, at the same speed, execution time is
execution
execution time is reduced.(FASTER) slower.(SLOWER)

It wastes space and if space is left in


The space in the data memory can be
the data memory, the instructions
Space usage used by the instructions memory and
memory is unable to use the data
vice versa, so no space is lost.
memory's space and vice versa.

Since data and instructions must be Since either data or instructions must be
Controlling fetched at the same time, controlling fetched at the same time, controlling
becomes more difficult. becomes easier.
[ CITATION Nee20 \l 1033 ]

44
After examine figure one I realized that this architecture is a state of Harvard
Architecture

And name microcontrollers depending on this architecture:


ATMEGA series

 ATMEGA 8
 ATMEGA 16
 ATMEGA 32

8051 series

 89S52
 89S51
 89C51

PIC series

 Pic 10F
 Pic 12F
 Pic 16F

45
Comparison Atmega328P Atmega128
points
Programmable I/O 23 programmable I/O 53 Programmable I/O
lines lines Lines
64-lead
Power +1.8 V TO +5.5V +4.5V to +5.5V
consumption

Executed 1MIPS for 1MHz 1MIPS Throughput at 1


instruction per MHz
second

Number of 32 registers each 32 registers each with


general-purpose with 8-bits 8-bits
working register

Memory FLASH SRAM

46
Memory map of Atmega328P:

Memory map for Atmega128:

47
Atmega328P

will be perfect because it has


 lower operation voltage 1.8 to 5.5volts
 same Executed instruction per second as atmega128
 same Number of general-purpose working register
 less I/O Programmable lines
It will suite the scale of small project I want to build

48
Atmega328P pinout

49
Atmega328P applications
Footstep Mobile Charging With RFID

LIDAR based Self Driving Car

Third Eye For Blind Ultrasonic Vibrator

50
Bibliography
Components101, 2020. MLX90614 Non-Contact IR Temperature Sensor. [Online]
Available at: https://components101.com/sensors/melexis-mlx90614-contact-less-ir-temperature-
sensor
[Accessed 28 may 2021].

Jost, D., 2019. What is a Motion Sensor?. [Online]


Available at: https://www.fierceelectronics.com/sensors/what-a-motion-sensor
[Accessed 28 may 2021].

Khatri, P., 2019. How to control a Solenoid Valve with Arduino. [Online]
Available at: https://circuitdigest.com/microcontroller-projects/how-to-control-solenoid-valve-using-
arduino
[Accessed 25 may 2021].

Mishra, N., 2020. Difference between Von Neumann and Harvard Architecture. [Online]
Available at: https://www.thecrazyprogrammer.com/2019/02/difference-between-von-neumann-and-
harvard-architecture.html
[Accessed 4 april 2021].

THORNTON, S., 2018. What’s the difference between Von-Neumann and Harvard architectures?. [Online]

Available at: https://www.microcontrollertips.com/difference-between-von-neumann-and-harvard-


architectures/
[Accessed 21 april 2021].

51

You might also like