Uploaded by Hien Nguyen Duy

Automatism Group 4 (1)

advertisement
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF HANOI
DEPARTMENT OF AERONAUTICS
FINAL REPORT AUTOMATISM
AUTOMATIC SANITIZER DISPENSER
By Group 4
Nguyễn Hoàng Bách - BI12-041
Nguyễn Duy Hiển - BI12-155
Nguyễn Quang Huy - BI12-199
Phạm Tam Phong – BI12-348
Nguyễn Huy Trường Sinh - BI12-383
Hanoi, December 2022
1
TABLE OF CONTENTS
LIST OF ABBREVIATIONS .........................................................................3
LIST OF TABLES ...........................................................................................4
LIST OF FIGURES .........................................................................................5
SUMMARY/ABSTRACT ...............................................................................6
I. INTRODUCTION ........................................................................................7
II. SYSTEM DESCRIPTION .........................................................................8
III. SYSTEM DESIGN - HARDWARE ........................................................9
IV. SYSTEM DESIGN - SOFTWARE ........................................................18
V. RESULTS...................................................................................................20
VI. CONCLUSION ........................................................................................21
REFERENCES ...............................................................................................22
APPENDICES ................................................................................................23
2
LIST OF ABBREVIATIONS
˚C
Degree Celsius
A
Ampere
AC
Alternating current
DC
Direct current
EEPROM Electrically Erasable Programmable Read-Only
Memory
GND
Ground
Hz
Hertz
ICSB
Liquid-crystal display
LCD
In Circuit Serial Programming
LED
Light-emitting diode
I/O
Input/Output
SMD
Surface-mount device
SRAM
Static random access memory
TTL
Transistor-Transistor Logic
USTH
University of Science and Technology of Hanoi
USB
Universal serial bus
V
Volt
VND
Viet Nam Dong
3
LIST OF TABLES
Table: Component prices ………………….…………………………………………......24
4
LIST OF FIGURES
Figure 3.1 : Arduino UNO R3 board……………………………………........................09
Figure 3.2: UltraSonic HY-SRF05 sensor……………………………….........................10
Figure 3.3: Module Controller Relay 12VDC…………………………….......................13
Figure 3.4: Water pump………………………………………………….........................14
Figure 3.5.1: Battery 1…………………………………………………….......................14
Figure 3.5.2: Battery 2…………………………………………………….......................15
Figure 3.5.3: Battery 3…………………………………………………….......................15
Figure 3.6: Plastic tube.......................................................................................................15
Figure 3.7: One-way valve ................................................................................................16
Figure 3.8: Electrical plastic box.....................................................................................16
Figure 3.9: Wires ...............................................................................................................17
Figure 3.10: Battery base wire ...........................................................................................17
5
SUMMARY/ABSTRACT
This report presents the work of group 4: This device is an automatic sanitizer
dispenser which dispenses a specific amount of sanitizer on to your hand when
placed under the ultrasonic sensor. The Arduino UNO board controls the pump based
on the distance obtained from the ultrasonic sensor. Other components include 9V
and 12V batteries, one Relay control module, a plastic tube, one way valve, a pump,
test board wires, battery base wire, and a USB connector. After some modifications,
our group would like to present a very practical device that can be used in the
pandemic by eliminating the need of touching a public sanitizer bottle. Some
improvements in the future can also be made for a more compact design, longer
battery life, and enhanced user’s overall experience.
4 Keywords: Automatic sanitizer dispenser, ultrasonic sensor, pump, covid
6
I. INTRODUCTION
- In the world today, disease, bacteria and virus are developing very fast, become
more dangerous, hard to cure and have been spread all over the very fast. This could
lead to death for people who infected with them. The best way to prevent it that
people should not contact to each other and wash hands regularly. But when we wash
our hands, we must touch the tab and the bacteria can run from people to people.
Therefore, our product is the solution for it. Just put the hand under water tab, you
can wash your hand automatically.
- The report contains 5 parts: Introduction, System Description, Hardware, Software
and Conclusion.
7
II. SYSTEM DESCRIPTION
- Goal of the device: Put your hand under the tube and the sanitizer automatically
come out.
- Block diagram:
8
III. SYSTEM DESIGN - HARDWARE
3.1. Controller kit
- We use Arduino UNO R3, which use microcontroller of 8bit ATmega328 to
control the system. It’s a controller board based on ATmega328 with 14
digital input/output pins, 6 analog inputs, a 16 MHz crystal oscillator, a USB
connection, a power jack, an ICSP header, and a reset button.
- This brain can handle simple tasks such as controlling flashing LED lights,
processing signals for remote control cars, making a temperature-humidity
measurement station and displaying it on an LCD screen, etc.
Figure 3.1: Arduino UNO R3 board
- Specifications:
Microcontroller
Operating Voltage
Current Consumption
Input Voltage (recommended)
Input Voltage (limits)
Digital I/O Pins
Analog Input Pins
ATmega328
5V DC (only be supplied by the USB)
About 30mA
7 – 12V DC
6 – 20V DC
14
6
9
DC Current per I/O Pin
DC Current for 3.3V Pin
DC Current for 5V Pin
Flash Memory
SRAM
EEPROM
Clock Speed
30mA
50mA
500 mA
32 KB (ATmega328 of which 0.5 KB used
by bootloader
2 KB (ATmega328)
1 KB (ATmega328)
16MHZ
3.2. UltraSonic HY-SRF05 sensor
- UltraSonic ultrasonic sensor HY-SRF05 is used to sense the distance from the
object to the sensor by the ultrasonic waves
- The sensor has fast response time, high accuracy, suitable for object detection
applications. barrier, measuring distance by ultrasonic wave.
Figure 3.2: UltraSonic HY-SRF05 sensor
- Specifications:
COMPONENTS
Operating voltage
Consumption
current
Communication
signal
Signal pins
VALUES
5V
10 – 40 mA
TTL
Echo, Trigger, Out
10
Scan angle
15 degrees
Broadcast
40KHz
frequency
Measured distance 2 – 450 cm
Tolerance
Dimensions
0.3 cm
43mm x 20mm x
17mm
- The ultrasonic sensor SRF05 has 5 pins (Different from the ultrasonic sensor
srf04 has only 4 pins), including:
+ VCC power supply pin: 5V
+ Trigger: The pin activates the ultrasonic wave. In mode 2, the Trigger pin
has both the function of activating the ultrasonic wave and the function of
receiving the signal when the module receives the ultrasonic wave.
+ Echo pin: Used to detect echo sound waves.
+ Out pin: Mode selects pin.
+ GND pin: 0V power supply.
Working principle: 2 modes
- Mode 1: Use Trigger pin to trigger ultrasonic broadcast and Echo pin to receive
feedback signal. In this mode, the Trigger and Echo pins are used
independently of each other. To use this mode, the Out pin is open circuit (not
connected). The pulse diagram of the sensor pins in mode 1 is as follows:
11
- To enable the SRF05 sensor to emit ultrasonic waves, it is necessary to
generate a pulse with a minimum 1 level width of 10 μs on the Trigger pin.
Then the ultrasonic sensor SRF05 will generate 8 pulses to emit ultrasonic
waves. After the ultrasonic wave is emitted, the Echo pin is immediately pulled
high. If the ultrasonic wave encounters an obstacle and reflects to the
ultrasonic sensor, the Echo pin will be brought down to 0. If the measured
pulse width is greater than 30ms, it means there is no obstacle, or the obstacle
is out of range of module permission.
Mode 2: Use 1 Trigger pin to trigger ultrasonic wave and receive feedback
signal. In this mode, only 1 Trigger pin is used simultaneously for 2 functions
of triggering ultrasonic wave and receiving feedback signal. To use this mode,
it is necessary to connect the Out pin to 0V. The pulse pattern of the sensor
pins in mode 2 is as follows.
Similar to mode 1, to enable ultrasonic, it is necessary to generate pulses with
a width of at least 10μs on the Trigger pin, then the ultrasonic sensor will
generate 8 pulses to emit ultrasonic waves. After the ultrasonic wave is
transmitted, the Trigger pin is pulled to level 1, within a period of 100us-25ms,
if there is an echo, the Trigger pin will be brought down to 0. If the measured
pulse width is larger than 30ms, it means that there is no obstruction, or the
obstacle is outside the allowed range of the module.
3.3 Module Controller Relay 12VDC (Actuator)
12
- We use Module Controller Relay 12VDC to receive the signal from Arduino
UNO R3 to control the sanitizer dispenser
- The Module Controller Relay receive the signal from the UltraSonic HYSRF05 sensor to automatically turn on/off the sanitizer dispenser.
Figure 3.3: Module Controller Relay 12VDC
Specifications
- Size: 50mmx25mm
- Voltage used: 12VDC
- Default signal from microcontroller Using Diode 1N4007 SMD anti-reverse
- Using 78L05 voltage regulator IC
- The maximum amperage through the relay contacts with voltage <= 250V
(AC) is 10A.
- The maximum amperage through the relay contacts with voltage <= 30V (AC)
is 15A.
- The maximum amperage through the relay contacts with voltage <= 250V
(AC) is 10A.
3.4. Water pump
13
Figure 3.4. Water pump
- The water pump is made of high quality material, smooth rotation, low noise and
long lifespan. The water pump is widely used for tea machine, water cooling, fish
tank, and other fields. The pump body is sealed to prevent incidental moisture and
dust from entering.
- Specification:
Working voltage: 12V
Working current: 0.5 – 0.7A
Flow: 1.5 – 2 L/min
Maximum suction range: 2m
Life: 2500 hours maximum
Water temperature: 80˚C
Weight: 110g
Size:10x6x3.5cm
3.5. Batteries
- 9V battery (Quantity: 2)
Figure 3.5.1
- 12V battery (Quantity: 1)
14
Figure 3.5.2
- 12V battery (Quantity: 1)
Figure 3.5.3
3.6. Plastic tube
Figure 3.6
3.7. One-way valve
15
Figure 3.7
3.8. Electrical plastic box (83x58x33cm)
Figure 3.8
3.9. Wires
16
Figure 3.9
3.10. Battery base wire
Figure 3.10
17
IV. SYSTEM DESIGN – SOFTWARE
The general idea of the code is that: We calculate the distance between the
user’s hand and the ultrasonic sensor, compare that to our desired value and decide
whether the sanitizer will be pumped or not.
During the coding phase, our group encountered a problem where the sensor
would lag for a second if no ping echo is received. We thought it was the sensor’s
fault but it turned out perfectly fine when we found the NewPing library for Arduino.
First, we include the library:
#include <NewPing.h>;
We have the contructor:
NewPing sonar(3,2,10);
where 3 is the trigger pin, 2 is the echo pin, and 10 is the max distance in cm.
Next we define relay is connected to pin 4:
int relay=4;
Then, we have void setup(), where we put our setup code to run once, and void
loop(), where we put our main code to run repeatedly
In the void setup, we want to get the value from the sensor, we use the
command
Serial.begin(9600);
to turn on the communication between Arduino and the computer through the
USB cable with the value 9600 is the communication speed between the two
After that, we use
pinMode(relay,OUTPUT);
to decide that the relay is the OUTPUT with 100ms delay by the command
delay(100);
18
In the void loop, we use if else argument along with sonar.ping_cm()
command that sends a ping and get the distance in whole centimeters.
if(sonar.ping_cm()!=0)
If the distance is greater than 0, we will turn on relay and wait 0.5ms:
digitalWrite( relay,HIGH);
Serial.println("HIGH");
delay(500);
and turn off off the relay and wait 5s;
digitalWrite(relay, Low);
delay(5000);
On the other hand, if the distance is 0 or too far (which the value returns 0),
we set the relay off
else if(sonar.ping_cm()==0){
digitalWrite(relay,L0W);
Serial.println("LOW");
}
The command above:
Serial.println()
will print out “HIGH” or “LOW” in the serial monitor in a column for better
visualization than in rows
19
V. RESULTS
First, we fill up the tank with water
Second, we connect the wire to run the system. When we put our hand in front of
the sensor, the sensor will transfer the signal back to the Ardunio UNO. It will
control the pump to release the water from the water tank. Then the Module
controller Relay receive the signal from the Ardunio to control the device.
Finally, the water release from the plastic tube
20
VI. CONCLUSION
1. Achievements
- When put the hand under the sensor, the water automatically come out
- Able to wash the hand without touching the product.
2. Limitation
- Must replace the water in the water tank by hand
- The water tank only enables to contains 500ml of water
- Low longevity life
- Low water pressure
- Have to change the battery
3. Future development
- Improve higher capacity for the water tank
- Increase the water pressure
- Increase battery life
21
REFERENCES
https://chotroihn.vn/module-dieu-khien-relay-12vdc-bang-cam-bien-cham
https://hshop.vn/products/cam-bien-sieu-am-srf05
http://arduino.vn/bai-viet/42-arduino-uno-r3-la-gi
https://chotroihn.vn/day-cam-test-board-21cm-day-duc-duc-day-duc-cai-day-caicai-day-noi-7-mau-20cm
https://www.elprocus.com/what-is-arduino-uno-r3-pin-diagram-specification-andapplications/
https://chotroihn.vn/cam-bien-sieu-am-sfr05
https://www.arduino.cc/reference/en/libraries/newping/
22
APPENDICES
APPENDIX 1: CONTRIBUTION OF TEAM MEMBER
1. Nguyễn Hoàng Bách: Buy components, design the product, assembling, coding
Arduino
2. Nguyễn Quang Huy: Buy components, assembling, making PowerPoint
3. Nguyễn Duy Hiển : Buy components, write the report, find the information of
the components, print the report
4. Phạm Tam Phong : Buy components, write the report, find the information of the
components, coding Arduino
5. Nguyễn Huy Trường Sinh : Buy components, assembling
23
APPENDIX 2: BILL OF MATERIALS
Item
Price(VND)
Ultrasonic Sensor Module SRF 05
39,000
Arduino UNO R3
200,000
Module controller relay 12VDC
25,000
Mini Pump RS385
48,000
Plastic tube
5,000
Plastic box
32,000
wire
7,000
Battery 9V
5,900
Battery 12V
9,900
Battery base wire
2,000
TOTAL
373,800
24
APPENDIX 3: SOFTWARE CODE
#include <NewPing.h>;
NewPing sonar(3,2,10);
int relay=4;
void setup() {
Serial.begin(9600);
pinMode(relay,OUTPUT);
delay(100);
}
void loop() {
if(sonar.ping_cm()!=0){
digitalWrite( relay,HIGH);
Serial.println("HIGH");
delay(500);
digitalWrite(relay, Low);
delay(5000);
}
else if(sonar.ping_cm()==0){
digitalWrite(relay,L0W);
Serial.println("LOW");
}
}
25
26
Download