Workshop Lab Manual
Workshop Lab Manual
Upon successful completion of the course, the student will be able to:
CO1: Develop hands-on experience with breadboarding, soldering, and assembling electronic
circuits, enabling them to construct and troubleshoot basic electronic systems.
CO2: Analyze circuit behavior using simulation tools like Multisim, implement circuits on
perforated PCB boards, and verify the operation of logic gates using ICs.
CO3: Identify the programming in Arduino development board, interfacing sensors and actuators,
and acquiring data for real-world applications such as temperature measurement, motor control,
and display systems.
LIST OF EXPERIMENTS
Usage
Component Placement: Components such as resistors, capacitors, transistors, and integrated
circuits are placed into the holes. The leads of the components fit snugly into the holes,
establishing electrical connections through the metal strips.
Interconnections: Wires connect different components by plugging them into the appropriate
holes. This allows for creating complex circuits by interlinking various components
according to the desired design.
Testing and Modification: Breadboards allow for easy insertion and removal of components,
making it simple to test different configurations and troubleshoot any issues. This flexibility
is crucial for prototyping and iterative development.
Advantages
No Soldering Required: Components can be added, removed, or repositioned without
soldering, preserving their integrity for future use.
Reusability: Breadboards can be used multiple times for different projects.
Ease of Use: They are user-friendly and accessible for both beginners and experienced
engineers.
Flexibility: Facilitates rapid prototyping and testing of circuit designs.
Limitations
Connection Reliability: Connections may become loose over time or with repeated use,
leading to intermittent faults.
High-Frequency Performance: Breadboards are not suitable for high-frequency circuits due
to parasitic capacitance and inductance from the internal metal strips.
Power Handling: They are generally limited in the amount of current they can handle,
making them unsuitable for high-power applications.
Conclusion
Breadboards are invaluable tools in electronics, providing a practical platform for
constructing, testing, and refining circuit designs. Their ease of use and flexibility make them a
staple in educational settings and for any electronic prototyping activities. For advanced applications
and final implementations, however, more permanent solutions such as printed circuit boards (PCBs)
are typically employed.
II. Connect simple LED circuit on breadboard
Appendix:
Ohm’s Law: 𝑉 = 𝐼 × 𝑅 ------------1.1
Resistors for LEDs
𝑉 −𝑉
𝑅 = 𝑠 𝐼 𝐿𝐸𝐷 --------------1.2
𝐿𝐸𝐷
Where
R = Resistor value (Ω)
Vs = Source voltage (Volt)
VLED = Voltage drop across the LED (Volt)
ILED = Current drop across the LED (A)
III. Connecting Series and parallel circuits on a breadboard
Aim: Understanding the connection of series and parallel circuits on a breadboard
Requirements:
Breadboard
Resistors (or other components)
Jumper wires
Power supply (e.g., battery pack)
Theory:
Creating series and parallel circuits on a breadboard involves connecting components in specific
ways to achieve the desired configuration.
Series Circuit:
In a series circuit, components are connected end-to-end so that there is only one path for the current
to flow.
Parallel Circuit:
In a parallel circuit, components are connected across common points or junctions, creating multiple
paths for the current to flow.
Procedure:
A: Series Circuit Connection
Place the Breadboard: Lay the breadboard on a flat surface, identifying the central trench and
power rails.
Insert the First Resistor: Insert one lead of the first resistor into a hole in a row on the
breadboard.
Insert the other lead into an adjacent row.
Connect the Second Resistor: Insert one lead of the second resistor into the same row as the
second lead of the first resistor.
Insert the other lead into a new adjacent row.
Continue Adding Components: Repeat the process for additional resistors or components,
ensuring each new component shares a row with the previous component's last lead.
Power Connections: Connect a jumper wire from the first row (where the first resistor's lead
is placed) to the positive power rail.
Connect another jumper wire from the last row (where the last resistor's lead is placed) to the
negative power rail.
Two wires (stranded or solid core)/ LED or relay/ Perforated board (breadboard).
Electronic components.
Soldering iron.
Solder.
Soldering iron stand or holder.
Wire stripper/ Wire cutter.
Heat shrink tubing or electrical tape (optional).
Soldering flux (optional but recommended).
Component leads (for LED, typically anode and cathode; for relay, pins for power
and signal).
Procedure I:
Prepare the Wires: Strip about 1/4 inch (6 mm) of insulation off the ends of both
wires using a wire stripper. Twist the strands of each wire together if using
stranded wire.
Preheat the Soldering Iron: Turn on the soldering iron and let it reach the desired
temperature (usually around 350°C or 660°F).
Tin the Wires: Apply a small amount of solder to the tip of the soldering iron. Heat
each wire end briefly with the soldering iron and apply solder to the wire. This
process is called "tinning" and helps make a good joint.
Join the Wires: Position the wires so that they overlap slightly. Heat the wires with
the soldering iron and apply solder to the joint. The solder should flow into the
wires and create a solid connection.
Cool and Inspect: Remove the soldering iron and allow the joint to cool naturally.
Inspect the joint to ensure it is smooth, shiny, and has no cold solder joints (dull
or cracked).
Insulate (if needed): Slide heat shrink tubing over the joint and heat it with a heat
gun, or wrap the joint with electrical tape for insulation.
Procedure II:
Prepare the Component: Identify the LED’s anode (+) and cathode (−) leads or
the relay’s pins. If the component has long leads, trim them to a suitable length.
Insert the Component: Insert the LED or relay into the appropriate circuit board
or perfboard holes.
Secure the Component: Hold the component in place with fingers or use a tool to
keep it steady.
Solder the Leads: Heat the component lead and the corresponding pad on the board
with the soldering iron. Feed the solder into the joint until it flows around the lead
and pad. Remove the soldering iron and let the joint cool naturally. Repeat for all
leads.
Trim Excess Leads: Once cooled, use wire cutters to trim any excess leads sticking
out from the solder joints.
Inspect the Solder Joints: Ensure each joint is smooth and shiny without any solder
bridges or cold joints.
Procedure III:
Design Circuit: Plan circuit layout and position the components on the perforated
board.
Insert Components: Insert the component leads through the holes in the perfboard.
Secure Components: Hold the components in place and make sure they are aligned
properly.
Solder the Joints: Heat the component lead and the corresponding pad or trace on
the perfboard with the soldering iron. Apply solder to the joint and allow it to flow
around the lead and pad. Remove the soldering iron and let the joint cool.
Trim Excess Leads: Use wire cutters to trim any excess leads from the board.
Inspect the Board: Check each solder joint to ensure it is clean, smooth, and free
from solder bridges.
Verify that there are no short circuits or cold solder joints.
Precaution:
Safety First: Always work in a well-ventilated area and use safety glasses to protect eyes from
solder splashes.
Clean the Tip: Regularly clean the soldering iron tip with a damp or brass sponge to maintain good
heat transfer.
Practice Good Technique: Hold the soldering iron at a proper angle, and ensure the tip is in contact
with both the pad and the lead for a few seconds before applying the solder.
Experiment 3
Experiments on analysis and synthesis of basic electronic circuits
Procedure:
1. open multisim software.
2. To create a new schematic click on File – >New –> Schematic Capture. To save the
schematic click on File /Save As. To open an existing file click on File/ Open in the toolbar.
3. To Place Components click on Place/Components. On the Select Component Window click
on Group to select the components needed for the circuit. Click OK to place the component on
the schematic.
4. Connect the circuit properly.
5. To simulate the completed circuit Click on Simulate/Run or F5.
Result:
Hence we observed the analysis and synthesis of basic electronic circuits using multisim
software and also implemented circuit on perforated PCB board.
]Experiment 4
Experiment on implementation of logic gates using logic IC’s
Aim: Implementation of logic gates using logic ICs
I. Implementation of basic logic gates.
II. Verification of truth tables of corresponding logic gates.
Requirements:
Logic ICs (e.g., 7400 series such as 7404, 7408, 7432, etc.)
Breadboard
Connecting wires
Power supply (5V DC)
LEDs (to indicate output)
Resistors (330Ω for current limiting)
Multimeter (optional for voltage checks)
Theory:
A logic gate is an electronic circuit that performs basic logical functions on binary inputs to
produce a single binary output. Logic gates are the foundation of digital circuits found in most
electronic devices. A logic gate is a device building block for digital circuits. Logic gates are
circuits that can have one or more inputs but only one output. These are based on a certain logic.
Hence, these are called logic gates.A logic gate performs a Boolean logic operation on one or
more binary inputs and then outputs a single binary output.
Logic gates: NOT Gate (Inverter), AND Gate, OR Gate, NAND Gate, NOR Gate, XOR Gate.
Procedure:
Set Up the Power Supply: Connect the positive terminal of the power supply to the VCC
pin of the IC (usually pin 14). Connect the negative terminal (ground) to the GND pin of
the IC (usually pin 7).
Connect Inputs: Connect inputs A and B to the appropriate pins using the breadboard and
connecting wires. If using switches for manual input, ensure the correct connections to
the inputs.
Connect the Output: Connect the output pin of the logic gate to an LED via a current-
limiting resistor (e.g., 330Ω). The LED will light up with high output (logic 1).
Alternatively, you can use a multimeter to measure the output voltage.
Observation:
Truth table of the (Type of Logic gate)
Testing:
Provide logic 1 or 0 to the inputs of the gate by connecting the inputs to either 5V (logic 1) or ground (logic 0).
Observe the output on the LED or multimeter.
Experiment 5
Experiments on Arduino development board
Aim:Learning hardware and software of Arduino board and developing basic programs using GPIO.
I. Learning Arduino IDE Programming Environment
II. Learning Hardware features of Arduino Development Board
III. Developing basic programs using GPIO (Analog Input, Analog Output, Digital
Input & Output)
I. Learning Arduino IDE Programming Environment
Aim: To learn Arduino IDE programming Environment.
Requirements:
Arduino UNO Board
Bread board
LED
Wires
Data Cable
Theory:
The Arduino UNO R3 is frequently used microcontroller board in the family of an Arduino. The main
advantage of this board is if we make a mistake we can change the microcontroller on the board. The
mainfeatures of this board mainly include, it is available in DIP (dual-inline-package), detachable
and ATmega328 microcontroller. The programming of this board can easily be loaded by using an
Arduino computer program. This board has huge support from the Arduino community, which will
make a verysimple way to start working in embedded electronics, and many more applications.
The Arduino Uno R3 pin diagram is shown below. It comprises 14-digit I/O pins.
From these pins, 6-pins can be utilized like PWM outputs. This board includes 14 digital
input/output pins, Analog inputs-6,a USB connection, quartz crystal-16 MHz, a power jack, a
USB connection, resonator- 16Mhz, a powerjack, an ICSP header an RST button.
Arduino Uno R3 Pin Diagram
Power Supply: Power supply of the Arduino can be done with the help of an exterior power supply
otherwise USB connection. The exterior power supply (6 to 20 volts) mainly includes a battery or an
AC to DC adapter.The connection of an adapter can be done by plugging a center-positive plug (2.1mm)
into the powerjack on the board. The battery terminals can be placed in the pins of Vin as well as GND.
The power pinsof anArduino board include the following.
Vin: The input voltage or Vin to the Arduino while it is using an exterior power supply opposite to volts
from the connection of USB or else RPS (regulated power supply). By using this pin, one can supply
the voltage.
5Volts: The RPS can be used to give the power supply to the micro-controller as well as components
which are used on the Arduino board. This can approach from the input voltage through a
regulator.
3V3: A 3.3 supply voltage can be generated with the onboard regulator, and the highest draw current will
be 50 mA.
GND: GND (ground) pins.
Memory:The memory of an ATmega328 microcontroller includes 32 KB and 0.5 KB memory is utilized
for the Boot loader), and also it includes SRAM-2 KB as well as EEPROM-1KB.
Input and Output
We know that an arguing Uno R3 includes 14-digital pins which can be used as an input otherwise
output by using the functions like pin Mode (), digital Read(), and digital Write(). These pins can
operate with 5V,and every digital pin can give or receive 20mA, & includes a 20k to 50k ohm
pull up resistor. The maximum current on any pin is 40mA which cannot surpass for avoiding the
microcontroller from the damage. Additionally, some of the pins of an Arduino include specific
functions.
Serial Pins
The serial pins of an Arduino board are TX (1) and RX (0) pins and these pins can be used to transfer
the TTL serial data. The connection of these pins can be done with the equivalent pins of the
ATmega8U2 USB to TTL chip.
External Interrupt Pins
The external interrupt pins of the board are 2 & 3, and these pins can be arranged to activate an interrupt
on a rising otherwise falling edge, a low-value otherwise a modify in value.
PWM Pins
The PWM pins of an Arduino are 3, 5, 6, 9, 10, & 11, and gives an output of an 8-bit PWM with the
function analog Write ().
SPI (Serial Peripheral Interface) Pins
The SPI pins are 10, 11, 12, 13 namely SS, MOSI, MISO, SCK, and these will maintain
the SPI communication with the help of the SPI library.
LED Pin
An arguing board is inbuilt with a LED using digital pin-13. Whenever the digital pin is high, the LED
will glow otherwise it will not glow.
TWI (2-Wire Interface) Pins
The TWI pins are SDA or A4, & SCL or A5, which can support the communication of TWI with the
help of Wire library.
AREF (Analog Reference) Pin
An analog reference pin is the reference voltage to the inputs of an analog i/ps using the function like
analog Reference().
Reset (RST) Pin
This pin brings a low line for resetting the mi cr o - co nt ro lle r , and it is very useful for using an
RST button toward shields which can block the one over the Arduino R3 board.
Communication
The communication protocols of an Arduino Uno include SPI, I2C, and UART serial
communication.
UART
An Arduino Uno uses the two functions like the transmitter digital pin1 and the receiver digital pin0.
These pins are mainly used in UART TTL serial communication.
I2C
An Arduino UNO board employs SDA pin otherwise A4 pin & A5 pin otherwise SCL pin is used
for I2C communication with wire library. In this, both the SCL and SDA are CLK signal and data
signal.
SPI Pins
The SPI communication includes MOSI, MISO, and SCK.
MOSI (Pin11)
This is the master out slave in the pin, used to transmit the data to the devices
MISO (Pin12)
This pin is a serial CLK, and the CLK pulse will synchronize the transmission of which is produced
by the master.
SCK (Pin13)
The CLK pulse synchronizes data transmission that is generated by the master. Equivalent pins
with the SPI library is employed for the communication of SPI. ICSP (in-circuit serial
programming) headers canbe utilized for programming ATmega microcontroller directly with
the boot loader.
The applications of Arduino Uno mainly involves in Arduino Uno based projects which include the
following
1. Visitor Alarm in Office using Arduino Uno
2. Arduino Uno based Soccer Robot
3. Arduino Uno based Automatic Medication Reminder
4. Motion Detecting with Static Electricity
5. Arduino Uno based Taxi with Digital Fare Meter
6. Arduino Uno based Smart Stick
7. Robot Car Controlled by Smartphone and Arduino
RESULT:
We studied introduction of PLC , Arduino and its installation with PC, hardware components,
building various blocks and determine no. of digital inputs/outputs & analog inputs/outputs’.
II. Learning Arduino IDE Programming Environment
Verify - Before your program “code” can be sent to the board, it needs to be converted into instructions
that the board understands. This process is called compiling or verifying.
• Upload - This compiles and then transmits over the USB cable to your board.
• Create new Sketch - This opens a new window to create a new sketch.
• Open Existing Sketch - This loads a sketch from a file on your computer.
• Save Sketch - This saves the changes to the sketch you are working on.
• Serial Monitor – It can be used as a debugging tool, testing out concepts or to communicate directly
with the Arduino board.
• Sketch Editor - This is where you write or edit sketches
• Text Console - This shows you what the IDE is currently doing and is also where error messages
display if you make a mistake in typing your program. (Often called a syntax error)
• Line Number - This shows you what line number your cursor is on. It is useful since the compiler gives
error messages with a line number.
Writing a Program in Arduino IDE
1. Creating a Folder:
a. Make a new folder on Desktop.
b. Name it as “ECE_[Your group number]”
2. Launching the Arduino IDE:
a. First make a folder on Desktop. Name it as ECE.
b. Click on Start Programs Arduino
c. Arduino IDE software will appear.
3. Writing the program:
In most programming languages, you start with a program that simply prints “Hello, World” to the screen. The
equivalent in the micro-controller world is getting a light to blink on and off. This is the simplest program
we can write to show that everything is functioning correctly.
Write the following code in the sketch editor:
Example: Basic Program on LED blinking
void setup()
{
pinMode(4, OUTPUT);
}
void loop() {
digitalWrite(4, HIGH); // turn the LED on (HIGH is the voltage
level) delay(1000); // wait for a second
digitalWrite(4, LOW); // turn the LED off by making the voltage
LOW delay(1000); // wait for a second
}
4. Uploading the Code to Arduino Board:
Once you have written the code, compile and upload the code in your Arduino board. You will see that
the build in LED on your Arduino UNO will turn on for one second and turn off for once second
repeatedly.
III. Developing basic programs using GPIO (Analog Input, Analog Output, Digital Input & Output)
Requirements:
Arduino UNO
LED
Push Button
220Ω resistor
10KΩ resisor
USB Cable
Breadboard
Jumper wires
Theory:
Push-button is a very simple mechanism which is used to control electronic signal either by blocking it or
allowing it to pass. This happens when mechanical pressure is applied to connect two points of the switch
together. Push buttons or switches connect two points in a circuit when pressed. When the push-button is
released, there is no connection between the two legs of the push-button. Here it turns on the built-in LED on
pin 2 when the button is pressed. The LED stays ON as long as the button is being pressed.
Connection Diagram:
Procedure
1. Insert push button into your bread board and connrct it to the digital pin7(D7) which act as INPUT.
2. Insert the LED into the breadboard.Attach the positive leg(the longer leg ) to digital pin 2 of the Arduino
Uno , and the negative leg via the 220-ohm resistor to GND .The pin D2 is taken as OUTPUT.
3. The 10kΩ resistor used as PULL-UP resistor and 220 Ω resistors is used
to limit the current through the LED.
4.Upload the code as given below.
5.Press the push-button to control the ON state of LED.
The Sketch
➢ This sketch works by setting pin D7 as for the push button as INPUT
and pin 2 as an OUTPUT to power the LED.
➢ The initial state of the button is set to OFF.
➢ After that the run a loop that continually reads the state from the pushbutton and sends that value as
voltage to the LED. The LED will be ON accordingly
const int buttonPin = 7; // choose the pin for the choose the pin for the pushbutton
const int LED = 2; // choose the pin for a LED
int buttonState = 0; // variable for reading the choose the pin for the pushbutton pin status
void setup()
{
pinMode(LED, OUTPUT); // declare LED as output
pinMode(buttonPin, INPUT); // declare choose the pin for the pushbutton as input
}
void loop()
{
buttonState = digitalRead(buttonPin); // read input value
if (buttonState == HIGH)
{ // check if the input is HIGH (button pressed)
digitalWrite(LED, HIGH); // turn LED
ON delay(2000);
} // wait for a two seconds
else
{
delay(2000); // wait for a two second s
digitalWrite(LED, LOW); // turn LED OFF
}
}
Observation Table:
Sr no. Push button State LED State
1
2
Precautions:
1. The pushbutton is square so it is important to set it appropriately on
breadboard.
2. While making the connections make sure to use a pull-down resistor
because directly connecting two points of a switch to the circuit will
leave the input pin in floating condition and circuit may not work
according to the program.
3. It is very important to set pinMode() as OUTPUT first before using
digitalWrite() function on that pin.
4. If you do not set the pinMode() to OUTPUT, and connect an LED to a
pin, when calling digitalWrite(HIGH), the LED may appear dim.
Result:
Experiment 6.
Experiment on Arduino development board for sensor interfacing and data acquisition
Aim:
I. Learning of importing and using of various libraries into Arduino
Programming environment
II. Develop a hardware circuit and program for temperature measurement
using temperature sensor.
III. Develop a hardware circuit and program for DC motor control using PWM
IV. Develop a hardware circuit and program for display the data on seven
segment display and LCD using serial communication
Theory:
A large part of the Arduino programming experience is the use of libraries. There are thousands of
libraries that can be found online, and the best documented ones can be found and installed directly
through the editor.Libraries are incredibly useful when creating a project of any type. They make our
development experience much smoother, and there almost an infinite amount out there. They are used to
interface with many different sensors, RTCs, Wi-Fi modules, RGB matrices and of course with other
components on your board.Arduino has many official libraries, but the real heroes are the Arduino
community, who develop, maintain and improve their libraries on a regular basis.
Installing a library
Installing a library is quick and easy, but let's take a look at what we need to do.
1. Open the Arduino IDE 2.0.
2. With the editor open, let's take a look at the left column. Here, we can see a couple of icons. Let's
click the on the "library" icon.
3. A list will now appear of all available libraries, where we can also search for the library we want to
use. In this example, we are going to install the RTCZero library. Click on the "INSTALL" button to
install the library.
4. This process should not take too long, but allow up to a minute to install it.
5. When it is finished, we can take a look at the library in the library manager column, where it should
say "INSTALLED".
Congratulations! You have now successfully downloaded and installed a library on your machine.
Including a library
To use a library, you first need to include the library at the top of the sketch.
Almost all libraries come with already made examples that you can use. These are accessible
through File > Examples > {Library} > {Example}. In this example, we are choosing the RTCZero >
SimpleRTC.
The chosen example will now open up in a new window, and you can start using it however you want to.
II. Develop a hardware circuit and program for temperature measurement using temperature
sensor.
Aim: To develop harware circuit and program for temperature measuring usin temoerature sensor,
Requirements:
Arduino UNO
Lm35
Usb Cable
Breadboard
Jumper wires
Theory:
The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly
proportional to the Centigrade temperature. LM35 is three terminal linear temperature sensors from
National semiconductors. It can measure temperature from -55 degree Celsius to +150 degree Celsius.
The voltage output of the LM35 increases 10mV per degree Celsius rise in temperature. LM35 can be
operated from a 5V supply and the stand by current is less than 60uA. The pin out of LM35 is shown in
the figure below.
Connection Diagram:
Prcedure:
1. Insert temperature sensor into your breadboard and connect its pin1 to the supply.\
2. Connect its center pin to the analog pin A0 and the remaining pin3 to GND on the bread board.
3. Upload the code as given below.
4. Vary the temperature and read the voltage changes.
5. Open the Arduino IDE’s serial monitor to see the results.
The Sketch
This sketch works by setting by seating pin A0 as for the temperature sensor. After that the run a loop that
continually reads the value from the sensor and sends that value as voltage. The voltage value is between 0-5Volts.
When temperature will vary accordingly.
int
LM35Pin=A0;
void setup()
{
Serial.begin(9600);
}
void loop ()
{
int val;
int data;
val = analogRead(LM35Pin);
data= (val*5)/10;
Serial.print(“Temp:”);
Serial.print(data);Serial.println(“C”);
delay(500);
}
Observation Table:
Sr. no. Voltage Temperature
1
2
3
4
s
Result:
III. Develop a hardware circuit and program for DC motor control using PWM
Aim: To develop hardware circuit and program for DC motor control using PWM.
Requirements:
Arduino UNO
DC motor
RGB LED
Push buttin
10K-ohm resistor
USB Cable
Bread board
Jumper wires
Theory:
A DC motor (Direct Current motor) is the most common type of motor. DC motors normally
have just two leads, one positive and one negative. If you connect these twoleads directly to a battery,
the motor will rotate. If you switch the leads, the motor will rotate in the opposite direction.
Specification
Pin Description
GND common ground for both the motor and logic 5V
positive voltage that powers the servo
Control Input for the control system.
The control wire is used to communicate the angle. The angle is determined by the duration of a pulse
that is applied to the control wire. This is called Pulse Code Modulation. The servo expects to see a pulse
every 20 milliseconds (.02 seconds). The length of the pulse will determine how far the motor turns. A
1.5 millisecond pulse, for example, will make the motor turn to the 90-degree position (often called as the
neutral position). If the pulse is shorter than 1.5 milliseconds, then the motor will turn the shaft closer to 0
degrees. If the pulse is longer than 1.5 milliseconds, the shaft turns closer to 180 degrees.
Connection Diagram:
Procedure:
1. The servo motor has a female connector with three pins.the darkest or even black one is usually the
ground.connect this to the Arduino GND.
2. Connect the power cable that in all standards should be red to 5V on the Arduino.
3. Connect the remaining line on the servo connector to digital pin on the Arduino.
4. Upload the code
5. Observe the position of the shaft.
The Sketch
This sketch works by setting pin A2 as for the potentiometer and pin 9 as an OUTPUT to power the
LED.After that the run a loop[ that continually reads the value from the potentiometer and sends that value
as voltage to the LED. The voltage value is between 0-5volts,and the brightness of the LED will vary
accordingly.
const int
inputPin=1; const
int blue=3; const int
red=4;
const int motorPin1=5,motorPin2=6;
int dir=LOW;
int prevState=0,currentState=0;
void setup()
{
// put your setup code here, to run once:
pinMode(inputPin,INPUT);
pinMode(motorPin1,OUTPUT);
pinMode(motorPin2,OUTPUT);
pinMode(blue,OUTPUT);
pinMode(red,OUTPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
currentState=digitalRead(inputPin);
if(currentState!=prevState)
{
if(currentState==HIGH)
{ dir=!dir;
}
}
prevState=currentState;
if(dir==HIGH)
{
digitalWrite(motorPin1,HIGH);
digitalWrite(motorPin2,HIGH);
digitalWrite(blue,LOW);
digitalWrite(red,HIGH);
}
}
Observation Table:
Sr no. Voltage Position of Shaft
Result:
IV.Develop a hardware circuit and program for display the data on seven segmentdisplay
and LCD using serial communication
Theory:
Seven Segment Module
Seven segment display is an output display device that provide a way to display information in the form
of text or decimal numbers. It is widely used in digital clocks, basic calculators, electronic meters, and
other electronic devices that display numerical information. It consists of seven segments of light
emitting diodes (LEDs) which is assembled like numerical 8. If we consider the dot point then there are
total eight LEDs.The pins of the seven-segment display should be connected to Arduino pins (0-7).
Common pins (pin 3 and pin 8) are connected to GROUND.
Result: