Вы находитесь на странице: 1из 17

BUILDING AN AI USER

INTERFACE
INTRODUCTION

This project concerns about an attachment for the sewing machine.

The motive behind this project is to save electricity by automatically switching off the
machine when it is not being used.

Students, sometimes workers operating the sewing machine may leave the machine
turned on when not in use. Though the electricity wasted by this is less but in due time,
it can add up to an attentive figure.

With help of Arduino uno we have come up with an attachment i.e., Ultrasonic sensor
which can help us reduce this problem.
INTRODUCTION TO HC-SR04
(ULTRASONIC SENSOR)
 HC-SR04 is an ultrasonic sensor mainly used to determine the
distance of the target object.

 It measures accurate distance using a non-contact technology –


A technology that involves no physical contact between sensor
and object.

 Transmitter and receiver are two main parts of the sensor where
former converts an electrical signal to ultrasonic waves while
later converts that ultrasonic signals back to electrical signals.

 These ultrasonic waves are nothing but sound signals that can
be measured and displayed at the receiving end.
SPECIFICATIONS

PRODUCT HC-SR04
BRAND OKYSTAR
MODEL OKY3261-1
PRICE ₹140
OPERATING VOLTAGE 5V
OPERATING 4MHz
FREQUENCY
DETECTION RANGE 2cm to 400cm
MEASURING ANGLE 30º
RESOLUTION 3mm
OPERATING <15mA
CURRENT
SENSOR DIMENSIONS 45mm*20mm*15mm
HC-SR04 PINOUT & DESCRIPTION
No. Pin Name Pin Description
1 Vcc The Vcc pin powers the sensor, typically with
+5V

2 Trig Pin Trigger pin is an Input pin. This pin has to be


kept high for 10us to initialize measurement
by sending US wave

3 Echo Pin Echo pin is an Output pin. This pin goes high
for a period of time which will be equal to the
time taken for the US wave to return back to
the sensor.

4 Ground This pin is connected to ground.


FUNCTION
The ultrasonic sensor uses sonar to
determine the distance to an object
 The transmitter (trig pin) sends a
signal: a high-frequency sound.
 When the signal finds an object, it is
reflected.
 the transmitter (echo pin) receives it.
ARDUINO
 Arduino is an open-source electronics platform
based on easy-to-use hardware and software.

 Arduino boards are able to read inputs - light on


a sensor, a finger on a button and turn it into an
output - activating a motor, turning on an led.

 User can tell the board what to do by sending a


set of instructions to the microcontroller on the
board.
POWER OUTLET AND SWITCH
 We have used a single power outlet box
with control switch.
 This particular socket is rated for 250V
and 6A.
 Electrical device with power consumption
up to 1200W (just to be on the safe side)
can be easily used with this outlet.
5V RELAY MODULE
 The 5V Relay Module is an important
component of this project.
 It runs on 5V and hence, can be powered
using the Arduino itself.
 This particular module consists of a 5V Relay,
a transistor, a Zener Diode, an Optocoupler
IC, couple of LEDs, corresponding current
limiting resistors, screw terminals and few
male headers for connecting power and other
inputs.
INSTALLING THE ATTACHMENT IN A SEWING MACHINE

 Firstly we will fix an Acetal board on


needle bar that will act as an
obstruction for the sensor.
 Then stick the sensor 2cm above the
obstruction, as shown in the diagram.
 Now establish the connection between
the sensor and switch of the machine
via Arduino UNO.
Obstruction-
Dimension of board as shown.
A circle of radius 0.4cm is cut
at a particular distance to adjust
it around the needle bar.
CONNECTION OF HC-SR04 TO ARDUINO
CONNECTION OF ARDUINO TO POWER SUPPLY

Relay connected to pin 8 Relay connected to switch


CIRCUIT DIAGRAM OF RELAY
CONNECTED TO SWITCH
WORKING
 As we connect the module to 5V and initialize the input pin, it starts transmitting
the sound waves which then travel through the air and hit the required object.
These waves hit and bounce back from the object and then collected by the
receiver of the module.
 Distance is directly proportional to the time these waves require to come back at
the receiving end. The more the time taken, more the distance will be.
 The waves will be generating if the Trig pin is kept High for 10 µs. These waves
will travel at the speed of sound, creating 8 cycle sonic burst that will be
collected in the Echo pin.
 The echo pin remains turned on for the time these waves take to travel and
bounce back to the receiving end. This sensor is mainly incorporated with
Arduino to measure the required distance.
CONTINUED….
Following formula is used to calculate the distance of the object.
S = (V x t)/2
where S is the required distance, V is the speed of sound and t is the time sound waves take to
come back after hitting the object. We need to divide the value by 2 because time will be double
as the waves travel and bounce back from the initial point. Dividing it by 2 will give the actual
distance of the target object.
The sensor will calculate two distances of the obstruction, first at an instance and second just
after 0.5 seconds of that instance.
It will compare the distances.
If they are equal, it denotes that the needle bar is not moving and it will switch off the machine
after 10 seconds of no movement.
If they are not equal, it denotes that the needle bar is moving and it will continue comparing
the distance.
CODE FOR OPERATING SENSOR

code.txt
THANK YOU
PRESENTED BY-
AKANKSHA KUMARI
(BFT/18/1627)
PRINCE (BFT/18/513)
SNEHA MAHTO (BFT/18/1157)
SOMYA (BFT/18/526)

Вам также может понравиться