Automation & Robotics Record

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Index

1. Applications Of Sensors And Actuators In Automation And Robotics

2. Familiarization With Automation Simulation Software &

Dcs/Scada/Hmi

3. Implement Networking In Automation

4. Introduction To Robotics

5. Robotic Simulation Software Practice

6. Robotic Control Systems

7. Robotic Projects

8. Robotic Programming

9. Hardware Projects

i) Scrolling LED Display controlled by App


ii) IOT Home Automation using Arduino uno Microcontroller\
iii) Open Source Companion Robot using Raspberry Pi4 B
APPLICATIONS OF SENSORS AND ACTUATORS IN AUTOMATION
AND ROBOTICS
UNDERSTANDING AND IMPLEMENT ARDUINO / PLC BASED
PROJECTS

1. Connect Arduino Uno With Blue Tooth Sensor?


Step 1: Gather Components

Make Sure You Have All The Necessary Components:

- Arduino Board (E.G., Arduino Uno, Arduino Nano)

- Bluetooth Module (E.G., Hc-05, Hc-06)

- Sensor (E.G., Temperature Sensor, Ultrasonic Sensor)

- Jumper Wires

- Power Source (E.G., Battery Or Usb Cable)

Step 2: Connect Bluetooth Module To Arduino

Connect The Bluetooth Module To The Arduino Using Jumper Wires. Typically, You'll Need To
Connect Vcc To 5v, Gnd To Gnd, Tx To Rx, And Rx To Tx. However, Some Modules May Have
Different Pin Configurations, So Refer To The Module's Datasheet.

Step 3: Connect Sensor To Arduino

Connect The Sensor To The Arduino Using Jumper Wires. Each Sensor Has Its Own Pinout, So Refer
To The Sensor's Datasheet Or Documentation To Correctly Connect Power, Ground, And Signal
Wires.

Step 4: Power Supply

Ensure That Your Arduino Board And Bluetooth Module Have A Power Supply. This Could Be
Through A Usb Cable Connected To A Computer Or An External Power Source Like Batteries.

Step 5: Install Arduino Ide

If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).

Step 6: Install Bluetooth Library (If Needed)

If Your Bluetooth Module Requires A Specific Library, Install It Using The Arduino Library
Manager. Open The Arduino Ide, Go To "Sketch" -> "Include Library" -> "Manage Libraries." Search
For The Library And Install It.

Step 7: Write Arduino Code

Write A Simple Arduino Sketch That Reads Data From The Sensor And Sends It To The Bluetooth
Module. Here's A Basic Template:

Embedder “C” Program

Include <Softwareserial.H>
Softwareserial Bluetooth(10, 11); // Rx, Tx

Void Setup() {

Serial.Begin(9600);

Bluetooth.Begin(9600);

Void Loop() {

// Read Sensor Data

// Replace The Following Line With Your Sensor Reading Code

Int Sensorvalue = Analogread(A0);

// Send Sensor Data To Bluetooth Module

Bluetooth.Println(Sensorvalue);

Delay(1000); // Adjust As Needed

Step 8: Upload Code To Arduino

Connect Your Arduino Board To Your Computer Using A Usb Cable. Select The Correct Board And
Port In The Arduino Ide, Then Click The "Upload" Button To Upload The Code To Your Arduino.

Step 9: Power Up And Pair Bluetooth

Power Up Your Arduino And Ensure That The Bluetooth Module Is Blinking. Pair Your Bluetooth
Module With Your Computer Or Mobile Device.

Step 10: Receive Data

Use A Bluetooth Terminal App On Your Computer Or Mobile Device To Connect To The Bluetooth
Module And Receive The Data Transmitted By The Arduino. The Data Should Correspond To The
Readings From Your Sensor.
2. Connect Arduino Uno With Blue Ldr Sensor?
Certainly! Here Are Steps To Set Up An Arduino With An Ldr (Light Dependent Resistor) Sensor:

Step 1: Gather Components

Make Sure You Have All The Necessary Components:

- Arduino Board (E.G., Arduino Uno, Arduino Nano)

- Ldr (Light Dependent Resistor)

- Resistor (Usually 10kω)

- Jumper Wires

- Breadboard

- Power Source (E.G., Battery Or Usb Cable)

Step 2: Connect Ldr To Arduino

Connect The Ldr To The Arduino Using A Resistor As A Voltage Divider Circuit. Follow These
Steps:

1. Connect One Leg Of The Ldr To The 5v Pin On The Arduino.

2. Connect The Other Leg Of The Ldr To The Junction Of The Ldr And Resistor.

3. Connect The Free End Of The Resistor To The Ground (Gnd) Pin On The Arduino.

4. Connect The Junction Of The Ldr And Resistor To An Analog Input Pin On The Arduino (E.G.,
A0).

Step 3: Power Supply

Ensure That Your Arduino Board Has A Power Supply. This Could Be Through A Usb Cable
Connected To A Computer Or An External Power Source Like Batteries.

Step 4: Install Arduino Ide

If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).

Step 5: Write Arduino Code

Write A Simple Arduino Sketch That Reads The Analog Value From The Ldr And Prints It To The
Serial Monitor. Here's A Basic Template:

Void Setup() {

Serial.Begin(9600);

Void Loop() {

// Read Analog Value From Ldr

Int Ldrvalue = Analogread(A0);


// Print The Value To The Serial Monitor

Serial.Println(Ldrvalue);

Delay(1000); // Adjust As Needed

Step 6: Upload Code To Arduino

Connect Your Arduino Board To Your Computer Using A Usb Cable. Select The Correct Board And
Port In The Arduino Ide, Then Click The "Upload" Button To Upload The Code To Your Arduino.

Step 7: Open Serial Monitor

Open The Serial Monitor In The Arduino Ide (Tools -> Serial Monitor). You Should See The Analog
Values Corresponding To The Light Level Detected By The Ldr.

3. Connect Arduino Uno With Blue Ir Sensor?


Step 1: Gather Components

Make Sure You Have All The Necessary Components:

- Arduino Board (E.G., Arduino Uno, Arduino Nano)

- Infrared (Ir) Sensor Module (E.G., Ir Obstacle Avoidance Sensor, Ir Proximity Sensor)

- Jumper Wires

- Power Source (E.G., Battery Or Usb Cable)

Step 2: Connect Ir Sensor To Arduino


Connect The Ir Sensor To The Arduino Using Jumper Wires. The Wiring Can Vary Based On The
Type Of Ir Sensor You Have. Generally, The Sensor Will Have Three Pins: Vcc, Gnd, And Out. Here
Is A Basic Example:

1. Connect The Vcc Pin Of The Ir Sensor To The 5v Pin On The Arduino.

2. Connect The Gnd Pin Of The Ir Sensor To The Gnd Pin On The Arduino.

3. Connect The Out Pin Of The Ir Sensor To A Digital Input Pin On The Arduino (E.G., D2).

Step 3: Power Supply

Ensure That Your Arduino Board Has A Power Supply. This Could Be Through A Usb Cable
Connected To A Computer Or An External Power Source Like Batteries.

Step 4: Install Arduino Ide

If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).

Step 5: Write Arduino Code

Write A Simple Arduino Sketch That Reads The Digital Output From The Ir Sensor And Takes
Appropriate Actions Based On Its State. Here's A Basic Template:

Const Int Irsensorpin = 2; // Digital Pin Connected To The Out Pin Of The Ir Sensor

Void Setup() {

Serial.Begin(9600);

Pinmode(Irsensorpin, Input);

Void Loop() {

// Read The State Of The Ir Sensor

Int Irsensorvalue = Digitalread(Irsensorpin);

// Print The State To The Serial Monitor

Serial.Println(Irsensorvalue);

// Add Your Custom Logic Based On The Sensor State

// For Example, You Can Use An If Statement To Check If An Obstacle Is Detected.

Delay(500); // Adjust As Needed

Step 6: Upload Code To Arduino

Connect Your Arduino Board To Your Computer Using A Usb Cable. Select The Correct Board And
Port In The Arduino Ide, Then Click The "Upload" Button To Upload The Code To Your Arduino.

Step 7: Open Serial Monitor


Open The Serial Monitor In The Arduino Ide (Tools -> Serial Monitor). You Should See The Digital
Values (0 Or 1) Corresponding To The State Of The Ir Sensor.

4. Connect Arduino Uno With Blue Pir Sensor?


Step 1: Gather Components

Make Sure You Have All The Necessary Components:

- Arduino Board (E.G., Arduino Uno, Arduino Nano)

- Pir Sensor Module

- Jumper Wires

- Power Source (E.G., Battery Or Usb Cable)

Step 2: Connect Pir Sensor To Arduino

Connect The Pir Sensor To The Arduino Using Jumper Wires. The Pir Sensor Typically Has Three
Pins: Vcc, Gnd, And Out. Here Is A Basic Example:

1. Connect The Vcc Pin Of The Pir Sensor To The 5v Pin On The Arduino.

2. Connect The Gnd Pin Of The Pir Sensor To The Gnd Pin On The Arduino.

3. Connect The Out Pin Of The Pir Sensor To A Digital Input Pin On The Arduino (E.G., D2).

Step 3: Power Supply

Ensure That Your Arduino Board Has A Power Supply. This Could Be Through A Usb Cable
Connected To A Computer Or An External Power Source Like Batteries.

Step 4: Install Arduino Ide


If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).

Step 5: Write Arduino Code

Write A Simple Arduino Sketch That Reads The Digital Output From The Pir Sensor And Takes
Appropriate Actions Based On Motion Detection. Here's A Basic Template:

Const Int Pirsensorpin = 2; // Digital Pin Connected To The Out Pin Of The Pir Sensor

Void Setup() {

Serial.Begin(9600);

Pinmode(Pirsensorpin, Input);

Void Loop() {

// Read The State Of The Pir Sensor

Int Pirsensorvalue = Digitalread(Pirsensorpin);

// Print The State To The Serial Monitor

Serial.Println(Pirsensorvalue);

// Add Your Custom Logic Based On Motion Detection

// For Example, You Can Use An If Statement To Check If Motion Is Detected.

Delay(500); // Adjust As Needed

Step 6: Upload Code To Arduino

Connect Your Arduino Board To Your Computer Using A Usb Cable. Select The Correct Board And
Port In The Arduino Ide, Then Click The "Upload" Button To Upload The Code To Your Arduino.

Step 7: Open Serial Monitor

Open The Serial Monitor In The Arduino Ide (Tools -> Serial Monitor). You Should See The Digital
Values (0 Or 1) Corresponding To The State Of The Pir Sensor.

Based On The Sensor's Output, You Can Modify The Code To Perform Specific Actions When
Motion Is Detected, Such As Turning On Lights, Activating An Alarm, Or Any Other Desired
Behavior.
5. Connect Arduino Uno With Ultra Sonic Sensor?
Step 1: Gather Components

Make Sure You Have All The Necessary Components:

- Arduino Board (E.G., Arduino Uno, Arduino Nano)

- Ultrasonic Sensor (E.G., Hc-Sr04)

- Jumper Wires

- Breadboard

- Power Source (E.G., Battery Or Usb Cable)

Step 2: Connect Ultrasonic Sensor To Arduino

Connect The Ultrasonic Sensor To The Arduino Using Jumper Wires. The Hc-Sr04 Ultrasonic Sensor
Typically Has Four Pins: Vcc, Gnd, Trig (Trigger), And Echo. Here Is A Basic Example:

1. Connect The Vcc Pin Of The Ultrasonic Sensor To The 5v Pin On The Arduino.

2. Connect The Gnd Pin Of The Ultrasonic Sensor To The Gnd Pin On The Arduino.

3. Connect The Trig Pin Of The Ultrasonic Sensor To A Digital Output Pin On The Arduino (E.G.,
D2).

4. Connect The Echo Pin Of The Ultrasonic Sensor To A Digital Input Pin On The Arduino (E.G.,
D3).

Step 3: Power Supply

Ensure That Your Arduino Board Has A Power Supply. This Could Be Through A Usb Cable
Connected To A Computer Or An External Power Source Like Batteries.
Step 4: Install Arduino Ide

If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).

Step 5: Write Arduino Code

Write A Simple Arduino Sketch That Reads The Distance From The Ultrasonic Sensor And Prints It
To The Serial Monitor. Here's A Basic Template:

Const Int Trigpin = 2; // Digital Pin Connected To The Trig Pin Of The Ultrasonic Sensor

Const Int Echopin = 3; // Digital Pin Connected To The Echo Pin Of The Ultrasonic Sensor

Void Setup() {

Serial.Begin(9600);

Pinmode(Trigpin, Output);

Pinmode(Echopin, Input);

Void Loop() {

// Trigger The Ultrasonic Sensor

Digitalwrite(Trigpin, Low);

Delaymicroseconds(2);

Digitalwrite(Trigpin, High);

Delaymicroseconds(10);

Digitalwrite(Trigpin, Low);

// Read The Duration Of The Echo Pulse

Long Duration = Pulsein(Echopin, High);

// Calculate Distance In Centimeters

Int Distance_Cm = Duration 0.034 / 2;

// Print The Distance To The Serial Monitor

Serial.Println(Distance_Cm);

Delay(500); // Adjust As Needed

Step 6: Upload Code To Arduino

Connect Your Arduino Board To Your Computer Using A Usb Cable. Select The Correct Board And
Port In The Arduino Ide, Then Click The "Upload" Button To Upload The Code To Your Arduino.
Step 7: Open Serial Monitor

Open The Serial Monitor In The Arduino Ide (Tools -> Serial Monitor). You Should See The
Distance Values Printed In Centimeters, Corresponding To The Distance Measured By The Ultrasonic
Sensor.

1. Build A Circuit On Proximity Sensor For Sensing Any Object Using Proximity
Sensor And Indicating With Led

Components:
1. Proximity Sensor (E.G., Infrared Proximity Sensor Module)
2. Led (Light Emitting Diode)
3. Resistor (220-330 Ohms)
4. Breadboard
5. Jumper Wires
6. Power Source (E.G., 5v Power Supply Or Arduino Board)
Circuit Diagram:
Explanation:
1. Connect The +5v Of Your Power Source To One Side Of The Resistor R1.
2. Connect The Other Side Of Resistor R1 To The Vcc Pin Of The Proximity Sensor.
3. Connect The Gnd Of Your Power Source To The Gnd Pin Of The Proximity Sensor.
4. Connect The Out Pin Of The Proximity Sensor To The Anode (Longer Leg) Of Resistor
R2.
5. Connect The Cathode (Shorter Leg) Of Resistor R2 To The Cathode Of The Led.
6. Connect The Anode (Longer Leg) Of The Led To The +5v Of Your Power Source.
7. Connect The Cathode (Shorter Leg) Of The Led To The Gnd Of Your Power Source.

Operation:
- The Proximity Sensor Will Output A Signal On Its Out Pin When It Detects An Object
Within Its Sensing Range.
- This Signal Will Cause Current To Flow Through The Led, Lighting It Up.
- The Resistor R2 Limits The Current Flowing Through The Led To Prevent It From Burning
Out.
- When There Is No Object In The Proximity Sensor's Range, The Led Will Remain Off.

Familiarization With Automation Simulation Software & Dcs/Scada/Hmi

1. Implement / Simulate A Counter To Count The Object Detected On The Conveyor At


The Packaging Department With Any Below Process And Update To Plc.

2. Metal Detector Sensor With Plc


A Metal Detector Sensor In A Plc (Programmable Logic Controller) Application Is
Commonly Used For Industrial Purposes, Such As Detecting The Presence Of
Metallic Objects On A Conveyor Belt Or In A Certain Area. Below Is A Simple
Example Of Ladder Logic For A Metal Detector Sensor With A Plc.
Assumptions:
- Input I0: Metal Detector Sensor Input.
- Output Q0: Alarm Or Indication Output.
Ladder Logic Diagram:

Explanation:

1. Metal Detector Sensor (I0): Represents The Input From The Metal Detector
Sensor. This Is Typically A Proximity Sensor Or An Inductive Sensor That Detects
The Presence Of Metallic Objects.

2. Alarm Or Indication Output (Q0): The Coil Of The Output Relay (M) Is
Energized When The Metal Detector Sensor Detects A Metal Object.

Ladder Logic Logic:


- When The Metal Detector Sensor (I0) Detects The Presence Of A Metallic Object,
The Input Becomes True.
- The Normally Open (No) Contact Of The Metal Detector Sensor (I0) Is In Series
With The Coil Of The Output Relay (M0).
- When The Metal Detector Sensor Is Activated, The Normally Open Contact Closes,
Energizing The Coil (M0) And Activating The Output (Q0).
- The Output (Q0) Can Be Connected To An Alarm, A Light, Or Any Other
Indication Device To Signal The Presence Of A Metal Object.

Ladder Logic Program For Conveyor

Ladder Logic Program For Sensor Process.

3. Plastic Detector Sensor With Plc


Detecting Plastic With A Sensor In A Plc Application Is Similar To
Detecting Metal. In This Example, We'll Use A Hypothetical Plastic
Detector Sensor Input (I0) And An Output (Q0) To Indicate The Presence
Of Plastic.

Assumptions:
- Input I0: Plastic Detector Sensor Input.
- Output Q0: Alarm Or Indication Output.

Explanation:

1. Plastic Detector Sensor (I0): Represents The Input From The Plastic
Detector Sensor. This Could Be An Optical Sensor, Ultrasonic Sensor, Or
Any Other Sensor Capable Of Detecting Plastic Objects.

2. Alarm Or Indication Output (Q0): The Coil Of The Output Relay (M)
Is Energized When The Plastic Detector Sensor Detects A Plastic Object.

Ladder Logic Logic:


- When The Plastic Detector Sensor (I0) Detects The Presence Of A Plastic
Object, The Input Becomes True.
- The Normally Open (No) Contact Of The Plastic Detector Sensor (I0) Is In
Series With The Coil Of The Output Relay (M0).
- When The Plastic Detector Sensor Is Activated, The Normally Open
Contact Closes, Energizing The Coil (M0) And Activating The Output (Q0).
- The Output (Q0) Can Be Connected To An Alarm, A Light, Or Any Other
Indication Device To Signal The Presence Of A Plastic Object.

Plc Program
Here Is Plc Program To Remove Empty Detected Bottle On Conveyor, Along With
Program Explanation And Run Time Test Cases.

List Of Inputs And Outputs


I:1/0 = Start (Input)
I:1/1 = Stop (Input)
I:1/2 = Bottle Proximity (Input)
I:1/3 = Empty Bottle Proximity (Input)
O:2/0 = Master Coil / Run (Output)
O:2/1 = Conveyor Motor (Output)
O:2/2 = Blower (Output)
Bsl = Bit Shift Left Instruction (Logical)
B3:0 = Bit Shift Register (Register)
B3:0/3 = Bit To Energize Capping Machine (Bit)
R6:0 = Control Register (Register)
Ladder Diagram To Accomplish Removing Of Empty Bottle

Problem Description
One Open Tank Is Installed In The Plant Of Which Liquid Level Is To Be Controlled. When
Level Reaches The Level Low, Outlet Flow Is Blocked And Inlet Flow Is Allowed Until High
Level Is Achieved. And When Level High Is Detected, Outlet Flow Is Allowed And Inlet Flow Is
Blocked.

4. Color Detector Sensor With Plc


Detecting Colors Using A Sensor In A Plc Application Involves A Sensor Capable Of
Distinguishing Between Different Colors. Color Sensors Often Output Signals
Corresponding To The Detected Color, And You Can Use Ladder Logic To Respond
To Those Signals. Here's A Hypothetical Example:

Assumptions:
- Input I0: Color Sensor Input (Outputs 1 When It Detects A Specific Color, 0
Otherwise).
- Output Q0: Actuator Output (E.G., Turning On A Light Or Triggering A Process).

Ladder Logic Diagram:


Explanation:

1. Color Sensor (I0): Represents The Input From The Color Sensor. This Could Be A
Digital Signal Indicating The Detection Of A Specific Color.

2. Actuator Output (Q0): The Coil Of The Output Relay (M) Is Energized When
The Color Sensor Detects A Specific Color.

Ladder Logic Logic:


- When The Color Sensor (I0) Detects The Specific Color, The Input Becomes True
(1).
- The Normally Open (No) Contact Of The Color Sensor (I0) Is In Series With The
Coil Of The Output Relay (M).
- When The Color Sensor Is Activated (Detects The Specific Color), The Normally
Open Contact Closes, Energizing The Coil (M) And Activating The Output (Q0).
- The Output (Q0) Can Be Connected To An Actuator, Such As Turning On A Light,
Triggering A Process, Or Performing Any Other Desired Action.

5. Magnetic Sensor With Plc

A Magnetic Sensor In A Plc Application Can Be Used To Detect The Presence Or


Absence Of A Magnetic Field, Which Is Often Associated With The Proximity Of
A Magnetic Object. Here's A Simple Example Of Ladder Logic For A Magnetic
Sensor With A Plc:

Assumptions:
- Input I0: Magnetic Sensor Input (1 When A Magnetic Field Is Detected, 0
Otherwise).
- Output Q0: Actuator Output (E.G., Turning On A Light Or Triggering A
Process).
|
Explanation:

1. Magnetic Sensor (I0): Represents The Input From The Magnetic Sensor. This
Could Be A Digital Signal Indicating The Presence Or Absence Of A Magnetic
Field.

2. Actuator Output (Q0): The Coil Of The Output Relay (M) Is Energized When
The Magnetic Sensor Detects A Magnetic Field.

Ladder Logic Logic:


- When The Magnetic Sensor (I0) Detects A Magnetic Field (Outputs 1), The Input
Becomes True.
- The Normally Open (No) Contact Of The Magnetic Sensor (I0) Is In Series With
The Coil Of The Output Relay (M).

- When The Magnetic Sensor Is Activated (Detects A Magnetic Field), The


Normally Open Contact Closes, Energizing The Coil (M) And Activating The
Output (Q0).
- The Output (Q0) Can Be Connected To An Actuator, Such As Turning On A
Light, Triggering A Process, Or Performing Any Other Desired Action.

Water Level Controller Application Using Plc


Problem Diagram
Diagram Of A Single Tank Level Control

Problem Solution
 To Detect High And Low Level Of Liquid In The Tank, Two Level Switches Are Used
Which Gives Output In Digital Terms, That Is When Corresponding Levels Are Detected,
It Gives Output High Otherwise Remain Low.
 To Control Level Of This System, Single Acting Piston Valve Can Be Used Which Has
Two States, Either Fully Open Or Fully Close.
 Low Level Switch Is Mounted At The Bottom Of The Tank And Level High Switch
Mounted At The Side Upper Most Position.
 When This Inputs Are Detected, Output To Control Valve Has To Be Latched In Order
To Continuously Fill Or Empty The System.
 Master Start/Stop Is Also Provided To Shut Down Or Start The Entire Process.
Plc Program
Here Is Plc Program To Control Level Of A Single Tank, Along With Program Explanation And
Run Time Test Cases.

List Of Inputs And Outputs


I:1/0 = Level High Switch (Input)
I:1/1 = Level Low Switch (Input)
O:2/0 = Inlet Valve (Output)
O:2/1 = Outlet Valve (Output)
I:1/14 = Start (Input)
I:1/15 = Stop (Input)
Ladder Diagram To Control This Process

Program Description
 Rung000 Is Simply For Latching A Coil And Master Start-Stop Buttons.
 Rung001 Is To Control The Outlet Valve Through O:2/1. This Is Done When Level High
Is Detected.
 Latching Of Output O:2/1 Is Done Because When High Level Is Detected, Input To
Rung001 Is Temporary, Like Push Button. So In Order To Keep Outlet Valve Open Until
The Level Low I:1/1 Is Detected, Latching Is Done. Xio Of Level Low Switch Is
Connected In Series So That When Level Low Is Detected, It Goes True Closing The
Outlet Valve.
 Similarly In Rung002, It Works Exactly Same. The Only Difference In Rung002 Is That
Extra I:1/14 Contact In Parallel With Lls.
 Suppose When The System Is Started And The Tank Is Partially Filled, Neither Lhs Nor
Lls Is Detected, In This Case, Outlet And Inlet Valves Remain Closed While Inlet Valve
Should Open To Start Filling The Tank Because It’s Partially Filled.
 To Eliminate This Error, I:1/14 (Start) Is Connected In Parallel To Lls I:1/1 Contact. This
Checks If Lhs (I:1/0) Is Detected Or Not. If Lhs Is Not Detected, Then It Opens The Inlet
Valve Until Lhs Is Detected.
Runtime Test Cases
Inputs Outputs Physical Elements
I:1/0 = 1, I:1/1 = 0 O:2/1 = 1, O:2/0 = 0 Lhs Detected, Open Outlet Valve
I:1/0 = 0, I:1/1 = 1 O:2/0 = 1. O:2/1 = 0 Lls Detected, Inlet Valve
I:1/0 = 0, I:1/1 = 0 O:2/0 = 1. O:2/1 = 0 None Detected, Open Inlet Valve

IMPLEMENT NETWORKING IN AUTOMATION

HOME AUTOMATION USING NETWORKING SIMULATOR


Scenario Overview:

1. Device Selection:
- Use Devices Like Pcs, Routers, And Switches To Simulate Home Automation
Components.
- Pcs Can Represent Smart Home Devices (E.G., Lights, Thermostats).
- Routers And Switches Can Represent The Network Infrastructure.

2. Network Topology:
- Design A Network Topology That Resembles A Home Network.
- Connect Pcs To Routers And Switches As Needed.

Steps To Simulate Home Automation:

1. Design Home Automation Devices:


- Use Pcs To Represent Smart Home Devices.
- Name The Pcs According To The Devices They Simulate (E.G., "Smart_Light_Pc,"
"Thermostat_Pc").

2. Connect Devices To Network:


- Connect The Smart Home Devices (Pcs) To The Home Network Using Copper Straight-
Through Cables.

3. Configure Ip Addresses:
- Assign Ip Addresses To The Pcs To Ensure They Are On The Same Subnet.
- Use The Command Line Or Gui Interface Of Each Pc To Set Ip Addresses And Subnet
Masks.

4. Configure Routers:
- If You Have Multiple Networks, Use Routers To Connect Them.
- Configure Static Routes Or Use A Routing Protocol Like Rip Or Ospf.

5. Implement Switching:
- Use Switches To Connect Devices Within The Same Network Segment.
- Ensure Proper Vlan Configurations If Needed.

6. Simulate Iot Protocols:


- Simulate Iot Communication Protocols Such As Mqtt Or Coap Between Devices.
- Use The Packet Tracer Simulation Mode To Monitor Packet Flow.

7. Implement Security:
- Explore Security Features Like Access Control Lists (Acls) On Routers.
- Implement Security Policies To Restrict Access To Home Automation Devices.

8. Monitor Network Traffic:


- Use Packet Tracer's Simulation Mode To Monitor Network Traffic.
- Analyze The Flow Of Data Between Smart Home Devices And Network Infrastructure.

9. Troubleshoot And Optimize:


- Simulate Common Issues And Troubleshoot Network Problems.
- Optimize The Network For Efficiency And Reliability.

Example Commands:

Here's An Example Command To Configure The Ip Address Of A Pc In Packet Tracer:


Router(Config) Interface Fastethernet0/0
Router(Config-If) Ip Address 192.168.1.1 255.255.255.0
Router(Config-If) No Shutdown
```

Introduction To Robotics
Robologix Simulation Software
Robologix Is A Robotics Simulation Software That Allows Users To Simulate And Program
Industrial Robots. It Is Often Used For Educational Purposes And To Develop And Test
Programs For Various Robotic Applications. Below Are A Couple Of Simple Examples
Using The Robologix Simulator:

Example 1: Pick And Place


In This Example, We'll Program A Robot To Pick An Object From One Location And Place
It At Another Location.
Steps:
1. Open Robologix And Create A New Project.
2. Place A Robot In The Workspace.
3. Add Conveyor Belts, A Gripper, And Two Locations For Pick And Place.
Program:
1. Move To Pick Location
2. Activate Gripper (Close Gripper)
3. Move To Object
4. Pick Object
5. Move To Place Location
6. Place Object
7. Activate Gripper (Open Gripper)
8. End
Simulation:

Pick And Place Program Using Robologix

- Run The Simulation, And The Robot Should Pick The Object From The Pick Location,
Move To The Place Location, And Drop The Object.
Example 2: Line Following Robot
In This Example, We'll Program A Robot To Follow A Line Using Sensors.

Steps:
1. Create A Simple Track With A Black Line On A White Background.
2. Place A Robot With Line-Following Sensors.
Program:
1. Start
2. Read Sensor Data
3. If Sensor On The Left, Turn Left
4. If Sensor In The Center, Move Forward
5. If Sensor On The Right, Turn Right
6. Repeat Steps 2-5

Simulation:
- Run The Simulation, And The Robot Should Follow The Black Line On The Track.

Setting Up Robologix

Rokisim Simulation Software


In General, When Working With Any Simulation Or Robotics Software, The Following Steps
Are Typical:
1. Installation:
- Download And Install The Roksim Software On Your Computer.
2. Creating A New Project:
- Open The Software And Create A New Project Or Open An Existing One.
3. Adding Components:
- Add Robots, Sensors, Actuators, And Any Other Components Relevant To Your
Simulation.
4. Programming Or Configuring:
- Program The Behavior Of The Robotic System Or Configure Its Parameters.
- This Might Involve Writing Scripts, Using A Graphical Programming Interface, Or
Setting Parameters Through A Configuration Menu.

5. Simulating:
- Run The Simulation To Visualize How Your Robotic System Behaves.
- Test Different Scenarios And Conditions.

6. Analyzing Results:
- Review Simulation Results To Ensure That The System Behaves As Expected.
7. Optimizing:
- Make Adjustments To Improve The Performance Or Efficiency Of The Robotic System.
8. Documentation:
- Document Your Simulation Setup, Parameters, And Any Important Findings.
9. Troubleshooting:
- If You Encounter Issues, Refer To The Software's Documentation Or Seek Assistance
From Support Channels.

Robotic Control Systems

Robot Analyzer Software


Robotics Projects

1. Build As 3d Maze Robot Game

Above Is A Simplified Example In Python Using A Basic Representation Of A 3d Maze And A


Depth-First Search (Dfs) Algorithm. Note That This Example Assumes A Simple Maze
Structure And Doesn't Consider Real-World Sensors Or Actuators.

This Is A Basic Game Where You Control A Green Player To Navigate Through A Maze To
Reach The Red Goal. The Maze Is Represented As A List Of Strings, Where '' Represents
Walls, 'S' Is The Starting Point, And 'E' Is The Goal. Use Arrow Keys To Move The Player. The
Game Will Print A Message When You Reach The Goal

Python Code
Import Pygame
Import Sys

Constants
Width, Height = 600, 600
White = (255, 255, 255)
Black = (0, 0, 0)
Red = (255, 0, 0)
Green = (0, 255, 0)
Blue = (0, 0, 255)

Maze Representation
Maze = [
"",
"S ",
" ",
" ",
" ",
" E",
""
]

Player And Goal Positions


Player_Pos = (1, 1)
Goal_Pos = (5, 9)

Initialize Pygame
Pygame.Init()

Set Up The Display


Screen = Pygame.Display.Set_Mode((Width, Height))
Pygame.Display.Set_Caption("Maze Solver")

Load Images
Player_Image = Pygame.Surface((30, 30))
Player_Image.Fill(Green)
Goal_Image = Pygame.Surface((30, 30))
Goal_Image.Fill(Red)

Game Loop
While True:
For Event In Pygame.Event.Get():
If Event.Type == Pygame.Quit:
Pygame.Quit()
Sys.Exit()

Keys = Pygame.Key.Get_Pressed()

Move Player Based On Arrow Key Input


If Keys[Pygame.K_Up] And Maze[Player_Pos[0] - 1][Player_Pos[1]] != '':
Player_Pos = (Player_Pos[0] - 1, Player_Pos[1])
Elif Keys[Pygame.K_Down] And Maze[Player_Pos[0] + 1][Player_Pos[1]] != '':
Player_Pos = (Player_Pos[0] + 1, Player_Pos[1])
Elif Keys[Pygame.K_Left] And Maze[Player_Pos[0]][Player_Pos[1] - 1] != '':
Player_Pos = (Player_Pos[0], Player_Pos[1] - 1)
Elif Keys[Pygame.K_Right] And Maze[Player_Pos[0]][Player_Pos[1] + 1] != '':
Player_Pos = (Player_Pos[0], Player_Pos[1] + 1)

Check If The Player Reached The Goal


If Player_Pos == Goal_Pos:
Print("Congratulations! You Reached The Goal.")
Pygame.Quit()
Sys.Exit()

Draw The Maze


Screen.Fill(White)
For Row In Range(Len(Maze)):
For Col In Range(Len(Maze[Row])):
If Maze[Row][Col] == '':
Pygame.Draw.Rect(Screen, Black, (Col 60, Row 60, 60, 60))
Elif Maze[Row][Col] == 'S':
Screen.Blit(Player_Image, (Col 60, Row 60))
Elif Maze[Row][Col] == 'E':
Screen.Blit(Goal_Image, (Col 60, Row 60))

Pygame.Display.Flip()
Pygame.Time.Clock().Tick(30)

2. Write Open Loop And Closed Loop Control For P, Pd, Pi,Pid
Controllers Using Matlab Software
Examples Of Open-Loop And Closed-Loop Control For P, Pd, Pi, And Pid Controllers Using
Matlab. In These Examples, I'll Use A Simple First-Order System For Illustration Purposes.

Let's Consider The Transfer Function Of The Plant:

\[ G(S) = \Frac{1}{S+1} \]

P Controller:

% Plant Transfer Function


G = Tf(1, [1, 1]);

% P Controller
Kp = 1;
Controller_P = Kp;
% Open-Loop System
Open_Loop_P = Series(Controller_P, G);
% Plot Step Response
Figure;
Step(Open_Loop_P);
Title('Open-Loop Response - P Controller');

Pd Controller:

```Matlab
% Plant Transfer Function
G = Tf(1, [1, 1]);
% Pd Controller
Kp = 1;
Kd = 1;
Controller_Pd = Kp + Kds;
% Open-Loop System
Open_Loop_Pd = Series(Controller_Pd, G);

% Plot Step Response


Figure;
Step(Open_Loop_Pd);
Title('Open-Loop Response - Pd Controller');

Pi Controller:

% Plant Transfer Function


G = Tf(1, [1, 1]);
% Pi Controller
Kp = 1;
Ki = 1;
Controller_Pi = Kp + Ki/S;
% Open-Loop System
Open_Loop_Pi = Series(Controller_Pi, G);
% Plot Step Response
Figure;
Step(Open_Loop_Pi);
Title('Open-Loop Response - Pi Controller');

Pid Controller:

% Plant Transfer Function


G = Tf(1, [1, 1]);
% Pid Controller
Kp = 1;
Ki = 1;
Kd = 1;
Controller_Pid = Kp + Ki/S + Kds;
% Open-Loop System
Open_Loop_Pid = Series(Controller_Pid, G);
% Plot Step Response
Figure;
Step(Open_Loop_Pid);
Title('Open-Loop Response - Pid Controller');
Closed-Loop Control:
For Closed-Loop Control, You Need To Add A Feedback Loop To Your System. Let's Use
Unity Feedback For Simplicity.

% Plant Transfer Function


G = Tf(1, [1, 1]);
% Pid Controller
Kp = 1;
Ki = 1;
Kd = 1;
Controller_Pid = Kp + Ki/S + Kds;
% Closed-Loop System
Closed_Loop_Pid = Feedback(Controller_Pidg, 1);
% Plot Step Response
Figure;
Step(Closed_Loop_Pid);
Title('Closed-Loop Response - Pid Controller');

In These Examples, You Can Replace The Plant Transfer Function With The One That
Represents Your System. The Proportional (P), Proportional-Derivative (Pd), Proportional-
Integral (Pi), And Proportional-Integral-Derivative (Pid) Controllers Are Implemented
Accordingly. Adjust The Controller Gains \( K_P \), \( K_I \), And \( K_D \) Based On Your
System Requirements. The Step Response Plots Will Show The System's Response To A
Step Input.
1. Turtlebot Personal Robot

Here's A Basic Example To Get You Started. Make Sure To Have Pygame Installed ( Pip
Install Pygame) Before Running The Code.
Python Code

Import Pygame
Import Sys

Constants
Width, Height = 800, 600
White = (255, 255, 255)
Black = (0, 0, 0)
Red = (255, 0, 0)

Initialize Pygame
Pygame.Init()

Set Up The Display


Screen = Pygame.Display.Set_Mode((Width, Height))
Pygame.Display.Set_Caption("Turtle Bot Personal Robot")

Load Images
Turtle_Bot_Image = Pygame.Surface((50, 50), Pygame.Srcalpha)
Pygame.Draw.Circle(Turtle_Bot_Image, White, (25, 25), 25)
Pygame.Draw.Rect(Turtle_Bot_Image, Black, (10, 25, 30, 5))

Turtle Bot Class


Class Turtlebot:
Def __Init__(Self, X, Y):
Self.Image = Turtle_Bot_Image
Self.Rect = Self.Image.Get_Rect()
Self.Rect.Center = (X, Y)
Self.Speed = 5

Def Move(Self, Direction):


If Direction == "Up":
Self.Rect.Y -= Self.Speed
Elif Direction == "Down":
Self.Rect.Y += Self.Speed
Elif Direction == "Left":
Self.Rect.X -= Self.Speed
Elif Direction == "Right":
Self.Rect.X += Self.Speed

Def Draw(Self):
Screen.Blit(Self.Image, Self.Rect)

Create Turtle Bot


Turtle_Bot = Turtlebot(Width // 2, Height // 2)

Game Loop
While True:
For Event In Pygame.Event.Get():
If Event.Type == Pygame.Quit:
Pygame.Quit()
Sys.Exit()

Keys = Pygame.Key.Get_Pressed()

Move The Turtle Bot Based On Arrow Key Input


If Keys[Pygame.K_Up]:
Turtle_Bot.Move("Up")
Elif Keys[Pygame.K_Down]:

Turtle_Bot.Move("Down")
Elif Keys[Pygame.K_Left]:
Turtle_Bot.Move("Left")
Elif Keys[Pygame.K_Right]:
Turtle_Bot.Move("Right")

Draw The Turtle Bot


Screen.Fill(Red)
Turtle_Bot.Draw()

Pygame.Display.Flip()
Pygame.Time.Clock().Tick(30)

Robot Programming
1. Write A Robo Program To Trace A Eliptical Path ?
2. Write A Robo Program To Trace A Circular Path ?

3. Write A Robo Program To Trace A Triangular Path ?


4. Write A Robo Program To Trace A Trapezoidal Path ?

5.

You might also like