Unit 6: Introduction of Arduino and Sensors - Subjective Questions
PHY175 — Modern Physics And Electronics • Practice Questions with Detailed Answers
20 questions
Define analog and digital signals. Give two examples of each type of signal.
Analog signal: An analog signal varies continuously with time and can have any value within a specified range.
- Examples: output voltage of an LDR voltage divider and an analog temperature sensor signal.
- It is represented by a smooth, continuous waveform.
Digital signal: A digital signal has discrete voltage levels, usually represented by binary states 0 and 1.
- Examples: output of an IR obstacle sensor module and data output from a DHT11 sensor.
- In a typical Arduino Uno circuit, LOW is approximately and HIGH is approximately .
Distinguish between analog and digital signals on the basis of values, waveform, noise immunity, processing, and examples.
| Basis | Analog signal | Digital signal |
|---|---|---|
| Values | Can take infinitely many values within a range | Usually has two discrete states: 0 and 1 |
| Waveform | Continuous waveform | Pulses or step-like waveform |
| Noise immunity | More easily affected by noise | Generally more resistant to noise |
| Processing | Requires analog circuits or conversion before digital processing | Can be processed directly by digital systems |
| Arduino input | Read through analog input pins using an ADC | Read through digital input pins |
| Example | Voltage from an LDR divider | HIGH/LOW output of an IR module |
An analog signal often requires analog-to-digital conversion, whereas a digital signal can normally be interpreted directly as a logical state.
Explain how the Arduino Uno converts an analog input voltage into a digital value. Calculate the approximate ADC value for an input of when the reference voltage is .
The Arduino Uno contains a 10-bit analog-to-digital converter (ADC). It converts an input voltage between and the reference voltage into an integer from 0 to 1023.
The conversion is approximately
For and ,
Therefore, the ADC reading is approximately 512.
The voltage represented by one ADC step is approximately
Thus, every increase of one count represents about .
Describe the main functional sections of an Arduino Uno board and state the purpose of each section.
The main functional sections of an Arduino Uno are:
- ATmega328P microcontroller: Executes the uploaded program and controls input and output operations.
- USB connector and USB interface: Connect the board to a computer for programming and serial communication.
- DC barrel jack: Accepts an external power supply.
- Voltage regulator: Provides a stable operating voltage to the board.
- Digital I/O pins: Read digital states or produce HIGH and LOW outputs.
- Analog input pins: Measure analog voltages using the internal ADC.
- Power pins: Provide , , ground, and other supply-related connections.
- Reset button and RESET pin: Restart execution of the program.
- Crystal or resonator: Supplies the clock signal, normally on an Arduino Uno.
- Indicator LEDs: Show power, serial transmission, serial reception, and the state of digital pin 13.
Explain the pin configuration of an Arduino Uno, including its digital, analog, power, communication, PWM, interrupt, and reference pins.
The important Arduino Uno pins are:
- Digital pins 0-13: Configurable as digital inputs or outputs.
- Pins 0 and 1: Used for UART serial communication as RX and TX, respectively.
- PWM pins 3, 5, 6, 9, 10, and 11: Produce pulse-width-modulated output using
analogWrite(). - External interrupt pins 2 and 3: Can respond immediately to selected signal changes.
- Analog pins A0-A5: Connected to the 10-bit ADC and used to measure analog voltages.
- I2C pins: A4 acts as SDA and A5 acts as SCL.
- SPI pins: Digital pins 10-13 perform SS, MOSI, MISO, and SCK functions.
- Power pins: Include , , GND, VIN, and IOREF.
- AREF: Allows an external analog reference voltage to be supplied.
- RESET: Resets the microcontroller when driven LOW.
Some pins have multiple functions, so their use must be planned carefully when several sensors or communication interfaces are connected.
Differentiate among the Arduino Uno pins labeled VIN, , , GND, AREF, and RESET.
- VIN: Input for an external unregulated supply when power is not applied through USB or the barrel jack. The board regulator converts this voltage to the required level.
- pin: Provides the regulated supply used by the microcontroller and many external modules.
- pin: Provides a regulated output for compatible low-voltage devices, subject to its current limit.
- GND: Provides the common zero-volt reference and return path for current.
- AREF: Accepts an external reference voltage for analog-to-digital conversion when properly configured.
- RESET: Restarts the ATmega328P when this pin is pulled LOW.
A sensor and the Arduino should normally share a common ground so that signal voltages have the same reference.
What is pulse-width modulation in Arduino? Explain duty cycle and distinguish PWM output from a true analog output.
Pulse-width modulation (PWM) rapidly switches a digital pin between HIGH and LOW. The fraction of one period for which the signal remains HIGH is called the duty cycle.
For an ideal PWM signal with HIGH voltage , its average voltage is
where is the duty cycle expressed as a fraction.
- A 0% duty cycle gives an average value near .
- A 50% duty cycle gives an average value near half the supply voltage.
- A 100% duty cycle keeps the output HIGH.
PWM is not a continuously variable analog voltage. It is a digital pulse train whose average effect can control LED brightness or motor speed. A filter may be used when a smoother voltage is required.
Describe the construction and working principle of a typical infrared obstacle-detection sensor module.
A typical IR obstacle sensor module contains:
- An infrared-emitting diode, which transmits IR radiation.
- An IR photodiode or phototransistor, which detects reflected radiation.
- A comparator circuit, which compares the detector signal with an adjustable threshold.
- A potentiometer, which sets the detection sensitivity.
- Output and indicator components.
Working principle:
- The IR LED continuously emits infrared radiation.
- When an object is present, some radiation is reflected toward the receiver.
- The receiver converts the reflected radiation into an electrical signal.
- The comparator checks whether this signal exceeds the selected threshold.
- The digital output changes state and indicates the presence of an obstacle.
The exact active output level depends on the module; many common modules produce LOW when an obstacle is detected.
Explain how an IR sensor module is interfaced with an Arduino for obstacle detection. Include the connections and basic program logic.
A common three-pin IR module can be connected as follows:
- VCC to the module's specified Arduino supply, commonly .
- GND to Arduino GND.
- OUT to an Arduino digital input pin.
Basic program logic:
- Configure the connected Arduino pin as
INPUT. - Read the output using
digitalRead(). - Interpret the state according to the module specification.
- Turn on an LED, sound a buzzer, stop a motor, or send a serial message when an obstacle is detected.
For an active-LOW module, the conceptual condition is:
LOW: obstacle detected.HIGH: no obstacle detected.
Before relying on these states, the sensor threshold should be adjusted and its output behavior should be verified experimentally.
Discuss the limitations of an IR obstacle sensor and explain how environmental and object properties affect its performance.
The performance of an IR obstacle sensor is affected by several factors:
- Object color: Dark surfaces may absorb IR radiation and return a weak signal.
- Surface finish: Shiny or angled surfaces may reflect radiation away from the receiver.
- Distance: Reflected intensity decreases as the object moves farther away.
- Ambient light: Sunlight and other strong IR sources can interfere with detection.
- Object size and orientation: Small or tilted objects may not reflect enough radiation.
- Dust and dirt: Contamination on the transmitter or receiver reduces sensitivity.
- Threshold setting: Excessive sensitivity may cause false detection, while low sensitivity may miss objects.
An IR obstacle module is useful for simple presence detection, but it is generally unsuitable for accurate distance measurement. Shielding, calibration, modulation, and correct sensor placement can improve reliability.
Define an LDR and explain how its resistance changes with illumination.
An LDR, or light-dependent resistor, is a photosensitive resistor whose resistance depends on the intensity of incident light. It is also called a photoresistor.
- In darkness, its resistance is very high and may reach hundreds of kilohms or more.
- In bright light, its resistance decreases considerably.
- Its response is continuous but generally nonlinear.
Incident photons increase the number of charge carriers in the photosensitive material. This increases conductivity and therefore reduces resistance.
Thus,
LDRs are used in automatic streetlights, light meters, alarms, and display-brightness control systems.
Explain how an LDR and a fixed resistor form a voltage divider for measurement by an Arduino. Derive the output-voltage expression for both possible component arrangements.
An LDR is connected in series with a fixed resistor across the supply. The junction between them is connected to an Arduino analog input.
Case 1: LDR connected to and fixed resistor connected to ground
The output is measured across the fixed resistor:
As light increases, decreases, so increases.
Case 2: Fixed resistor connected to and LDR connected to ground
The output is measured across the LDR:
As light increases, decreases, so decreases.
The Arduino ADC converts into a digital reading. Reversing the positions of the LDR and fixed resistor therefore reverses the direction in which the reading changes with illumination.
Describe how an Arduino-based automatic streetlight can be designed using an LDR.
An automatic streetlight system can use an LDR voltage divider as the light-sensing circuit.
Connections and operation:
- Connect the LDR and a fixed resistor as a voltage divider.
- Connect the divider output to an Arduino analog input.
- Connect an LED through a current-limiting resistor to an output pin. A transistor, relay, or suitable driver is required for a high-power lamp.
- Read the light-dependent ADC value using
analogRead(). - Compare the reading with a calibrated threshold.
- Switch the lamp ON when the reading indicates darkness and OFF when it indicates sufficient daylight.
To prevent rapid switching near the threshold, two thresholds can be used:
- Turn ON below the dark threshold.
- Turn OFF above a higher bright threshold.
This difference is called hysteresis and improves the stability of the system.
State and explain the basic principle of an ultrasonic distance sensor.
An ultrasonic distance sensor measures distance using the time-of-flight or echo-ranging principle.
- The transmitter emits a short burst of ultrasonic sound, commonly near .
- The sound wave travels through air toward an object.
- The object reflects part of the sound back to the sensor.
- The receiver detects the returning echo.
- The sensor or microcontroller measures the total round-trip time.
Since the measured time includes travel to the object and back, the one-way distance is
where:
- is the distance to the object,
- is the speed of sound,
- is the round-trip time.
The factor of 2 accounts for the outward and return journeys.
An ultrasonic sensor receives an echo after transmitting a pulse. Calculate the distance of the object if the speed of sound is .
The distance is calculated from
Given:
Therefore,
Thus, the object is approximately from the sensor. Division by 2 is necessary because the measured time is for the sound to travel to the object and return.
Explain how a typical HC-SR04 ultrasonic sensor is connected to and operated by an Arduino.
The HC-SR04 has four pins:
- VCC: Connected to .
- GND: Connected to Arduino GND.
- TRIG: Connected to an Arduino digital output.
- ECHO: Connected to an Arduino digital input.
Operating sequence:
- Keep TRIG LOW briefly to obtain a stable starting condition.
- Apply a HIGH pulse of approximately to TRIG.
- The module emits an ultrasonic burst.
- The ECHO pin remains HIGH for the round-trip travel time of the sound.
- Measure the HIGH-pulse duration using the Arduino.
- Calculate distance using
At room temperature, a commonly used approximation is
The approximation may require correction when temperature or environmental conditions change significantly.
Explain the major sources of error and practical limitations in ultrasonic distance measurement.
Important sources of error and limitations include:
- Temperature: The speed of sound changes with air temperature, affecting the calculated distance.
- Humidity and air movement: These can cause smaller changes in sound propagation.
- Soft materials: Cloth, foam, and similar materials absorb sound and may produce weak echoes.
- Object angle: A tilted surface may reflect sound away from the receiver.
- Object size: Very small objects may not reflect enough sound.
- Blind zone: Objects closer than the sensor's minimum range may not be measured correctly.
- Multiple reflections: Nearby surfaces can produce unwanted echoes.
- Cross-talk: Two ultrasonic sensors operating together may detect each other's pulses.
- Timing resolution: Limited timer precision creates measurement uncertainty.
Accuracy can be improved by temperature compensation, averaging several readings, spacing measurements appropriately, and mounting the sensor perpendicular to the target.
Describe the working principle and pin configuration of DHT11 and DHT22 temperature-humidity sensors.
DHT11 and DHT22 are digital sensors that measure temperature and relative humidity.
- A humidity-sensitive element changes its electrical characteristics with moisture.
- A temperature-sensing element measures ambient temperature.
- An internal circuit converts and calibrates these measurements.
- The sensor sends the result through a timing-based single-wire digital data interface.
A bare four-pin DHT sensor is commonly arranged as:
- VCC: Supply voltage.
- DATA: Digital communication line.
- NC: Not connected.
- GND: Ground.
A pull-up resistor is normally connected between DATA and VCC, although many three-pin modules already contain it. The Arduino must use a suitable DHT library or implement the required timing protocol to decode the transmitted data.
Compare DHT11 and DHT22 sensors in terms of temperature range, humidity range, accuracy, sampling rate, cost, and suitable applications.
| Feature | DHT11 | DHT22 |
|---|---|---|
| Temperature range | Approximately to | Approximately to |
| Humidity range | Approximately 20% to 80% RH | Approximately 0% to 100% RH |
| Temperature accuracy | Commonly about | Commonly about |
| Humidity accuracy | Commonly about RH | Commonly about to RH |
| Sampling rate | About one reading per second | About one reading every two seconds |
| Cost | Lower | Higher |
The DHT11 is suitable for basic, low-cost indoor projects. The DHT22 is preferred when a wider measurement range and better accuracy are required. Exact specifications may vary slightly by manufacturer and sensor version.
Describe a complete Arduino-based environmental monitoring system using a DHT11 or DHT22 sensor. Include interfacing, program flow, data validation, and precautions.
Interfacing:
- Connect VCC to the supply voltage recommended for the sensor or module.
- Connect GND to Arduino GND.
- Connect DATA to a digital pin.
- Add the required pull-up resistor between DATA and VCC if it is not already present on the module.
Program flow:
- Include a compatible DHT sensor library.
- Define the selected sensor type and data pin.
- Initialize serial communication and the sensor.
- Wait for the sensor's required sampling interval.
- Read temperature and relative humidity.
- Check whether the returned values are valid.
- Display valid measurements on the Serial Monitor, LCD, or another output device.
- Activate an alarm or fan when a chosen threshold is exceeded.
Data validation and precautions:
- Reject invalid or unavailable readings instead of using them in control decisions.
- Do not poll the sensor faster than its supported sampling rate.
- Keep wiring short and ensure a common ground.
- Avoid placing the sensor near direct sunlight, heaters, or moisture droplets.
- Allow ventilation around the sensing element.
These steps produce a reliable basic system for monitoring indoor temperature and humidity.
Define analog and digital signals. Give two examples of each type of signal.
Analog signal: An analog signal varies continuously with time and can have any value within a specified range.
- Examples: output voltage of an LDR voltage divider and an analog temperature sensor signal.
- It is represented by a smooth, continuous waveform.
Digital signal: A digital signal has discrete voltage levels, usually represented by binary states 0 and 1.
- Examples: output of an IR obstacle sensor module and data output from a DHT11 sensor.
- In a typical Arduino Uno circuit, LOW is approximately and HIGH is approximately .
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →