Unit 2: Advanced GPIO & Peripheral Control - Subjective Questions

ECE140 — Workshop On Iot For Digital Society • Practice Questions with Detailed Answers

20 questions

1

Compare the RPi.GPIO and GPIO Zero Python libraries with respect to abstraction level, programming style, features, and suitable applications.

2

Explain GPIO pin numbering, pin configuration, pull-up/pull-down resistors, and resource cleanup in RPi.GPIO.

3

Describe the device-oriented programming model of GPIO Zero. Illustrate how it simplifies the control of LEDs, buttons, and motors.

4

Distinguish between polling-based and interrupt-driven GPIO programming. Why is interrupt-driven programming preferred for many IoT applications?

5

Explain rising-edge, falling-edge, and both-edge detection in GPIO interrupts. Also discuss switch debouncing and the use of bouncetime.

6

Design a robust interrupt-driven GPIO program for a push button that toggles an LED. Explain initialization, callback execution, synchronization, debouncing, and cleanup.

7

Explain the construction and operation of an H-bridge for controlling a DC motor. Include its direction-control truth table and the unsafe shoot-through condition.

8

Why should a Raspberry Pi not drive a DC motor directly from a GPIO pin? Explain the roles of a motor driver IC, external supply, flyback protection, and common grounding.

9

Describe how PWM is used with an H-bridge to control the speed and direction of a DC motor. Discuss duty cycle, frequency, braking, and torque.

10

Develop a hardware and software control strategy for interfacing a bidirectional DC motor with a Raspberry Pi through a motor driver IC.

11

Explain servo motor control using PWM pulse width. Derive the relation between pulse width and angular position for a linearly calibrated servo.

12

Discuss servo calibration, jitter, power-supply requirements, and safe endpoint control when a servo is interfaced with a Raspberry Pi.

13

Compare unipolar and bipolar stepper motors. Explain full-step, wave-drive, half-step, and microstepping control methods.

14

A stepper motor has a step angle of and is operated with microsteps per full step. Calculate its microsteps per revolution and the pulse frequency required for .

15

Why are acceleration and deceleration profiles necessary in stepper motor control? Compare constant-speed, trapezoidal, and S-curve profiles.

16

Derive the main equations for a symmetric trapezoidal velocity profile and explain how to determine whether a move reaches the requested maximum velocity.

17

Explain Direct Memory Access and how DMA can be used to achieve real-time or deterministic GPIO waveform generation on a Raspberry Pi.

18

Compare software-timed PWM, hardware PWM, and DMA-based GPIO waveform generation in terms of precision, CPU usage, flexibility, and applications.

19

Design a DMA-based control approach for generating simultaneous servo pulses and stepper motor pulses. Discuss timing, buffering, synchronization, and fault handling.

20

Propose an integrated Raspberry Pi GPIO control system containing a button interrupt, DC motor, servo, and stepper motor. Explain the software architecture, safety measures, and debugging procedure.