Automation & Robotics Record
Automation & Robotics Record
Automation & Robotics Record
Dcs/Scada/Hmi
4. Introduction To Robotics
7. Robotic Projects
8. Robotic Programming
9. Hardware Projects
- Jumper Wires
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.
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.
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.
If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).
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.
Write A Simple Arduino Sketch That Reads Data From The Sensor And Sends It To The Bluetooth
Module. Here's A Basic Template:
Include <Softwareserial.H>
Softwareserial Bluetooth(10, 11); // Rx, Tx
Void Setup() {
Serial.Begin(9600);
Bluetooth.Begin(9600);
Void Loop() {
Bluetooth.Println(Sensorvalue);
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.
Power Up Your Arduino And Ensure That The Bluetooth Module Is Blinking. Pair Your Bluetooth
Module With Your Computer Or Mobile Device.
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:
- Jumper Wires
- Breadboard
Connect The Ldr To The Arduino Using A Resistor As A Voltage Divider Circuit. Follow These
Steps:
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).
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.
If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).
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() {
Serial.Println(Ldrvalue);
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.
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.
- Infrared (Ir) Sensor Module (E.G., Ir Obstacle Avoidance Sensor, Ir Proximity Sensor)
- Jumper Wires
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).
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.
If You Haven't Already, Download And Install The Arduino Ide From The Official Arduino Website
(Https://Www.Arduino.Cc/En/Software).
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() {
Serial.Println(Irsensorvalue);
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.
- Jumper Wires
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).
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.
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() {
Serial.Println(Pirsensorvalue);
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.
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
- Jumper Wires
- Breadboard
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).
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).
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() {
Digitalwrite(Trigpin, Low);
Delaymicroseconds(2);
Digitalwrite(Trigpin, High);
Delaymicroseconds(10);
Digitalwrite(Trigpin, Low);
Serial.Println(Distance_Cm);
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.
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.
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.
Plc Program
Here Is Plc Program To Remove Empty Detected Bottle On Conveyor, Along With
Program Explanation And Run Time Test Cases.
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.
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).
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.
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.
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.
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
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.
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.
7. Implement Security:
- Explore Security Features Like Access Control Lists (Acls) On Routers.
- Implement Security Policies To Restrict Access To Home Automation Devices.
Example Commands:
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:
- 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
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.
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",
""
]
Initialize Pygame
Pygame.Init()
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()
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.
\[ G(S) = \Frac{1}{S+1} \]
P Controller:
% 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);
Pi Controller:
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()
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))
Def Draw(Self):
Screen.Blit(Self.Image, Self.Rect)
Game Loop
While True:
For Event In Pygame.Event.Get():
If Event.Type == Pygame.Quit:
Pygame.Quit()
Sys.Exit()
Keys = Pygame.Key.Get_Pressed()
Turtle_Bot.Move("Down")
Elif Keys[Pygame.K_Left]:
Turtle_Bot.Move("Left")
Elif Keys[Pygame.K_Right]:
Turtle_Bot.Move("Right")
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 ?
5.