CO3 QUESTION BANK
Short answer question (2marks)
1. Define an actuator
Actuators convert control signals into physical action (moving,
rotating, opening, or adjusting a system)
Ex: Actuator then triggers the alarm to sound or send a notification
to the homeowner.
2. What are the different types of electrical motors?
1. DC Motors
2. Servo Motors
3. Stepper Motors
4. Induction Motors
5. Synchronous Motors
6. Universal Motors
3. Draw the DC motor with a battery connection to run in clockwise
and anticlockwise directions.
4. Explain the use of a Motor driver. What are the various types of
motor driver circuits?
What is a driver circuit? and list various types of driver circuits.
5. Name a few internal parts of a DC motor.
1. Stator
2. Brush
3. Pole Shoe/ Face
4. Armature Core
5. Armature Winding
6. Field Winding
7. Shaft
8. Commutator
9. Bearing
6. Explain the various pins of a servo motor.
7. List some applications of servo motors within the industrial sector.
8. How can the direction of a servo motor be controlled?
• If PWM’s width = WIDTH_MIN, the servo motor rotates 0
degrees.
• If PWM’s width = WIDTH_MAX, the servo motor rotates 180
degrees.
• If the PWM’s width is between WIDTH_MIN & WIDTH_MAX,
the servo motor rotates to angle between 0o and 1800 in
proportion.
9. What is a stepper motor? Identify its purpose.
Servo motor is a component that can rotate its handle (usually between
0 degrees and 180 degrees).
It is used to control the angular position of the object.
10. Calculate the stepping angles for a stepper motor with steps per
revolution of 10 and 48.
360°
Stepping Angle =
Steps per Revolution
If 10 Steps per Revolution is
360°
Stepping Angle = = 36° per step
10
If 48 Steps per Revolution is
360°
Stepping Angle = = 7.5° per step
48
11. Explain the working principle of a relay.
• Relays are electrically operated switches that open and close the
circuits by receiving electrical signals from outside sources.
• Relays are crucial in Arduino projects as they enable safe and
versatile control of high-power or high-voltage devices,
preventing damage to the Arduino and ensuring compatibility
and safety.
• They are designed to be controlled with low voltages like 3.3V
like the ESP32, ESP8266, etc, or 5V like your Arduino.
• Relays are used to protect the electrical system and to minimize
the damage to the equipment connected in the system due to
over currents/voltages.
• The relay is used for the purpose of protection of the equipment
connected with it.
12. Draw the pin diagram of a 2-relay module and describe the
important pins.
13. What are the various types of relay modules?
1. Single Pole Single Throw Switch (SPST)
2. Single Pole Double Throw Switch (SPDT)
3. Double Pole Single Throw Switch (DPST)
4. Double Pole Double Throw Switch (DPDT)
14. Write some applications of relay.
15. What is an optocoupler? What is the purpose of using optocoupler?
16. What are the advantages and applications of using optocouplers?
Long answer questions (4 and 5 Marks)
1. Summarize the DC motors, servo motors, and stepper motors used
in IoT applications.
2. Connect the DC motor to the H-bridge and control the direction of
the DC motor.
3. Explain how the speed of a DC motor can be controlled using
PWM (Pulse Width Modulation) signals.
4. Write an Arduino code to design a differential drive robot using
DC motors based on a Potentiometer.
const int potPin = A0;
const int leftMotorPin1 = 9;
const int leftMotorPin2 = 10;
const int rightMotorPin1 = 11;
const int rightMotorPin2 = 12;
void setup() {
pinMode(leftMotorPin1, OUTPUT);
pinMode(leftMotorPin2, OUTPUT);
pinMode(rightMotorPin1, OUTPUT);
pinMode(rightMotorPin2, OUTPUT);
}
void loop() {
int potValue = analogRead(potPin);
int motorSpeed = map(potValue, 0, 1023, -255, 255);
if (motorSpeed > 0) {
analogWrite(leftMotorPin1, motorSpeed);
analogWrite(rightMotorPin1, motorSpeed);
analogWrite(leftMotorPin2, 0);
analogWrite(rightMotorPin2, 0);
} else {
analogWrite(leftMotorPin1, 0);
analogWrite(rightMotorPin1, 0);
analogWrite(leftMotorPin2, -motorSpeed);
analogWrite(rightMotorPin2, -motorSpeed);
}
delay(100);
}
5. Write an Arduino program for designing a robot using a DC motor
and ultrasonic sensor to halt the robot when objects detected. (or)
A robotic system using a DC motor that detects objects and halts
automatically.
#include <NewPing.h>
#define TRIG_PIN 9
#define ECHO_PIN 10
#define MOTOR_A_FWD 5
#define MOTOR_B_FWD 7
NewPing sonar(TRIG_PIN, ECHO_PIN, 200);
void setup() {
pinMode(MOTOR_A_FWD, OUTPUT);
pinMode(MOTOR_B_FWD, OUTPUT);
}
void loop() {
delay(50);
if (sonar.ping_cm() > 15) {
digitalWrite(MOTOR_A_FWD, HIGH);
digitalWrite(MOTOR_B_FWD, HIGH);
} else {
digitalWrite(MOTOR_A_FWD, LOW);
digitalWrite(MOTOR_B_FWD, LOW);
delay(500); // Pause before stopping
}
}
6. Explain the operation of a Servo motor showing the angle control
using PWM signals.
If PWM’s width = WIDTH_MIN, the servo motor rotates 0
degrees.
If PWM’s width = WIDTH_MAX, the servo motor rotates 180
degrees.
If the PWM’s width is between WIDTH_MIN & WIDTH_MAX,
the servo motor rotates to angle between 0o and 1800 in proportion.
7. Write an Arduino code for a Servo Position control using a
Potentiometer and display it on LCD.
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Servo myServo;
const int potPin = A0;
const int servoPin = 9;
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
myServo.attach(servoPin);
lcd.begin();
lcd.backlight();
lcd.print("Servo Position:");
}
void loop() {
int potValue = analogRead(potPin);
int servoAngle = map(potValue, 0, 1023, 0, 180);
myServo.write(servoAngle);
lcd.setCursor(0, 1);
lcd.print("Angle: ");
lcd.print(servoAngle);
lcd.print(" ");
delay(15);
}
8. Write an Arduino code for an Automatic Barrier control using a
Servo Motor using an ultrasonic sensor.
#include <Servo.h>
Servo barrierServo;
const int trigPin = 9;
const int echoPin = 10;
const int servoPin = 6;
long duration;
int distance;
int thresholdDistance = 30;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
barrierServo.attach(servoPin);
barrierServo.write(90);
Serial.begin(9600);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.println(distance);
if (distance < thresholdDistance) {
barrierServo.write(0);
delay(5000);
barrierServo.write(90);
}
delay(500);
}
9. Explain different driving modes of stepper motors, including full-
step, half-step, and micro-stepping.
Full-Step Mode: In this mode, the motor moves one full step at a
time. Each pulse moves the motor by one basic step angle (e.g.,
1.8° for a typical stepper motor). It provides high torque but lower
resolution.
Half-Step Mode: This mode alternates between full steps and half
steps, doubling the resolution by allowing the motor to move in
smaller increments. The motor alternates between energizing one
or two phases, providing a smoother motion with slightly less
torque than full-step.
Micro-Stepping: Micro-stepping divides each full step into many
smaller steps, controlled by varying the current in the motor coils.
This mode provides the highest resolution and smoothest motion,
ideal for precise positioning, but with reduced torque per micro-
step.
10. List out the advantages of using stepper motors in IoT-based
robotics applications compared to traditional DC motors.
Precision Control: Stepper motors move in precise steps,
allowing for accurate control of position, which is crucial for tasks
requiring fine movement.
Feedback Loop: They often don't need complex feedback
systems since position is determined by steps, simplifying design
and improving reliability.
Adjustable Speed and Torque: Stepper motors can be easily
adjusted for different speeds and torque, making them versatile for
various tasks in robotics.
Easy Integration & Compactness: They are typically small and
easy to integrate into IoT systems, ideal for space-limited robotic
applications.
11. Write an Arduino program to rotate a stepper motor in both
directions for a fixed number of steps. (or) Rotation of a stepper
motor in a specific direction and reverse it
#include <Stepper.h>
const int stepsPerRevolution = 2048;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
void setup() {
myStepper.setSpeed(15);
Serial.begin(9600);
Serial.println("Stepper motor control initialized");
}
void loop() {
Serial.println("Rotating clockwise...");
myStepper.step(stepsPerRevolution);
delay(1000);
Serial.println("Rotating counterclockwise...");
myStepper.step(-stepsPerRevolution);
delay(1000);
Serial.println("Cycle complete, waiting for next rotation...");
delay(2000);
}
12. Write an Arduino code to operate a Stepper Motor based on
movement and display on LCD. (or) Movement base controlled
Stepper Motor with LCD Display
#include <Stepper.h>
#include <LiquidCrystal_I2C.h>
const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int pirPin = 2;
int motionDetected = 0;
void setup() {
pinMode(pirPin, INPUT);
myStepper.setSpeed(60);
lcd.begin();
lcd.backlight();
lcd.print("Waiting for");
lcd.setCursor(0, 1);
lcd.print("motion...");
}
void loop() {
motionDetected = digitalRead(pirPin);
if (motionDetected == HIGH) {
lcd.clear();
lcd.print("Motion Detected");
myStepper.step(stepsPerRevolution);
lcd.clear();
lcd.print("Stepping...");
delay(2000);
lcd.clear();
lcd.print("Waiting for");
lcd.setCursor(0, 1);
lcd.print("motion...");
}
delay(500);
}
13. Differentiate between the features of L293D & L298N motor
driver circuits.
14. Draw the Pin diagram of L293D and mention the purpose of each.
• L293D motor Driver is a 16-pin integrated circuit (IC) that can
control two DC motors simultaneously or 1 Stepper Motor.
• It has 2 Enable pins [EN1 (Enable 1,2) and EN2 (Enable 3,4)], 4
Inputs, 4 Outputs, 4 Ground and 2 VCC power supply.
• The direction of a DC motor connected to the L293D IC can be
changed by controlling the input pins (IN1, IN2, IN3, and IN4).
The speed of a DC motor can be controlled using the Enable pins
[EN1 (Enable 1,2) and EN2 (Enable 3,4)] of the L293D IC.
15. Explain the working operations of an L293D when connected to a
DC motor.
L293D IC is a motor driver IC that controls the
clockwise/anticlockwise direction and speed of DC motors when
connected to an Arduino UNO.
16. Draw the Pin diagram of L298N and mention the purpose of each.
17. Draw and explain different relay contacts SPST, SPDT, DPST, and
DPDT.
Single Pole Single Throw (SPST): This relay has one input and
one output, acting as an on/off switch, ideal for simple switching
tasks.
Single Pole Double Throw (SPDT): This relay has one input and
two outputs, allowing one circuit to switch between two outputs,
useful for switching between two devices.
Double Pole Single Throw (DPST): This relay has two inputs
and two outputs, allowing simultaneous control of two
independent circuits with a single switch.
Double Pole Double Throw (DPDT): This relay has two inputs
and four outputs, enabling two circuits to switch between two
outputs each, ideal for reversing motor directions.
18. Draw and explain the principles of diode and transistor-based
optocouplers.
19. Draw and explain the photoresistor-based optocoupler and
identify its applications.
Applications
➢ Switching Power Supplies
➢ Industrial Automation
➢ Telecommunications
➢ Signal Isolation