Professional Documents
Culture Documents
b) Range: Range refers to the difference between the maximum and minimum
values that a device or system can measure, detect, or handle. In various
contexts, it can refer to the range of values within which a sensor, instrument,
or equipment operates effectively.
Q4)
1. Classify as a sensor or actuator 5marks
Device Sensor actuator
buzzer v
microphone v
DHT11 v
LED v
Thermocouple v
Given:
Resistor value, R = 50 Ω
The current through the resistor (I) can be found using Ohm's law, which
states that the current through a resistor is directly proportional to the voltage
across it and inversely proportional to its resistance.
Ohm's Law: V = IR
Where:
V is the voltage across the resistor, I is the current through the resistor, R is
the resistance of the resistor.
Given v(t) = 160 sin(120πt), we can see that the voltage across the resistor is
sinusoidal. So, we substitute v(t) for V in Ohm's law:
160 sin(120πt) = I * 50
I = (160 sin(120πt)) / 50
Therefore, the expression for the current through the resistor is:
int echoPin = 7;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(redLedPin, OUTPUT);
pinMode(blueLedPin, OUTPUT);
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
// Control LEDs based on distance
} else {
delay(1000);
Analog pins typically have a range of values they can measure, often
represented as 0 to 1023 (for a 10-bit ADC), corresponding to the voltage range
(usually 0 to 5 volts).
These pins are used to interface with analog sensors like temperature sensors,
light sensors, and potentiometers. Analog pins provide continuous readings,
allowing for more precise measurements of varying voltage levels.
The value read from an analog pin is a representation of the voltage present at
that pin at the given moment.
Digital Pin: A digital pin on a microcontroller can only read or output digital
signals, which are binary (0 or 1).
Digital pins can be used for both input and output operations, such as reading
from switches, buttons, or sensors, and controlling LEDs, motors, or other
digital devices.
Digital pins operate at fixed voltage levels, typically 0 volts (LOW) and the
operating voltage of the microcontroller (HIGH), which is often 5 volts or 3.3
volts.
The value read from a digital pin is either HIGH (1) or LOW (0), representing the
presence or absence of voltage.
An ultrasonic sensor commonly used with Arduino boards, like the HC-SR04,
typically has four pins:
VCC (Power): This pin is connected to the positive supply voltage (usually 5
volts) of the Arduino board to power the sensor.
Trig (Trigger): This pin is used to trigger the sensor to emit ultrasonic waves for
distance measurement. To initiate a distance measurement, a short high-level
pulse (typically 10 microseconds) is sent to this pin.
Echo: This pin receives the ultrasonic waves reflected back by an object. The
time taken for the ultrasonic waves to return is proportional to the distance
between the sensor and the object. The Echo pin outputs a pulse whose width
is proportional to this time.
GND (Ground): This pin is connected to the ground (0 volts) of the Arduino
board to complete the circuit.
Connection to Arduino board: Connect the VCC pin of the ultrasonic sensor to
the 5V pin on the Arduino board.
Connect the GND pin of the ultrasonic sensor to any GND pin on the Arduino
board.
Connect the Trig pin of the ultrasonic sensor to any digital pin (preferably a
digital output pin) on the Arduino board.
Connect the Echo pin of the ultrasonic sensor to any digital pin (preferably a
digital input pin with interrupt capability) on the Arduino board.
By using appropriate Arduino code, the Trig pin is pulsed to trigger the sensor,
and the duration of the pulse received on the Echo pin is measured to calculate
the distance to the object in front of the sensor.
int greenLedPin = 7;
int redLedPin = 8;
void setup() {
pinMode(greenLedPin, OUTPUT);
pinMode(redLedPin, OUTPUT);
void loop() {
// Turn off the green LED and turn on the red LED for 2 seconds
Q9) The process of reading temperature and humidity and after display it on
the serial monitor is as follows
// Read temperature and humidity data
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(humidity);
Serial.println(" %");
Q10)
b) The gauge factor (GF) of a strain gauge sensor is defined as the ratio of the
fractional change in electrical resistance (ΔR/R) to the applied strain (ε):
∆𝑅/𝑅
𝐺𝐹 =
∈
Given
𝑅0 = 16Ω
Δ𝑅 = 6Ω
Accelerometer: Measures acceleration along three orthogonal axes (X, Y, and Z).
Gyroscope: Measures angular velocity or rotation rate around the same three
axes.
ii) GND (Ground):The GND pin of the MPU-6050 module should be connected
to any ground (GND) pin on the Arduino board. It completes the electrical
circuit and provides a reference voltage level for the module.