Unit 4: Programming NodeMCU for PWM - Subjective Questions

ECE237 — Architecting Smart Iot Devices • Practice Questions with Detailed Answers

20 questions

1

Define Pulse Width Modulation (PWM). Explain the terms duty cycle, time period, and frequency.

2

Explain how PWM is generated using a NodeMCU and describe the purpose of the analogWrite() function.

3

Describe the circuit connections and program logic required to control the brightness of an LED using NodeMCU PWM.

4

Write and explain a NodeMCU program that gradually fades an LED from minimum brightness to maximum brightness and back.

5

A NodeMCU uses a PWM range of 0 to 1023. Calculate the PWM value required for LED duty cycles of , , and .

6

Distinguish between controlling an LED using a digital output and controlling it using PWM.

7

Explain why an LED must not be connected directly to a NodeMCU GPIO pin without a current-limiting resistor.

8

Explain the operating principle of a hobby servo motor and how PWM pulses determine its shaft position.

9

Describe how a servo motor should be interfaced with a NodeMCU, including signal, power, and grounding requirements.

10

Write and explain a NodeMCU program using a servo library to move a servo motor from to and back.

11

Derive a linear expression for converting a required servo angle from to into a pulse width from to . Calculate the pulse width for , , and .

12

Compare PWM control of LED brightness with PWM-based position control of a servo motor.

13

Explain why a DC motor cannot normally be driven directly from a NodeMCU GPIO pin.

14

Describe a transistor- or MOSFET-based circuit for controlling the speed of a DC motor with NodeMCU PWM.

15

Explain the purpose of a flyback diode in a PWM-controlled DC motor circuit.

16

Explain how PWM duty cycle affects the average voltage, torque, and speed of a DC motor.

17

A DC motor is controlled by PWM. Calculate its ideal average applied voltage at duty cycles of , , and . Discuss why the actual motor behavior may differ from these ideal values.

18

Distinguish between a single-transistor motor driver and an H-bridge motor driver for NodeMCU-based DC motor control.

19

Design the control logic for operating a DC motor in forward, reverse, stop, and variable-speed modes using a NodeMCU and an H-bridge driver.

20

Discuss the effect of PWM frequency when controlling LEDs, servo motors, and DC motors using a NodeMCU.