0% found this document useful (0 votes)
7 views15 pages

Handout Activity Sheet Unit 4

Uploaded by

ashok389405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views15 pages

Handout Activity Sheet Unit 4

Uploaded by

ashok389405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Unit 4

Elements of Automation System


4.1.1 Actuators
An actuator is an electrical or mechanical device that converts energy into physical motion. It
receives signals from a control system and transforms them into physical actions. In an
automation system, actuators are responsible for performing specific actions based on input
signals from sensors or a control unit. Common examples of actuators include motors, solenoids,
and hydraulic or pneumatic cylinders.
Examples
1. Electric motor: An electric motor is an actuator that converts electrical energy into
mechanical energy. An example is a fan, which has a motor that rotates the blades.
2. Robotic arm: An actuator utilized for a wide range of tasks, including assembly, welding,
and painting, is known as a robotic arm.

4.1.2 Types of Actuators


The three main types of actuators are:

Actuators

Pneumatic Hydraulic Electric


Actuator Actuator Actuator

Pneumatic Actuators: - Pneumatic actuators are devices that convert the energy of compressed
air or gas into a mechanical motion that regulates one or more final control elements. Pneumatic
for simple motions.
Hydraulic Actuators:- Hydraulic actuator definition is, a device that is used to change the
fluid’s pressure energy into mechanical motion is known as a hydraulic actuator.
Electric Actuators:- Electric actuators are devices that convert electrical energy into mechanical
motion to perform a specific task. They are used in a wide range of applications, including
industrial automation, robotics, automotive systems, and household appliances. Electric
Actuators are most commonly used.
Figure 1: Electric Actuator

4.1.3 Brushed DC motors


A DC motor is an electric motor that runs on direct current. Brushed DC motors contain
commutator and brush to supply current to the rotor coil. Brushes are made of carbon or graphite.

Figure 2 Circuit diagram of DC motor with 9V battery

4.1.4. Working of DC motor


When a current carrying conductor is placed in a magnetic field it experiences torque. This
torque leads to rotation of shaft of the motor.
Inorder to vary the direction of rotation of DC motor we need to interchange the terminals of DC
Motor
i.e., For Clockwise Rotation - +ve of motor to +ve of Battery, -ve of motor to -ve of Battery
For Anti-Clockwise Rotation - +ve of motor to -ve of Battery, -ve of motor to +ve of Battery
Please Note: DC motor don’t have polarity. No matter what way we connect the motor, it will rotate; just
the direction of rotation changes.

Figure 3 Changing rotation of DC motor


4.1.5. Controlling and speed of general DC motor
A Potentiometer is used to regulate the speed of DC motor.

Figure 4 Circuit diagram of motor with speed control

● Potentiometer is a variable resistor by varying the knob the resistance varies there by the
flow of current controlled in it.

Figure 5. Potentiometer

4.1.6 Servo motors


Servo motors are devices that can turn to a specified position. Using the Arduino, servo arm can
turn 180 degrees. Servo motors were first used in the Remote Control (RC) world, usually to
control the steering of RC cars or the flaps on a RC plane. A servomotor (or servo motor) is a
rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity,
and acceleration.
Figure 6. Servo motors

4.1.7. Working of RC Servo Motors


1. Using an input pin the servomotor receive the position information from the Arduino, in
the form of a square wave, and rotate to that position.
2. Internally, Servo motors have a motor driver and a feedback circuit that makes sure that
the servo arm reaches the desired position.
3. Each cycle in the signal lasts for 20 milliseconds and for most of the time, the value is
LOW.
4. At the beginning of each cycle, the signal is HIGH for a time between 1 and 2
milliseconds. At 1 millisecond it represents 0 degrees and at 2 milliseconds it represents 180
degrees. In between, it represents the value from 0–180.

Figure 14 Working of servo motor

Figure 7. Pinout of servo motor and connecting with Arduino


4.1.8 Application:
1. Pick and place automation
2. Robotic arm
Most of the Industrial Robotic Hand uses servo motors because of its good precision.

4.2.1 Sensors
A sensor is a device that measures physical input from its environment and converts it into data.
It is a device that converts signals from one energy domain to the electrical domain.
Humans have 5 main senses: touch, sight, hearing, smell and taste.
4.2.2 Active and Passive Sensor
An active sensor emits some form of energy, say light or sound, and measures the energy
reflected from the environment, similar to an ultrasound sensor.
A passive sensor measures the energy available in the surroundings. It does not emit a beam of
light or sound or other form of energy for making the measurements.
Example of Active Sensor : Radar (Radio Detection and Ranging) , Lidar ( Light Detection and
Ranging)
Example of passive sensor : PIR Sensor, IR Sensor.
The sensors can also be classified as Analog and Digital Sensors.
Analog Sensors produce an analog output i.e., a continuous output signal (usually voltage but
sometimes other quantities like Resistance etc.) with respect to the quantity being measured.

Figure.8. Analog sensor

Example of Analog sensor


Accelerometers, Pressure sensors, Light sensor, Sound sensors, Temperature sensors.
Digital Sensors The data in digital sensors, which is used for conversion and transmission, is
digital in nature. The sensor which produces discrete output (0’s and 1’s) form is known as
digital sensor. It generates output in binary digital form consisting of binary 1’s &0’.
Examples of Digital sensors
Thermometer, Rotary Encoders, Digital Tachometer
4.2.3 IR Sensor
IR sensor is an electronic device that emits light in order to sense some object in the surroundings.
Usually, in the infrared spectrum, all the objects radiate some form of thermal radiation. These
types of radiations are invisible to our eyes, but infrared sensors can detect these radiations.

4.2.3.1 Working of IR sensor


An IR (infrared) sensor detects the presence of objects based on the infrared radiation they emit.

Figure 9. IR Sensor

It works by emitting infrared radiation and detecting the reflected or emitted radiation from objects
in its field of view. The detector converts the radiation into an electrical signal, which is processed
and compared to a threshold. If the signal is above the threshold, the sensor outputs a signal to
indicate the presence of an object. IR sensors are used in a variety of applications, including
automation, security systems, and remote controls.

4.2.4 Ultrasonic sensor


An ultrasonic sensor is a type of electronic device that emits high-frequency sound waves and
then measures the time it takes for the sound waves to bounce back after hitting an object. This
technology is commonly used in industries such as robotics, automotive, and manufacturing for
proximity sensing, object detection, and distance measurement.

4.2.4.1. Pinout
VCC: supplies power to the HC-SR04 ultrasonic sensor. You can connect it to the 5V output from your
Arduino.

Trig (Trigger): pin is used to trigger ultrasonic sound pulses. By setting this pin to HIGH for 10µs, the
sensor initiates an ultrasonic burst.

Echo: pin goes high when the ultrasonic burst is transmitted and remains high until the sensor receives an
echo, after which it goes low. By measuring the time the Echo pin stays high, the distance can be
calculated.

GND: is the ground pin. Connect it to the ground of the Arduino.

4.3. Programming in Arduino


4.3.1. Data types
void: The void keyword is used only in function declarations. It indicates that the function is
expected to return no information to the function from which it was called.
Boolean: A Boolean holds one of two values, true or false. Each Boolean variable occupies one
byte of memory.
Byte: A byte stores an 8-bit unsigned number, from 0 to 255.

4.3.2. Operators

Operators What it means Remarks (if any)

= Assign a value to a variable

+ Adds two or more values

- Subtracts two or more values


* Multiplies two or more values

/ Divides two or more values

++ Increment by 1 Usually in loops

-- Decrement by 1 Usually in loops

== Checks if two value are equal Usually used in conditionals

4.3.3. Conditionals if else Statement

When using an “if” statement, the code in its body runs only when the if statement evaluates to
true. If it evaluates to false, program execution skips the code in the body of the if statement and
goes to statement the body of the if statement.

By adding an “else” statement, the code in the body of the else statement will run, but only when
its corresponding if statement evaluates to false.

Syntax of “if-else”

If (conditional expression) {
Body of the if statement when conditional expression is true
}
else {
Body of the else statement when conditional expression is false
}
Conditionals { if- else if}

if (conditional expression 1) {
Body of the if statement when conditional expression 1 is true
}
else if (conditional expression 2) {
Body of the else-if statement when conditional expression 1 is false and conditional expression 2
is true
}
else {
Body of the else statement when conditional expression 1 and 2 are both false
}
4.3.4. Realization of Digital Logic
Digital logic is the manipulation of binary values through printed circuit board technology that
uses circuits and logic gates to construct the implementation of computer operations.

Binary Numbers
A binary number is a number expressed in the base-2 numeral system or binary numeral system,
a method of mathematical expression which uses only two symbols: typically "0" (zero) and "1"
(one).

AND Gate
The AND gate is a basic digital logic gate that implements logical conjunction (∧)
from mathematical logic – AND gate behaves according to the truth table. A HIGH output (1)
results only if all the inputs to the AND gate are HIGH (1). If not all inputs to the AND gate are
HIGH, LOW output results.

Symbol:

Truth Table
A B Q=A.B

0 0 0

0 1 0
1 0 0

1 1 1

Circuit Diagram

Task 1: Interfacing AND Gate with Arduino


int buttonPin1 = 2;
int buttonPin2 = 3;
int LEDred = 8;
int buttonStatus1 = 0;
int buttonStatus2 = 0;
void setup() {
pinMode(LEDred, OUTPUT);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
}
void loop(){
buttonStatus1 = digitalRead(buttonPin1);
buttonStatus2 = digitalRead(buttonPin2);
if (buttonStatus1 == HIGH && buttonStatus2 == HIGH ) {
digitalWrite(LEDred, HIGH);
}
else { digitalWrite(LEDred, LOW);
}
}
OR Gate
An OR gate is a digital logic gate with two or more inputs and one output that performs logical
disjunction.
Symbol:
Truth Table
A B C=A+B

0 0 0

0 1 1

1 0 1

1 1 1

Circuit Diagram

Task 2 : Interfacing OR Gate with Arduino


int buttonPin1 = 2;
int buttonPin2 = 3;
int LEDred = 8;
int buttonStatus1 = 0;
int buttonStatus2 = 0;

void setup() {
pinMode(LEDred, OUTPUT);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
}
void loop(){
buttonStatus1 = digitalRead(buttonPin1);
buttonStatus2 = digitalRead(buttonPin2);
// check if the either the first button is HIGH, OR the second button is HIGH, then turn on the
LED
// else turn the LED off
if (buttonStatus1 == HIGH || buttonStatus2 == HIGH )
{ digitalWrite(LEDred, HIGH);
} else { digitalWrite(LEDred, LOW);
}
}

NOT Gate
A NOT gate is a logic gate that inverts the digital input signal. For this reason, a NOT gate is
sometimes is referred to as an inverter.

Symbol

A X

0 1

1 0

Task3: Write the Arduino code and flowchart for interfacing of NOT Gate

Task 4: IR sensor coding for detecting object

Circuit diagram
int IRSensor = 9; // connect ir sensor module to Arduino pin 9
int LED = 13; // connect LED to Arduino pin 13
void setup()
{
Serial.begin(115200); // Init Serial at 115200 Baud
Serial.println("Serial Working"); // Test to check if serial is working or not
pinMode(IRSensor, INPUT); // IR Sensor pin INPUT
pinMode(LED, OUTPUT); // LED Pin Output
}
void loop()
{
int sensorStatus = digitalRead(IRSensor); // Set the GPIO as Input
if (sensorStatus == 1) // Check if the pin high or not
{
// if the pin is high turn off the onboard Led
digitalWrite(LED, LOW); // LED LOW
Serial.println("Object Detected!"); // print Motion Detected! on the serial monitor window
}
else
{
//else turn on the onboard LED
digitalWrite(LED, HIGH); // LED High
Serial.println("Object Not Detected!"); // print Motion Ended! on the serial monitor window
}
}
Task 5: Connection diagram and Coding for detecting object

const int trigPin = 9; //define the trigger pin


const int echoPin = 10; //define the echo pin
long duration; // variable for storing the duration of sound wave travel
int distance; // variable for storing the distance measurement in cm

void setup() {
pinMode(trigPin, OUTPUT); // set the trigger pin as an output
pinMode(echoPin, INPUT); // set the echo pin as an input
Serial.begin(9600); // set the baud rate of serial communication to 9600
}

void loop() {
digitalWrite(trigPin, LOW); // set the trigger pin low
delayMicroseconds(2); // wait for 2 microseconds
digitalWrite(trigPin, HIGH); // set the trigger pin high
delayMicroseconds(10); // wait for 10 microseconds
digitalWrite(trigPin, LOW); // set the trigger pin low again

duration = pulseIn(echoPin, HIGH); // measure the duration of sound wave travel


distance = duration * 0.034 / 2; // calculate the distance in cm based on the speed of sound

Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");

delay(500); // wait for 500 milliseconds before taking another measurement


}

Task 6 : Code “Break Down” for Servo motor interface with Arduino
#include <Servo.h> // Library used for Servo

servo.attach() // Declares the servo object and then initializes the servo
myservo.write() // Declare the amount of degree rotation required for Servo motor

Program to control servo motor:

#include <Servo.h>
Servo myservo;
void setup() {
myservo.attach(6);
}
void loop() {

myservo.write(90);
delay(1000);
myservo.write(0);
delay(1000);

You might also like