You are on page 1of 51

Vishwakarma Government Engineering College

Department of Instrumentation and Control Engineering

PRACTICAL NO. 1

AIM: - To Identify and Test Electrical Components .

OBJECTIVE

 To identify different electrical and electronic components like resistor, capacitor, diode &
transistor.
 To prepare circuit on breadboard.
 To operate and measure various electronic parameters using multi-meter.

APPARATUS
 Resistor
 Capacitor
 Diode
 Transistor
 Multi-meter
 Breadboard
 Connecting leads
 Hook up wires
 LED
 9V Battery
 Battery Clip
THEORY
Resistor
 A resistor is an electrical component that limits or regulates the flow of electrical
current in an electronic circuit.
 The general formula of resistor is: R=
 Different types of resistors are carbon composition resistor, wire wound resistor,
carbon film resistor etc., the most commonly used resistor is carbon resistor, the
color coding of carbon resistor is given bellow.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Fig 1.1 Color code on resistor

Tab.1.1 Resistance Color Code Table


Capacitor
 A capacitor is a passive electronic component that stores energy in form of
electrostatic field. A capacitor consist of two conducting plates separated by
insulating material called dielectric.
 Different types of capacitors are ceramic capacitors, aluminum capacitors, parallel
plate capacitor etc.
 The general formula of capacitor is 𝑐=
Diode
 It is a specialized electronic component used in many circuits used to manage the
direction of current.
 The most commonly used diode is PN junction diode.
 The diode is made by doping the semiconductor material such as silicon or
aluminum.
Transistor
 Transistor is a device which regulates the flow of current, and mainly used in
digital electronics.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

 There are mainly two types of transistors PNP & NPN.


Breadboard
A breadboard is a solder less device for temporary prototype with electronics and
test circuit designs. Most electronic components in electronic circuits can be
interconnected by inserting their leads or terminals into the holes and then making
connections through wires where appropriate. The breadboard has strips of metal
underneath the board and connect the holes on the top of the board. The metal
strips are laid out as shown below. Note that the top and bottom rows of holes are
connected horizontally and split in the middle while the remaining holes are
connected vertically. Note how all holes in the selected row are connected
together, so the holes in the selected column. The set of connected holes can be
called a node. To interconnect the selected row and column a cable going from
any hole in the row to any hole in the column is needed.

Fig.1.2. Breadboard

Multi-meter
 A multi-meter is an instrument for measuring voltage, current, resistance and
other electronic measurements.
 The two test leads are touched to electrical circuits, and the control dial is used to
determine the measurement which will be taken.

Fig. 1.2. Digital Multi-meter

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Procedure

1. To measure resistance follow the below mentioned steps:


a) Set Digital Multi-meter (DMM) to “Resistance Measurement” mode.
b) Connect the lead between “COM” and “V”.
c) Touch both the leads to the ends of the resistor and check the value displayed on
DMM. In case the value shows out of limit then change the selector switch and select
higher value of resistance range for measurement.
2. To test capacitor follow the below mentioned steps:
a) Make sure the capacitor is discharged.
b) Set the DMM on Ohm range (Set it at least to 1000Ohm = 1k).
c) Connect the meter leads to the capacitor terminals.
d) DMM will show some numbers for a second. Note the reading.
e) And then immediately it will return to the OL (Open Line). Every attempt of Step 2
will show the same result as was in step 4 and Step 5. It means that Capacitor is in
Good Condition.
f) If there is no Change, then Capacitor is not in working condition.
3. To test the diode follow the below mentioned steps:
Digital multi-meters can test diodes using one of two methods:
a) Diode Test mode: almost always the best approach.
i) Turn the dial (rotary switch) to Diode Test mode.
ii) No voltage exists at the diode
iii) Connect the test leads to the diode. Record the measurement displayed
iv) Reverse the test leads. Record the measurement displayed
v) A good forward-based diode displays a voltage drop ranging from 0.5 to 0.8
volts for the most commonly used silicon diodes. Some germanium diodes
have a voltage drop ranging from 0.2 to 0.3 V.
vi) The multimeter displays OL when a good diode is reverse-biased. The OL
reading indicates the diode is functioning as an open switch.
vii) A bad (opened) diode does not allow current to flow in either direction. A
multimeter will display OL in both directions when the diode is opened.
viii) A shorted diode has the same voltage drop reading (approximately 0.4 V) in
both directions
b) Resistance mode: typically used only if a multi-meter is not equipped with a Diode
Test mode.
i) Turn the dial (rotary switch) to Resistance mode
ii) No voltage exists at the diode
iii) Connect the test leads to the diode after it has been removed from the circuit.
Record the measurement displayed.
iv) Reverse the test leads. Record the measurement displayed.
c) For best results when using the Resistance mode to test diodes, compare the readings
taken with a known good diode.
4. To identify and test the transistor follow the below mentioned steps:
a) Steps to identify NPN type transistor:
i) Keep the Multi-Meter in the Diode mode.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

ii) Keep the positive probe to the center pin (Base) of the transistor.
iii) Touch the negative probe to the pin-1 (Emitter). You will see some voltage in
the multi-meter.
iv) Similarly touch the negative probe to the pin-3 (collector) with respect to the
pin-2. You will see some voltage in the multi-meter.
v) It will ensure that it is a NPN transistor. The logic behind this is, in NPN
transistor
Emitter (E) - N type material - Equivalent to cathode of the diode
Base (B) - P type material - Equivalent to anode of the diode
Collector(C) - N type material - Equivalent to cathode of the diode
vi) If the multi-meter positive probe is connected to anode and negative probe is
connected to cathode, then it will show voltage. If the connections are
interchanged it will not show any value.
b) Steps to identify NPN type transistor:
i) Keep the Multi-Meter in the Diode mode.
ii) Keep the positive probe to the pin-1 (Emitter) of the transistor.
iii) Touch the negative probe to the center pin (Base). You will see some voltage
in the multi-meter.
iv) Similarly touch the negative probe to the center pin (Base) with respect to the
pin-3 (collector). You will see some voltage in the multi-meter.
v) It will ensure that it is a PNP transistor. The logic behind this is, in PNP
transistor
Emitter (E) - P type material - Equivalent to anode of the diode
Base (B) - N type material - Equivalent to cathode of the diode
Collector(C) - P type material - Equivalent to anode of the diode
vi) If the multi-meter positive probe is connected to anode and negative probe is
connected to cathode, then it will show voltage. If the connections are
interchanged it will not show any value.
c) Steps to test the transistor:
i) Keep the multi-meter in the Continuity mode.
ii) If the transistor is an NPN, connect the positive multi-meter lead to the Base
and the negative to the Collector terminal.
iii) The multi-meter should indicate continuity, the reading should be about same
as reading obtained when the individual diode was tested across its terminals.
iv) With the positive multi-meter lead still connected to the Base terminal of the
transistor, connect the negative lead to the Emitter terminal. The multi-meter
should again indicate a forward diode junction.
Note: If the multi-meter does not indicate continuity between the base-
collector or base-emitter, the transistor is open.
v) Connect the negative multi-meter lead to the Base and the positive lead to the
Collector. The multi-meter should indicate infinity or no connectivity.
vi) With the negative multi-meter lead connected to the Base, reconnect the
positive lead to the Emitter. There should, again, be no indication of
continuity.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Note: If a very high resistance is indicated by the multi-meter, the transistor is


leaky but it may still operate in the circuit. If a very low resistance is seen, the
transistor is shorted.
vii) To test a PNP transistor, reverse the polarity of the multi-meter leads and
repeat the test. When the negative multi-meter lead is connected to the Base, a
forward diode junction should be indicated when the positive lead is
connected to the Collector or Emitter.
viii) If the positive multi-meter lead is connected to the Base of a PNP transistor,
no continuity should be indicated when the negative lead is connected to the
Collector or the Emitter.
5. To prepare a circuit on breadboard follow the below mentioned steps:
a) Insert the LED into Breadboard.
b) Insert resistor into breadboard, make sure that one leg of resistor is in the series with
LED
c) Insert battery clip on breadboard.
d) Plug battery into battery clip.
Conclusion

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO. 10

AIM: - To prepare shapes and graphics using Turtle and Scratch programs
respectively in Raspberry Pi 3.

OBJECTIVE
 To generate various geometrical shapes using turtle in python programming
 To generate various graphics using scratch programming

APPARATUS
 Monitor with VGA cable and adapter for power supply.
 Micro USB power supply cable and adapter.
 USB based Keyboard and mouse.
 Micro SD card.
 Micro SD card reader
 Raspberry Pi model 3 board.
 HDMI to VGA Converter

THEORY
“Turtle” is a Python feature like a drawing board, which lets us command a turtle to draw all
over it. We can use functions like turtle.forward(…) and turtle.right(…) which can move the
turtle around. Commonly used turtle methods are:
METHOD PARAMETER DESCRIPTION

Turtle() None Creates and returns a new turtle object

forward() amount Moves the turtle forward by the specified amount

backward() amount Moves the turtle backward by the specified amount

right() angle Turns the turtle clockwise

left() angle Turns the turtle counter clockwise

penup() None Picks up the turtle’s Pen

pendown() None Puts down the turtle’s Pen

up() None Picks up the turtle’s Pen

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

down() None Puts down the turtle’s Pen

color() Color name Changes the color of the turtle’s pen

fillcolor() Color name Changes the color of the turtle will use to fill a polygon

heading() None Returns the current heading

position() None Returns the current position

goto() x, y Move the turtle to position x,y

begin_fill() None Remember the starting point for a filled polygon

end_fill() None Close the polygon and fill with the current fill color

dot() None Leave the dot at the current position

stamp() None Leaves an impression of a turtle shape at the current location

shape() shapename Should be ‘arrow’, ‘classic’, ‘turtle’ or ‘circle’

To make use of the turtle methods and functionalities, we need to import turtle ”turtle” comes
packed with the standard Python package and need not be installed externally. The roadmap for
executing a turtle program follows 4 steps:
1. Import the turtle module
2. Create a turtle to control.
3. Draw around using the turtle methods.
4. Run turtle.done().
Scratch is a visual programming tool which allows the user to create animations and games with
a drag-and-drop interface. It allows you to create your own computer games, interactive stories,
and animations using some programming techniques without actually having to write code. It’s a
great way to get started programming on the Raspberry Pi with young people. In scratch
programming we don’t need to remember the instructions, as it is a graphical programming
language. We need to drag and drop the instruction from the list provided.

PROCEDURE
Turtle Programming

Program1: To draw a straight line


import turtle
vgec=turtle.Turtle()
vgec.forward(100)

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 10.1: Straight line


Program2: To draw a square
import turtle
vgec=turtle.Turtle()
vgec.forward(100)
vgec.right(270)
vgec.forward(100)
vgec.right(90)
vgec.forward(100)
vgec.right(90)
vgec.forward(100)

Figure 10.2: Square


Program3: To draw a square using for loop
import turtle
vgec=turtle.Turtle()
for i in range (4):
vgec.forward(100)

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

vgec.right(90)

Figure 10.3: Square using for loop


Program4: To draw a triangle
import turtle
vgec=turtle.Turtle()
vgec.forward(100)
vgec.left(120)
vgec.forward(100)
vgec.right(240)
vgec.forward(100)

Figure 10.4: Triangle


Program5: To draw a circle
import turtle
vgec=turtle.Turtle()
vgec.circle(50)

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 10.5: Circle


Program6: To fill background colour
import turtle
import random
vgec=turtle.Turtle()
turtle.Screen().bgcolor("red")
for i in range (4):
vgec.forward(100)
vgec.right(90)

Figure 10.6: Background Colour


Program7: To draw complex shapes using different pen colour
import turtle
import random
vgec=turtle.Turtle()
turtle.Screen().bgcolor("red")
colours=["yellow", "green", "blue", "white"]
vgec.penup()
vgec.forward(90)
vgec.left(45)
vgec.pendown()
def branch():
for i in range (3):
for i in range (3):

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

vgec.forward(30)
vgec.backward(30)
vgec.right(45)
vgec.left(90)
vgec.backward(30)
vgec.left(45)
vgec.right(90)
vgec.forward(90)
for i in range (8):
branch()
vgec.left(45)
vgec.color(random.choice(colours))

Figure 10.7: Complex Shapes

Scratch Programming

Program: To prepare a dancing girl

Step 1: Open Scratch 2

Figure 10.8: Opening Scratch

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Step 2: Select background from the backdrop library.

Figure 10.9: Selecting Background


Step 3: Delete the default sprite i.e. cat

Figure 10.10: Delete default sprite cat


Step 4: Select dancing ballerina sprite from sprite library

Figure 10.11: Select sprite

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Step 5: Create multiple backdrops for background stage

Figure 10.12: Creating multiple backdrops for background


Step 6: Create multiple backdrops for sprite selected

Figure 10.13: Creating multiple backdrops for sprite


Step 7: Prepare graphical script i.e. program for background stage by selecting suitable
instruction from script menu. Drag and drop the instruction to be used on right hand side of the
page to prepare program

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 10.14: Programming Background


Step 8: Prepare graphical script i.e. program for sprite by selecting suitable instruction from
script menu. Drag and drop the instruction to be used on right hand side of the page to prepare
program

Figure 10.15: Programming Sprite


Step 9: Click on full screen and run the project, i.e. click on green flag and see the gif created
using scratch.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 10.16: Full Screen

Figure 10.17: Screen while running

Figure 10.18: Screen while running

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 10.19: Screen while running

CONCLUSION

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO.2

AIM: - To measure voltage, current, frequency and phase difference using Digital
Oscilloscope (DSO).

OBJECTIVE

 To differentiate between A.C. and D.C. power supply.


 To observe different of A.C. signal generated using function generator.
 To study basics components of AC signal, such as peak to peak, RMS, etc.
 To study operating function generator and DSO.
 To prepare DSO probe.

APPARATUS
 Function Generator.
 DSO.
 Multimeter.
 BNC connector.
 Crocodile pins [ 1 red and 1 black]
 Wire cutter.
 Coaxial/Twisted Cable.
 Insulation tape.
THEORY

A.C. (Alternating Current): Alternating current is the current in which the polarity of source
continuously changes on a fixed frequency. Different types of AC waveforms are shown in
figure below:

Fig 2.1 Sine Wave

Fig 2.2 Triangle Wave

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Fig 2.3 Square Wave

Fig 2.4 Saw Tooth Wave

The RMS value is the effective value of a varying current. It is the equivalent steady DC value
which gives the same effect. For an Example, a lamp connected to 6V AC supply will shine with
the same brightness when connected to a steady 6V DC supply.
Peak Value is the maximum value attained by an alternating quantity during one cycle. The
sinusoidal alternating quantity obtains its peak value at 90°.

Fig 2.5 Peak Value

D.C. (Direct Current): A flow of electricity that goes in one direction only. Direct current can
be obtained from an alternating current supply by use of rectifier and battery is a good dc power
supply.

Fig 2.6 D.C. Signal

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Digital Storage Oscilloscope:


 It displays and stores the signal digitally rather than using analog techniques.
 It has advanced trigger, storage, display and measurement features.
 The input analogue signal is sampled and then converted into digital record of the
amplitude of the signal at each sample time.
 These digital values are then turned back into an analogue signal for display on a Cathode
Ray Tube or transformed as needed for possible types of output like LCD, chart recorder,
plotter or network interface.

Fig 2.7 Digital Storage Oscilloscope


Function Generator:
 It is usually a piece of electronic test equipment or software used to generate different
types of electrical wave forms over a wide range of frequencies.
 A typical function generator can provide frequencies up to 20 MHz.
 Output amplitude up to 10 V peak-peak.
 An output impedance of 50 Ω.

Fig 2.8 Function Generator

1] With DC Offset: DC offset is a mean amplitude displacement from zero. In Audacity it can be
seen as an offset of the recorded wave form away from the center zero point.DC offset is a
potential source of clicks,distortion and loss of audio volume.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Fig 2.9 With DC Offset

2] Without DC Offset: When describing a periodic function in the time domain, the DC offset, or
is the mean amplitude of the waveform. If the mean amplitude is zero, there is no DC offset. A
waveform with no DC offset is known as a DC balanced or DC free waveform

Fig 2.9: Without DC Offset

Digital Storage Oscilloscope Probe:


Oscilloscope probes normally comprise a BNC connector, the coaxial cable (typically around a
metre in length) and what may be termed the probe itself. This comprises a mechanical clip
arrangement so that the probe can be attached to the appropriate test point, and an earth or
ground clip to be attached to the appropriate ground point on the circuit under test.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Fig 2.10: DSO Probe

PROCEDURE
To prepare DSO probe
 Take the BNC connector and open it
 Take the coaxial cable of required length
 Connect the centre of the coaxial cable wire to the centre of the BNC connector
 Connect the rest of the wire surrounding the circular ring available.
 Close the BNC connector
 At the other end of the coaxial cable connect the banana pins with the centre cof coaxial
cable connected with red colour banana clip and surrounding wire to the black colour
banana clip.
 Check the continuity of banana clips with surrounding body of BNC and centre of BNC
connector with Black and red colour banana clips respectively.
To operate DSO and function generator
 Turn on DSO.
 Select appropriate language
 Test the channel and DSO probe by connecting probe at Channel 1 the BNC connector
and red banana clip on 5Vp-p pulse connection near the DSO screen and connect black
banana pin to the ground connection near DSO screen.
 Connect the DSO channel 1 to the output of the function generator through DSO probe.
 Vary the Volts/Division knob of channel1 and time/division knob present at Horizontal
axis to see the waveform clearly.
 Adjust the trigger knob near zero line so that a steady waveform can be seen on the
screen.
 Measure amplitude, frequency and other parameters from the functionality available on
the DSO.
 Change the waveform and observe the changes.
 Change frequency and amplitude from function generator of the waveform and observe
the changes
 Observe the changes arising by changing the amplitude of DC offset in the function
generator on the DSO screen.
CONCLUSION :

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO: 3

AIM: - To study various electrical equipments and prepare electrical wiring


diagram.

OBJECTIVE

 To wire a switch and bulb


 To learn two way switch wiring.
 To learn types of cables and switches.
 To understand about MCB wiring.
 To understand about ELCB.

APPARATUS

 Single phase power supply point


 Lamp
 Lamp holder
 Two way switch
 Single way switch
 Multi-meter
 0.75cm2 electrical wire
 3 pin/ 2 pin plug
 Tester

THEORY
Earth Leakage Circuit Breaker (ELCB)

An Earth Leakage Circuit Breaker (ELCB) is a safety device used in electrical installations
with high earth impedance to prevent shock. If there is no fault anywhere in a circuit
supplying single-phase alternating power to a unit such as an electrical appliance, machine or
other equipment, the current flowing to the unit at any instant in the "hot" or "live" wire
should exactly match the current flowing away from the unit in the neutral wire. Similarly,
there should be no current flowing in the unit's safety "ground" or "earth" wire.

An ELCB is a specialized type of latching relay that has a building's incoming mains power
connected through its switching contacts so that the ELCB disconnects the power in an earth
leakage (unsafe) condition. The ELCB detects fault currents from live (hot) to the earth
(ground) wire within the installation it protects. If sufficient voltage appears across the
ELCB's sense coil, it will switch off the power, and remain off until manually reset. An Earth
Leakage Circuit Breaker is a safety device used in electrical installations with high Earth
Impedance to prevent shock. It detects small stray voltages on metal enclosures.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 3.1 Components of ELCB

Miniature Circuit Breaker (MCB)

Circuit breakers used in residential and light commercial installations are referred to as
miniature circuit breakers (MCBs). Miniature circuit breakers typically include an electrical
contact mounted on a movable contact carrier which rotates away from a stationary contact in
order to interrupt the current path.

An MCB is a device designed to protect a circuit's wiring from the serious damage which
would be caused if it has to carry a current which is too high to withstand. Such a current
could easily heat up the wires so much that their insulation melts. If that situation were
allowed to develop further it would soon cause the conductor in a cable to short out and to
burn so hot that they could easily cause a house fire.

Before circuit breakers were invented, simple wire fuses were used. The wire in the fuses was
deliberately made much thinner than the wires in the circuits they were intended to protect.
Thus, if a fault condition occurred, as the current in the circuit grew higher and higher, a
point would be reached at which the thin wire of the fuse would get so hot that it would melt
all safely contained within the body of the fuse - and thus break the flow of current in the
circuit it was protecting.

The problem with fuses is that depending on their design, as some are faster-acting than
others - it can take a significantly longer amount of time for them to operate compared with
today's very-fast-acting circuit breakers. That fact means that, if a circuit overload current
fault condition occurs, considerable damage can still occur both to the circuit wiring and/or to
the unit it is supplying with power. Then, after the fault condition has been fixed, the melted
or "blown" fuse wire in a rewire-able type of fuse has to be replaced. A circuit breaker, if it is
still in good condition, only needs to be reset.

Miniature circuit breakers are compact devices used in distribution boards for protection
against overload and short circuit. The overload protection is achieved by a thermal trip
mechanism using a bimetallic strip. An electromagnetic trip mechanism is also incorporated

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering
for instantaneous tripping in the event of a short circuit. When there is a sudden increase in
current due to a short circuit, the circuit should open immediately, but the bimetallic strip
does not respond quickly. In this case, the solenoid attracts the plunger and thus triggers the
trip mechanism. After clearing the fault, the MCB can be switched on manually.

For light load in domestic appliances like fans, tube lights, bulbs, iron, are protected by 5A
current rated MCB and heavy load like geyser, air conditioner, washing machine are
protected by 15A current rated MCB.

The principle of operation of an MCB is based on the following two principles.

A. Thermal operation

In thermal operation, the extra heat produced by the high current warms the bimetal
strip. This results in bending the bimetallic strip and trips the operating contacts. The
thermal operation is slow. Hence, it is not suitable for speedy disconnection required
to clear fault currents. However, it is ideal for operation in the event of small but
prolonged overload currents. Thus, in general the thermal operation is suitable for
opening the circuit in the event of excessive current due to the overloaded machines.

B. Magnetic operation
The magnetic operation, on the other hand is suitable for protection against high short
circuit currents. This magnetic operation is due to the magnetic field set up by a coil
carrying the current, which attracts an iron part to trip the breaker when the current
becomes large enough. The magnetic operation is very fast and is used for braking
fault currents. In most cases of MCB s, both types are provided so that overload
currents and short circuit currents are handled with the same degree. It should
however be remembered that the mechanical operation of opening the contacts takes a
definite minimum time, typically 20ms, so that there can never be the possibility of
truly instantaneous operation. In many installations, MCBs are preferred over fuses
mainly because there is no need of rewiring the fuse wire or replacing the cartridge.
MCBs are available in a range of 0.5A to 63A normal operating current and for the
entire range, the, physical dimensions are almost identical.

Advantages of MCB

 Instantaneous opening of the contact on short circuit faults


 Can be designed to operate even for very small overload currents
 They can be quickly reset by hand
 They cannot be reclosed if fault persist
 In many cases they preferred over fuses as there is no need to rewire it.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 3.2 Miniature Circuit Breaker

Procedure

1. Steps to connect single way switch with lamp (as per fig 3.3 given below)
a) Connect single way switch with electrical wire to lamp holder.
b) Connect lamp in lamp holder
c) Connect 3 pin or 2 pin plug with electrical wire and connect it with the circuit.
d) Connect the plug to the 230V AC.
e) By turning on and off the switch check the status of the lamp.

Figure 3.3 Wiring Diagram of Single Way Switch

2. Steps to connect 2-way switch with lamp (as per fig 3.4 given below)
a) Connect 2 way switch with electrical wire to lamp holder as shown in figure.
b) Connect lamp in lamp holder
c) Connect 3 pin or 2 pin plug with electrical wire and connect it with the circuit.
d) Connect the plug to the 230V AC.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering
e) By turning on and off the switch check the status of the lamp.

Figure 3.3 Wiring Diagram of Single Way Switch

Conclusion

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO.4
AIM: - To prepare series and parallel circuit on General Purpose Circuit Board
(GPCB)

OBJECTIVE

 To learn placement of electrical components on GPCB


 To solder and de-solder electrical components on GPCB
 To measure current and voltage in series and parallel current

APPARATUS
 Resistor
 GPCB
 Hook up wires
 Solder and de-solder iron
 Solder wire
 Multi-meter

THEORY
Series Resistor Circuit: Resistors are said to be connected in “Series”, when they are daisy
chained together in a single line. Since all the current flowing through the first resistor has no
other way to go it must also pass through the second resistor and the third and so on. Resistors in
series have a common current flowing through them as the current that flows through one
resistor must also flow through the others as it can only take one path. There is a voltage drop
across each resistor. Equivalent resistance is given as:
𝑅 = 𝑅 + 𝑅 +⋯.𝑅

Fig 4.1 Series Circuit

Parallel Resistor Circuit: In a parallel resistor network the circuit current can take more than one path
as there are multiple paths for the current. Then parallel circuits are classed as current dividers. Since
there are multiple paths for the supply current to flow through, the current may not be the same through
all the branches in the parallel network. However, the voltage drop across all of the resistors in a parallel
resistive network is the same. Then, Resistors in Parallel have a Common Voltage across them and this is
true for all parallel connected elements. The equivalent resistance is given as

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

1 1 1 1
= + + ……
𝑅 𝑅 𝑅 𝑅

Fig 4.2 Parallel Circuit

Soldering

Soldering is a joining process wherein coalescence is produced by heating below 800°F, using a
non-ferrous filler metal with a melting point below that of the base metal. The metals to be
joined dictate the flux, solder, and heating methods to be used. Base metals are selected for
specific properties such as electrical conductivity, weight, and corrosion resistance.

To achieve a sound soldered joint, the following should be considered:

 Joint design: They should be designed with the requirements of solder and their
limitations in mind.
 Pre-cleaning: The surfaces must be thoroughly cleaned to allow the solder to wet the base
metal.
 Fluxing: A flux must be provided to remove traces of surface film or oxides and to
prevent formation of oxides during the soldering operation.
 Proper fixtures or alignment of parts must be maintained to insure a sound soldered joint.
 Heating of the base metals should be uniform or even on base metals, to insure good
penetration of the filler alloy into the joint. If a noncorrosive flux is used no further
cleaning is necessary. The use of a corrosive flux makes flux residue removal imperative.

Basic Steps of Soldering

1. Joint fitting: A clearance of 0.005" is suitable for most soldering. When soldering
precoated metals, a clearance of 0.001" is recommended for maximum mechanical
strength.
2. Types of cleaning include:
Mechanical - Scotch Brite pad, emery cloth
Chemical - cleaning using acids to remove rust, scale or sulfides. Most commonly used
acids are hydrochloric and sulphuric.
3. Application of flux
 Flux should be capable of removing oxides and stop them from reforming.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

 Flux should permit displacement by the solder.


 Flux should promote wetting of the surface by the solder.
4. Application of heat: Heating the joints evenly or uniformly is of utmost importance to
insure a sound joint.
5. Types of soldering equipment:
 Soldering irons – electric
 Plumbers torch - propane low heat
 Dip soldering - large tank with molten solder to solder multiple joints
 Oven heating - only used in production where other heating methods are
impractical
6. Applying the Solder takes place in two steps:
 Wetting the metal surfaces
 Filling the gap between the wetted surfaces with solder
 Depending upon conditions dictated by the application, each step can be done
separately. This allows for more easily controlled conditions.
7. Cooling the Joint: As soon as possible after soldering the joint may be cooled using a
water spray or air blast. Slow cooling could cause excessive alloying, resulting in a brittle
joint.
8. Flux Residue Treatment: Non-corrosive fluxes are ones which are rosin base and do not
require removal. Corrosive fluxes are fluxes containing zinc chloride. Removal is a must
to prevent corrosion.

Fig 4.3 Procedure to Solder

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Fig 4.4 Types of Joint

Safety Precautions

Most of solder wires or solder paste contain lead (solder alloy is mixture of tin and lead). During
soldering operation lead may produce fumes that are dangerous for your health. In addition,
soldering wire usually has a flux in the middle of wire. There are different types of cored solder
with different solder to flux rate. Flux containing rosin (colophony) produces solder fumes that,
if inhaled, can be hazardous.

 Soldering should be performed only in a well-ventilated area.


 Use smoke absorber
 Soldering iron is very HOT (for most of soldering operation temperature of iron is 350 -
400 degrees Celsius). Never touch tip of the soldering iron with your hand.
 Never leave your hot iron down on anything other than an iron stand.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

 Keep flammable liquids and materials (such as alcohol, solvent etc.) away from the work
area.
 Wear eye protection.
 Do not cut off a grounding prong on an iron plug to make it fit an ungrounded receptacle.
 Hold wires to be heated with tweezers, pliers or clamps to avoid receiving burns on your
fingers from objects that are heated.
 Wear ESD (Electro-Static Discharge) protection if you are going to solder electro-static
sensitive components such as CMOS components. For most of DIY projects it will be
good enough to wear ESD wrist straps.
 Wash your hands with soap and water after soldering.

De-Soldering

While being able to make good solder joints is very important, another skill that can be equally
important is to know how to de-solder well. Every electronic project will have one problem or
another and often this will involve de-soldering a joint. It could be that a wrong component has
been used, the circuit needs changing, or a soldered joint is not satisfactory. If any de-soldering
is not done well, then it can damage a printed circuit board or components, leading to costly or
time consuming rebuild. De-soldering a joint may not be easy. Coupled to this, if heat is applied
to the joint for too long, it is likely to damage the printed circuit board, if one is used, or it can
easily damage a component. It is therefore necessary to tackle any jobs with care, and by using
the right tools. Below mentioned tools can be used for de-soldering:

1. Copper Braid
Copper braid is commonly used to de-solder electronic components. This technique
involves melting the solder flux and then allowing the copper braid to absorb it. The braid
is placed on the solid solder and gently pressed with a heated soldering iron tip. The tip
melts the solder, which is quickly absorbed by the braid. This is an efficient but slow
method of de-soldering components since each soldered joint must be worked on
individually.
2. Solder Sucker
Solder sucker is basically a small tube connected to a vacuum pump. Its purpose is to
suck the molten flux off of pads. A heated soldering iron tip is first placed on the solid
solder until it melts. The solder sucker is then placed directly on the molten flux and a
button on its side is pushed that quickly sucks the flux.
3. Heat Gun
De-soldering with a heat gun is generally used to de-solder SMD components, though it
can also be employed for through-hole components. In this method, the board is placed
on a perfectly flat place and a heat gun is pointed directly at the components to be de-
soldered for a few seconds. This quickly melts the solder and on the pads, loosening the
components. They are then immediately lifted with the help of tweezers. The downside of
this method is that it is very difficult to use for small, individual components since the
heat can melt the solder on nearby pads, which can dislodge components that are not be
de-soldered. Also, the molten flux can flow to nearby traces and pads, causing electrical

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

shorts. It is therefore very important to keep the board as flat as possible during this
process.

PROCEDURE:
1. Solder needs a clean surface on which to adhere.
 Buff the copper foil of a PC board with steel wool before soldering.
 Remove any oil, paint, wax, etc. with a solvent, steel wool, or fine sandpaper.
2. To solder, heat the connection with the tip of the soldering iron for a few seconds, then
apply the solder.
 Heat the connection, not the solder.
 Hold the soldering iron like a pen, near the base of the handle.
 Both parts that are being soldered have to be hot to form a good connection.
3. Keep the soldering tip on the connection as the solder is applied.
 Solder will flow into and around well-heated connections.
 Use just enough solder to form a strong connection.
4. Remove the tip from the connection as soon as the solder has flowed where you want it to
be. Remove the solder, then the iron.
5. Don't move the connection while the solder is cooling.
6. Don't overheat the connection, as this might damage the electrical component you are
soldering.
 Transistors and some other components can be damaged by heat when soldering.
A crocodile clip can be used as a heat sink to protect these components.
7. Soldering a connection should take just a few seconds.
8. Inspect the joint closely. It should look shiny.
 If you are soldering a wire (called the lead) onto a PC board (on the track), it
should have a volcano shape.
 If the connection looks bad, reheat it and try again.
9. Wipe the tip of the iron on a damp sponge to clean it. The tip should now be shiny.
10. Unplug the soldering iron when it is not in use and place it on stand.
11. Heat the de-solder iron.
12. Place on the joint the de-solder iron which you want to de-solder.
13. Suck the heated part.

CONCLUSION:

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO.5

AIM: - To create a website page using HTML language.

OBJECTIVE

 To learn HTML coding.


 To enhance creative ways of presentation.

APPARATUS
 Personal Computer
 Internet connection

THEORY: ❯

HTML is abbreviation of Hyper Text Markup Language. HTML is the standard markup
language for creating Web pages. HTML describes the structure of Web pages using markup.
HTML elements are the building blocks of HTML pages. HTML tags label pieces of content
such as "heading", "paragraph", "table", and so on. Browsers do not display the HTML tags, but
use them to render the content of the page. Only the content inside the body section is displayed
in a browser.

 HTML tags normally come in pairs like <p> and </p>.


 The first tag in a pair is the start tags also called the opening tab, the second tag is the end
tag the closing tab.
 The end tag is written like the start tag, but with a forward slash inserted before the tag
name

Web pages can be created and modified by using professional HTML editors. However, for
learning HTML we should use a simple text editor like Notepad (PC) or TextEdit (Mac) because
it is better to learning HTML.

HTML Tags:

 The <html> element is the root element of an HTML page.


 The <head> element contains meta information about the document.
 The <title> element specifies a title for the document.
 The <body> element contains the visible page content.
 The <h1> to <h6> element defines a size of font.
 The <p> element defines a paragraph.
 The <b> element defines a bold font.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

 Images are defined with the <img> tag. The <img> tag is empty, it contains attributes
only, and does not have a closing tag.
 CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be
displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the
layout of multiple web pages all at once.

CSS can be added to HTML elements in 3 ways:

 Inline - by using the style attribute in HTML elements


 Internal - by using a <style> element in the <head> section
 External - by using an external CSS file

HTML Attributes:

 All HTML elements can have attributes.


 Attributes provide additional information about an element.
 Attributes are always specified in the start tag.
 The filename of the image source is specified in the src attribute.
 Images in HTML have a set of size attributes, which specifies the width and height of the
image.
 The alt attribute specifies an alternative text to be used, when an image cannot be
displayed.
 The style attribute is used to specify the styling of an element, like color, font, size etc.

HTML Entities:
Reserved characters in HTML must be replaced with character entities. Characters that are not
present on your keyboard can also be replaced by entities. Some characters are reserved in
HTML. If you use the less than (<) or greater than (>) signs in your text, the browser might mix
them with tags. Character entities are used to display reserved characters in HTML. Browser
may not support all entity names, but the support for number is good.

A character entity looks like this:

&entity name; or &#entity number;

 A common character entity used in HTML is the non-breaking space: &nbsp;.A non-
breaking space is a space that will not break into a new line.
 &#8594; is entity number and &rarr; is entity name for rightwords arrows(→).

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PROCEDURE

 Open Notpad (PC) or Textedit (Mac).


 Write HTML code for making one’s profile page for website.
 Save the HTML page with html or htm extension.
 View the HTML page in your browser like internet explorer.

Observation
The profile page for website and its HTML code is attached with the practical

Conclusion

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO. 6

AIM: - To study hardware and install Operating System in Raspberry Pi 3.

OBJECTIVE
 To study various elements present on Raspberry Pi 3 board
 To study specification of Raspberry Pi 3 Board.
 To learn to install operating system in Raspberry Pi 3 boards.

APPARATUS
 Monitor with VGA cable and adapter for power supply.
 Micro USB power supply cable and adapter.
 USB based Keyboard and mouse.
 Micro SD card.
 Micro SD card reader
 Raspberry Pi model 3 board.
 HDMI to VGA Converter
 Desktop with SD card formatter software installed.
THEORY

Figure 6.1: Raspberry Pi 3 Board

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

The Raspberry Pi is a series of low-cost, palm-sized single-board computers developed by


Raspberry Pi Foundation in the UK. The intention behind the creation of the Raspberry Pi is to
promote the teaching of basic computer skills in schools, which it serves very well. Raspberry Pi
has expanded its footprint well beyond its intended purpose by penetrating the embedded
systems market and computer science research. Initially, the aim was to rekindle the
microcomputer revolution of the 1980s, which produced a whole generation of skilled
programmers. The Raspberry Pi is manufactured with licensed agreements with Newark
element14, RS Components, Allied Electronics, and Egoman. These companies manufacture and
sell the Raspberry Pi. The hardware is the same across all manufacturers.

The name, Raspberry Pi, was the combination of the desire to create an alternative fruit-based
computer (such as Apple, BlackBerry, and Apricot) and a nod to the original concept of a simple
computer that can be programmed using Python (shortened to Pi).

Figure 6.2: Specifications of various models of Raspberry Pi

PROCEDURE
 Install SD card formatter software on the desktop.
 Insert the Micro SD memory card into card reader and using desktop read the same.
 Open the SD card formatter software and select the drive which accesses the micro SD
card reader.
 Select the quick format option in it.
 Click on Format button.
 Download from https://www.raspberrypi.org/downloads zip file of NOOBS (New Out of
Box Software) version 2.8.
 Unzip the file into the micro SD card
 Remove the card reader and from it the micro SD card reader.
 Insert the micro SD card to the slot of micro SD card available on the raspberry pi board.
 Connect the USB keyboard and mouse to the Raspberry Pi 3 board.
 Connect the monitor through VGA to HDMI converter to the raspberry Pi 3 board.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

 Connect power cable to micro USB port through a 2A adapter


 Turn on the power supply to see on the desktop visual of raspberry pi 3.
 Select Raspbian operating system and install it as it appears first time on the screen.
 After installing raspbian we can see the GUI of raspbian where we need to set up date,
language preference and region.
 If we want to change default login and password details we can change and select next.
(Login Id is “pi” and password is “raspberry”) (Details are case sensitive hence make
sure to type it correctly)
 As raspberry pi has inbuilt WiFi module, if there is WiFi available for internet connection
connect it or else we can use LAN network for internet connection, by making necessary
changes.
 Now the raspberry pi is ready for use.

CONCLUSION:

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO. 7

AIM: - To perform command terminal instruction and use nano editor in


Raspberry Pi 3.

OBJECTIVE
 To learn command terminal instructions
 To edit python program in nano editor

APPARATUS
 Monitor with VGA cable and adapter for power supply.
 Micro USB power supply cable and adapter.
 USB based Keyboard and mouse.
 Micro SD card.
 Micro SD card reader
 Raspberry Pi model 3 board.
 HDMI to VGA Converter
THEORY
Raspbian features a terminal called LXTerminal where you can issue text commands to the
system. This is equivalent to the command prompt in Windows Operating System.

Nano Editor is a feature provided in terminal of Raspbian, which helps in editing the python
program or build a new python program. GNU Nano is at the easy-to-use end of command-line
editors. It's installed by default in board.

PROCEDURE
Command Terminal Instructions
 Open the terminal window by clicking on the third icon on the right of the Menu bar and
use the instructions as follows:

Figure 7.1: Terminal Window

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

1. pwd: Stands for present working directory and should show default “/home/pi” as
2. ls –la: One of the key aspects of using a terminal is being able to navigate your file
system. This command is used for the same.
3. sudo: Some commands that make permanent changes to the state of your system require
you to have root privileges to run. The command sudo temporarily gives your account (if
you're not already logged in as root) the ability to run these commands, provided your
user name is in a list of users ('sudoers'). When you append sudo to the start of a
command and press enter you will be asked for your password, if that is entered correctly
then the command you want to run will be run using root privileges. Be careful though,
some commands that require sudo to run can irreparably damage your system so be
careful.
4. apt: You can use the apt command to install software in Raspbian. This is the 'package
manager' that is included with any Debian-based Linux distributions (including
Raspbian). It allows you to install and manage new software packages on your Pi.
5. sudo apt install <package name>: In order to install a new package, you would type
sudo apt install <package-name> (where <package-name> is the package that you want
to install).
6. sudo apt update: Running sudo apt update will update a list of software packages that
are available on your system.
7. sudo apt upgrade: If a new version of a package is available, then sudo apt upgrade will
update any old packages to the new version.
8. sudo apt remove <package-name>: removes or uninstalls a package from your system.
9. sudo ip addr: Enables to see the IP address of the Raspberry Pi board
10. sudo apt-get update: Synchronizes the list of packages on your system to the list in the
repositories. Use it before installing new packages to make sure you are installing the
latest version.
11. apt-get upgrade: Upgrades all of the software packages you have installed.
12. clear: Clears previously run commands and text from the terminal screen.
13. date: Prints the current date.
14. find / -name example.txt: Searches the whole system for the file example.txt and
outputs a list of all directories that contain the file.
15. nano example.txt: Opens the file example.txt in the Linux text editor Nano.
16. raspi-config: Opens the configuration settings menu.

Figure 7.2: Configuration setting menu


17. reboot: To reboot immediately.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

18. cp: makes a copy of a file and places it at the specified location eg: cp
file_a/home/other_user/
19. mv: moves a file and places it at the specified location eg: mv file_a/home/other_user/
20. rm: removes the specified file
21. mkdir: This makes a new directory, e.g. mkdir new_dir
22. cat: Lists the contents of files e.g. cat some_file

Nano editor
1. To open a new nano file or make changes in existing file in terminal type sudo nano
filename to open a new file or open existing file.
2. Write the python program
3. Press Ctrl+O to save the file with extension .py
4. Press Ctrl+X to exit the file

CONCLUSION

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO. 8

AIM: - To learn python programming and prepare programs in python

OBJECTIVE
 To learn basics to prepare a python program
 To prepare a program to add, subtract, multiply and divide two numbers in python.

APPARATUS
 Monitor with VGA cable and adapter for power supply.
 Micro USB power supply cable and adapter.
 USB based Keyboard and mouse.
 Micro SD card.
 Micro SD card reader
 Raspberry Pi model 3 board.
 HDMI to VGA Converter

THEORY
There are countless definitions of what computer programming is, one among them is:
“Programming is how you get computers to solve problems.”
There are two key phrases here which are important:
You: without the programmer (you), the computer is useless. It does what you tell it to do.
Solve Problems: Computers are tools. They are complex tools, admittedly, but they are not
mysterious or magical. They exist to make tasks easier. Computer programs (or software) are
what makes computers work. Without software, modern computers are just complicated
machines for turning electricity into heat. It’s software on your computer that runs your
operating system, browser, email, games, and movie player – just about everything.

Programming is a creative task: there is no right or wrong way to solve a problem, in the same
way that there is no right or wrong way to paint a picture. There are choices to be made, and one
way may seem better than another, but that doesn’t mean the other is wrong! With the right skills
and experience, a programmer can craft software to solve an unlimited number of problems –
from telling you when your next train will arrive to playing your favorite music. The possibilities
are constrained only by your imagination.

Python has been selected as a good place to start when learning about programming, by
providing a rich set of coding tools while still allowing simple programs to be written without
fuss. This allows beginners to gradually be introduced to the concepts and methods on which
modern programming languages are based without requiring them to know it all from the start. It
is very modular with lots of additional libraries that can be imported to quickly extend the
functionality. You will find that over time, this encourages you to do the same, and you will want
to create your own modules that you can plug into your own programs, thus taking your first

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

steps into structured programming. These three concepts are the basic logical structures in
computer programming:
Sequence: running instructions in order
Selection: making choices
Repetition: doing the same thing more than once
Programs are often referred to as code and hence programming is also known as coding.

To create Python programs you need a text editor to write your code and a Python interpreter
which takes your code and runs it. An editor, interpreter and other useful tools (such as a file
browser) are often bundled together into an Integrated Development Environment (IDE), which
makes the process of creating programs much easier. We will be using Thonny Python IDE for
preparing python programming in raspberry pi 3. There are three key areas in Python IDE
Files: This is where all your programs will be stored. Each filename will end in .py meaning that
the file is a Python file.
Editor: This is where you will create your programs.
REPL: This stands for “Read-Eval-Print Loop”. Your program will run in the REPL, which is
where you will see any output and provide any input.

Output
Print command is used to generate the output in python
e.g. print(“Hi”)
This will generate the output Hi as the data in the “” is taken as text or string data type variable.
e.g. print (count)
This will consider count as a variable and generate the output value the one stored in the variable
count.

Input
Input command is used to generate take input from the user and use it in the program for some
purpose.
e.g. count = input(“Enter the value”)
This will generate the output in REPL as
Enter the value
After which one can enter the value. This value will be assigned to the variable count.

Syntax
Set of rules and regulation followed to perform a program. Instruction if not written in proper
syntax will generate error and will not be allowed to run by the program.

Variables
There are several types of data types available in variables. Few to be mentioned here are string,
character, Boolean, integer, float, real etc.

Symbols and its functions


Few symbols and their functions are mentioned below in the table

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Symbol Function
= Assignment
== Equal to comparison
< Less than
> Greater than
+ Addition
- Subtraction
/ Division
* Multiplication

Conversion from one data type to another


For converting a variable of string type to integer use instruction:
Variable = int(variable)
Similarly other data types can be converted.

PROCEDURE
 From symbol of raspberry pi i.e. start menu, select programming tab, from which select
Thonny Python IDE and open it.
 Create a new file and save it with extension .py to indicate that it is a python program.
 Write the programs in the editor section
 Save the program
 Run the program and view the output in python shell or REPL section
Program 1: Addition of two numbers
var1 = input(“Enter the first number to add “)
var2 = input(“Enter the second number to add “)
a = int(var1)
b = int(var2)
add = a+b
print(“The sum of two given numbers = “, add)

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 8.1: Addition Program

Program 2: Subtraction of two numbers


var1 = input(“Enter the first number to subtract “)
var2 = input(“Enter the second number to subtract “)
a = int(var1)
b = int(var2)
sub = a-b
print(“The subtraction of two given numbers = “, sub)

Figure 8.2: Subtraction Program

Program 3: Multiply two numbers


var1 = input(“Enter the first number to be multiplied “)
var2 = input(“Enter the second number to be multiplied “)
a = int(var1)
b = int(var2)
mul = a*b
print(“The multiplication of two given numbers is = “, mul)

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 8.3: Multiplication Program

Program 4: Division of two numbers


var1 = input(“Enter the first number to be divided “)
var2 = input(“Enter the second number to be divided “)
a = int(var1)
b = int(var2)
div = a/b
print(“The division of two given numbers is =“, div)

Figure 8.4: Division Program

CONCLUSION

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PRACTICAL NO. 9

AIM: - To interface LED with Raspberry Pi 3

OBJECTIVE
 To blink LED using Raspberry Pi 3
 To control the brightness of LED using Raspberry Pi 3

APPARATUS
 Monitor with VGA cable and adapter for power supply.
 Micro USB power supply cable and adapter.
 USB based Keyboard and mouse.
 Micro SD card.
 Micro SD card reader
 Raspberry Pi model 3 board.
 HDMI to VGA Converter
 LED
 Breadboard
 Hook up wires
 330Ω resistor

THEORY
The LED can be interfaced to raspberry pi 3 using the General Purpose Input output pins on the
board. The pin diagram of the GPIO is as follows:

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 9.1: Pin diagram of GPIO on Raspberry Pi 3 board

PROCEDURE
 Let us connect GPIO 18 i.e. pin number 12 to the LED
 Connect GPIO 18 to positive leg of LED on the breadboard
 Connect negative leg of LED to 330Ω resistor.
 Connect the other end of the resistor to the ground pin of GPIO i.e. pin number 6
 Open Thonny Python and write the program.
 Save the program in python format and run it
 We can see blinking and control brightness of LED using these programs.

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Program 1: Blinking of LED

import RPi.GPIO as GPIO


import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)

while (True):
GPIO.output(18, True)
time.sleep(0.5)
GPIO.output(18, False)
time.sleep(0.5)

Program 2: Controlling Brightness of LED

import RPi.GPIO as GPIO


import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)

pwm_led=GPIO.PWM(18,100)
pwm_led.start(100)

try:
while True:
duty_s=input(“enter brightness”)
duty=int(duty_s)
pwm_led.ChangeDutyCycle(duty)
time.sleep(0.5)
finally:
GPIO.cleanup()

3110012: Workshop/Manufacturing Practices Page


Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Figure 9.2: Output of LED Blinking

CONCLUSION

3110012: Workshop/Manufacturing Practices Page

You might also like