Q1. In Experiment 1, which NodeMCU pin is defined as LED_PIN in the given program?
Correct Answer: A | Marks: 1
Explanation:
The manual defines LED_PIN as D2. The program configures this pin as OUTPUT and uses digitalWrite() to control the LED.
Q2. Which function reads the state of the pushbutton in Experiment 1?
Correct Answer: A | Marks: 1
Explanation:
digitalRead(BUTTON_PIN) reads the digital state of the button. digitalWrite() is used for outputs, while analogRead() and analogWrite() serve analog/PWM-related operations.
Q3. What pin mode is assigned to BUTTON_PIN in Experiment 1?
Correct Answer: A | Marks: 1
Explanation:
The program uses pinMode(BUTTON_PIN, INPUT), because the NodeMCU must receive the button's digital signal.
Q4. If digitalRead(BUTTON_PIN) returns HIGH, what does the Experiment 1 program do?
Correct Answer: A | Marks: 1
Explanation:
The if condition checks for HIGH. When HIGH is detected, digitalWrite(LED_PIN, HIGH) turns the LED on.
Q5. Why is a 10 kΩ resistor used in the Experiment 1 circuit?
Correct Answer: A | Marks: 1
Explanation:
The manual specifies a 10 kΩ resistor acting as a pull-down resistor. It helps keep the digital input at a defined LOW state when the button is not pressed.
Q6. Which function sets a NodeMCU pin to operate as an input or output?
Correct Answer: A | Marks: 1
Explanation:
pinMode() configures the operating mode of a digital pin. In Experiment 1 it is used for both the LED output and button input.
Q7. What is the output action when the pushbutton is not pressed in Experiment 1?
Correct Answer: A | Marks: 1
Explanation:
The else branch executes digitalWrite(LED_PIN, LOW), so the LED is turned off when the button input is not HIGH.
Q8. Which pair correctly represents the digital input and output pins in Experiment 1?
Correct Answer: A | Marks: 1
Explanation:
The program defines BUTTON_PIN as D3 and LED_PIN as D2. Therefore D3 is the input and D2 is the output.
Q9. If the button signal alternates HIGH and LOW, the LED in Experiment 1 will primarily:
Correct Answer: A | Marks: 1
Explanation:
The loop repeatedly reads the button. HIGH causes the LED output to be HIGH and LOW causes it to be LOW, so the LED follows the button state.
Q10. Which pin is used as POT_PIN for analog input in Experiment 2?
Correct Answer: A | Marks: 1
Explanation:
The program defines POT_PIN as A0. The potentiometer value is obtained with analogRead(A0).
Q11. What ADC reading range is used in the Experiment 2 program?
Correct Answer: A | Marks: 1
Explanation:
The program uses a 10-bit ADC range of 0 to 1023 and explicitly sets the PWM range to 0–1023.
Q12. Which function reads the potentiometer in Experiment 2?
Correct Answer: A | Marks: 1
Explanation:
analogRead(POT_PIN) obtains the analog value from A0. This value is then mapped to an LED brightness value.
Q13. Why is map(potValue, 0, 1023, 0, 255) used in Experiment 2?
Correct Answer: A | Marks: 1
Explanation:
The potentiometer reading spans 0–1023, while analogWrite() is supplied a brightness value mapped to 0–255 in this program.
Q14. What is the purpose of analogWriteRange(1023) in Experiment 2?
Correct Answer: A | Marks: 1
Explanation:
The statement explicitly sets the PWM range to 0–1023, matching the 10-bit range used in the program.
Q15. Numerical: If the potentiometer reading is 512, approximately what brightness value is produced by map(512, 0, 1023, 0, 255)?
Correct Answer: A | Marks: 1
Explanation:
The mapped value is approximately 512×255/1023 ≈ 127.6, which is about 128. This converts the midpoint of the ADC range to roughly the midpoint of the 0–255 brightness range.
Q16. Numerical: If potValue = 256, what approximate 8-bit brightness does the given mapping produce?
Correct Answer: A | Marks: 1
Explanation:
Using brightness ≈ 256×255/1023 gives about 63.8, so the practical integer result is about 64.
Q17. Numerical: If the ADC value is 1023, what brightness value is obtained from the stated mapping?
Correct Answer: A | Marks: 1
Explanation:
The mapping sends the upper input limit 1023 to the upper output limit 255. Therefore the brightness value is 255.
Q18. Numerical: If the ADC reading is 0, what brightness value is obtained from the Experiment 2 mapping?
Correct Answer: A | Marks: 1
Explanation:
The lower end of the input range, 0, maps directly to the lower end of the output range, 0. Thus the LED brightness command is zero.
Q19. Which sensor is used for object detection in Experiment 3?
Correct Answer: A | Marks: 1
Explanation:
The hardware list specifies an Active IR Sensor. The program reads its digital output through IR_pin.
Q20. Which NodeMCU pin is assigned to the IR sensor in Experiment 3?
Correct Answer: A | Marks: 1
Explanation:
The program declares const int IR_pin = D1 and configures it as INPUT.
Q21. Which pin is assigned to the LED in Experiment 3?
Correct Answer: A | Marks: 1
Explanation:
The code defines LED_pin as D0 and configures it as OUTPUT.
Q22. Which pin is assigned to the buzzer in Experiment 3?
Correct Answer: A | Marks: 1
Explanation:
The program defines Buzzer_pin as D3 and configures that pin as an output.
Q23. What function is used to read the IR sensor's digital state?
Correct Answer: A | Marks: 1
Explanation:
The code uses value = digitalRead(IR_pin) to obtain the sensor's digital state.
Q24. When value == 1 in Experiment 3, which combination is activated?
Correct Answer: A | Marks: 1
Explanation:
For value == 1, the program writes HIGH to the LED and calls tone(Buzzer_pin, 1000), producing a 1 kHz tone.
Q25. What is the purpose of noTone(Buzzer_pin) in the else branch?
Correct Answer: A | Marks: 1
Explanation:
noTone() stops the tone previously generated on the buzzer pin. The same else branch also turns the LED LOW.
Q26. Numerical: The buzzer is commanded with tone(Buzzer_pin, 1000). What is the commanded frequency?
Correct Answer: B | Marks: 1
Explanation:
The second argument of tone() is the frequency in hertz. The program explicitly supplies 1000, so the commanded frequency is 1000 Hz.
Q27. If the IR sensor continuously returns 0 in Experiment 3, what steady output state should be expected?
Correct Answer: B | Marks: 1
Explanation:
With value equal to 0, the else branch executes digitalWrite(LED_pin, LOW) and noTone(Buzzer_pin), so both outputs are inactive.
Q28. Which component is used to capture light sensitivity in Experiment 4?
Correct Answer: B | Marks: 1
Explanation:
The experiment specifically aims to capture light sensitivity using an LDR or photoresistor connected to NodeMCU.
Q29. Which NodeMCU pin is read in the LDR program?
Correct Answer: B | Marks: 1
Explanation:
The program uses analogRead(A0), so A0 is the analog input used for the LDR measurement.
Q30. What serial communication speed is initialized in Experiment 4?
Correct Answer: B | Marks: 1
Explanation:
Serial.begin(9600) initializes serial communication at 9600 bits per second as shown in the manual.
Q31. What is the purpose of sensorValue = analogRead(A0)?
Correct Answer: B | Marks: 1
Explanation:
The statement reads the analog voltage produced by the LDR circuit at A0 and stores the ADC result in sensorValue.
Q32. Numerical: Using voltage = sensorValue × 5/1023, what voltage is calculated for sensorValue = 512?
Correct Answer: B | Marks: 1
Explanation:
512 is approximately half of 1023, so the formula gives about 512×5/1023 ≈ 2.50 V.
Q33. Numerical: Using the same formula, what voltage is obtained when sensorValue = 1023?
Correct Answer: B | Marks: 1
Explanation:
Substituting 1023 gives 1023×5/1023 = 5 V, which is the upper voltage represented by the manual's stated conversion.
Q34. Numerical: Using the stated conversion, what voltage corresponds to sensorValue = 0?
Correct Answer: B | Marks: 1
Explanation:
With sensorValue equal to zero, the multiplication gives zero volts.
Q35. Why is Serial.println(voltage) used in Experiment 4?
Correct Answer: B | Marks: 1
Explanation:
The statement prints the converted voltage to the serial monitor so the measured light-related signal can be observed.
Q36. What does PWM stand for in Experiment 5?
Correct Answer: B | Marks: 1
Explanation:
PWM means Pulse Width Modulation, the technique used in the experiment to vary the effective output level of the LED.
Q37. Which pin is used for the LED in the Experiment 5 program?
Correct Answer: B | Marks: 1
Explanation:
The code declares const int led_pin = D0, then configures that pin as OUTPUT.
Q38. Which Arduino function is used to set the PWM output value in Experiment 5?
Correct Answer: B | Marks: 1
Explanation:
analogWrite(led_pin, i) is used to apply the varying PWM command to the LED pin.
Q39. Numerical: In the loop for(int i=0; i<=1024; i++), how many integer values are traversed?
Correct Answer: B | Marks: 1
Explanation:
The sequence starts at 0 and includes 1024, so the count is 1024−0+1 = 1025 values.
Q40. Numerical: Each PWM step in Experiment 5 has delay(10). Ignoring other execution time, approximately how long is one complete 1025-step sweep?
Correct Answer: B | Marks: 1
Explanation:
There are 1025 loop iterations and each contains a 10 ms delay. Thus 1025×10 ms = 10250 ms = 10.25 s.
Q41. Numerical: At i = 512, approximately what fraction of a 0–1024 command range is represented?
Correct Answer: B | Marks: 1
Explanation:
512 is approximately half of 1024, so it represents about 50% of the command range.
Q42. Why is pinMode(led_pin, OUTPUT) required before analogWrite() in the experiment?
Correct Answer: B | Marks: 1
Explanation:
The LED must be driven by the NodeMCU pin. pinMode() explicitly configures that pin as an output before the PWM command is applied.
Q43. If the PWM command is increased gradually in the given experiment, the intended visible effect on the LED is:
Correct Answer: B | Marks: 1
Explanation:
The experiment uses increasing analogWrite() values on an LED, so the intended demonstration is variation of LED brightness with the PWM command.
Q44. Which pin is configured as the trigger pin in Experiment 6?
Correct Answer: B | Marks: 1
Explanation:
The program defines trigger_pin = D6 and configures it as OUTPUT.
Q45. Which pin is configured as the echo pin in Experiment 6?
Correct Answer: B | Marks: 1
Explanation:
The code defines echo_pin = D7 and configures it as INPUT to receive the echo timing.
Q46. How long is the trigger pulse set HIGH in the given program?
Correct Answer: B | Marks: 1
Explanation:
The code drives the trigger HIGH and then calls delayMicroseconds(10), creating the stated 10-microsecond trigger pulse.
Q47. Which function measures the duration of the HIGH echo pulse?
Correct Answer: B | Marks: 1
Explanation:
pulseIn(echo_pin, HIGH) measures the time for which the echo pin remains HIGH, and that duration is used for distance calculation.
Q48. Numerical: If duration = 1000 µs, what distance does distance = duration × 0.034/2 give?
Correct Answer: B | Marks: 1
Explanation:
Substitution gives 1000×0.034/2 = 17 cm. The division by two accounts for the outgoing and returning path of the sound wave.
Q49. Numerical: If duration = 2000 µs, what distance is calculated by the manual's formula?
Correct Answer: B | Marks: 1
Explanation:
Using distance = 2000×0.034/2 gives 34 cm.
Q50. Numerical: If the calculated distance is 51 cm, approximately what echo duration is implied by the same formula?
Q51. Why is the trigger pin first driven LOW and held for 2 microseconds?
Correct Answer: C | Marks: 1
Explanation:
The code comments state 'Clear trigger pin' before the 10-microsecond HIGH pulse. This establishes a clean trigger sequence for the measurement.
Q52. Which sensor is used in Experiment 7 to measure humidity and temperature?
Correct Answer: C | Marks: 1
Explanation:
The experiment is specifically for capturing humidity and temperature values using the DHT11 sensor.
Q53. Which library is included in the DHT11 program?
Correct Answer: C | Marks: 1
Explanation:
The program includes DHT.h and creates a DHT object using the DHT11 sensor type.
Q54. Which pin is assigned to DHT_pin in Experiment 7?
Correct Answer: C | Marks: 1
Explanation:
The code declares const int DHT_pin = D1 and passes that pin to the DHT object.
Q55. Which function reads temperature from the DHT11 object?
Correct Answer: C | Marks: 1
Explanation:
The program stores the temperature using float t = dht.readTemperature().
Q56. Which function reads relative humidity?
Correct Answer: C | Marks: 1
Explanation:
The program stores humidity using float h = dht.readHumidity().
Q57. Numerical: If the DHT11 program reports 30°C and 60% humidity, what two values are printed for the measurements?
Correct Answer: C | Marks: 1
Explanation:
The program prints the temperature value followed by 'centi' and then the humidity value followed by '%'. Thus the displayed measurement values are 30 and 60 respectively.
Q58. Numerical: If temperature is 25°C and humidity is 40%, what is the sum of the two numeric readings printed by the program?
Correct Answer: C | Marks: 1
Explanation:
The numeric values are 25 and 40. Their sum is 25 + 40 = 65, so option C is actually correct.
Q59. Why is dht.begin() called in setup()?
Correct Answer: C | Marks: 1
Explanation:
dht.begin() initializes the DHT object so that subsequent readTemperature() and readHumidity() operations can communicate with the sensor.
Q60. What is the primary purpose of Experiment 8?
Correct Answer: C | Marks: 1
Explanation:
The stated aim is to upload sensor data to the cloud using ThingSpeak and NodeMCU.
Q61. Which Wi-Fi library is included in the ThingSpeak upload program?
Correct Answer: C | Marks: 1
Explanation:
The program includes ESP8266WiFi.h to establish the NodeMCU's Wi-Fi connection.
Q62. In the program, what does apiKey represent?
Correct Answer: C | Marks: 1
Explanation:
The manual instructs the user to replace the APIKEY placeholder with the ThingSpeak API Key used to authenticate and authorize data uploads.
Q63. How many fields does the manual state can be used in a ThingSpeak channel?
Correct Answer: C | Marks: 1
Explanation:
The manual states that ThingSpeak can have up to 8 fields, with field numbers adjusted if additional sensors are added.
Q64. Numerical: The program waits 15 seconds between ThingSpeak posts. How many posting intervals occur in 1 minute if the timing is ideal?
Correct Answer: C | Marks: 1
Explanation:
One interval is 15 seconds. One minute is 60 seconds, so 60/15 = 4 intervals.
Q65. Numerical: If field1 contains temperature 28 and field2 contains humidity 65, what two sensor values are placed into postStr?
Correct Answer: C | Marks: 1
Explanation:
The program appends the temperature to field1 and humidity to field2. Therefore the transmitted sensor values are 28 and 65.
Q66. Numerical: If four sensor values are assigned one per ThingSpeak field, how many of the manual's maximum eight fields remain unused?
Correct Answer: C | Marks: 1
Explanation:
The manual states a maximum of eight fields. If four are used, 8 − 4 = 4 remain unused.
Q67. Which function in the manual's ThingSpeak discussion is described as sending the data to the channel and returning a response code?
Correct Answer: C | Marks: 1
Explanation:
The manual specifically states that ThingSpeak.writeFields(channelID, apiKey) sends the data and returns a response code used to check whether the operation succeeded.
Q68. Which library provides the web server functionality in Experiment 9?
Correct Answer: C | Marks: 1
Explanation:
The program includes ESP8266WebServer.h and creates an ESP8266WebServer object on port 80.
Q69. Which function creates the NodeMCU access point in Experiment 9?
Correct Answer: C | Marks: 1
Explanation:
WiFi.softAP(ssid, password) configures the NodeMCU to create a local Wi-Fi access point.
Q70. Which URL path is registered for switching the LED ON?
Correct Answer: C | Marks: 1
Explanation:
The program registers server.on('/ledon', handle_ledon), so the /ledon route calls the LED-on handler.
Q71. Which HTTP status code is sent when a requested page is not found?
Correct Answer: C | Marks: 1
Explanation:
The handle_NotFound() function calls server.send(404, 'text/plain', 'Not found'), so the code is 404.
Q72. What is the role of server.handleClient() in loop()?
Correct Answer: C | Marks: 1
Explanation:
The web server must process incoming browser requests repeatedly. server.handleClient() performs that request handling inside loop().
Q73. Numerical: The local IP address in the program is 192.168.2.1. What is the fourth octet?
Correct Answer: C | Marks: 1
Explanation:
In 192.168.2.1, the four octets are 192, 168, 2 and 1. Therefore the fourth octet is 1.
Q74. If LEDstatus is HIGH when loop() executes, which output command is performed?
Correct Answer: C | Marks: 1
Explanation:
The loop tests if(LEDstatus). When it is true, digitalWrite(LEDpin, HIGH) turns the LED on.
Q75. Which HTML action is used by the generated page to request the LED-on route?
Correct Answer: C | Marks: 1
Explanation:
The generated HTML contains a button whose onclick action changes window.location.href to /ledon, causing the browser to request that server route.
Q76. What external service is used in Experiment 10 to tweet sensor data through ThingSpeak?
Correct Answer: D | Marks: 1
Explanation:
The manual explicitly states that ThingTweet is used within ThingSpeak to obtain the API key for posting the sensor message.
Q77. Which sensor supplies the temperature and humidity data for Experiment 10?
Correct Answer: D | Marks: 1
Explanation:
The hardware list and code use a DHT11 sensor connected to D1.
Q78. Which API endpoint is used in the program to update the ThingTweet status?
Correct Answer: D | Marks: 1
Explanation:
The code sends a GET request to /apps/thingtweet/1/statuses/update with the key and status parameters.
Q79. Numerical: If temperature is 27 and humidity is 55, what two values are combined into the tweet string in the shown program?
Correct Answer: D | Marks: 1
Explanation:
The code reads temperature first and humidity second, then constructs the status text using String(t) and String(h).
Q80. Why is client.stop() called after the ThingSpeak request?
Correct Answer: D | Marks: 1
Explanation:
client.stop() terminates the network client connection after the request has been sent.
Q81. Which function is used to establish the Wi-Fi connection in Experiment 10?
Correct Answer: D | Marks: 1
Explanation:
The code calls WiFi.begin(ssid, password) and waits until WiFi.status() becomes WL_CONNECTED.
Q82. What does the status text sent to ThingTweet contain in the main program?
Correct Answer: D | Marks: 1
Explanation:
The code constructs postStr using the temperature and humidity readings, then uses it as the status parameter in the ThingTweet request.
Q83. If WiFi.status() never becomes WL_CONNECTED during setup, what does the program's while loop do?
Correct Answer: D | Marks: 1
Explanation:
The while condition remains true, so the program repeatedly delays 500 ms and prints a dot until the Wi-Fi connection succeeds.
Q84. What is the aim of Experiment 11?
Correct Answer: D | Marks: 1
Explanation:
The experiment is explicitly titled control of an LED from a webpage hosted on the Internet using NodeMCU.
Q85. Which pin is assigned to LEDpin in the Experiment 11 program?
Correct Answer: D | Marks: 1
Explanation:
The program defines uint8_t LEDpin = D2.
Q86. Which web server class is instantiated in Experiment 11?
Correct Answer: D | Marks: 1
Explanation:
The program includes ESP8266WebServer.h and declares ESP8266WebServer server(80).
Q87. Numerical: The subnet mask shown in the program is 255.255.255.0. How many octets are 255?
Correct Answer: D | Marks: 1
Explanation:
The mask has four octets: 255, 255, 255 and 0. Therefore three octets are 255.
Q88. What variable stores the current LED state in the Experiment 11 program?
Correct Answer: D | Marks: 1
Explanation:
The boolean variable LEDstatus stores the LED's logical state, while LEDpin stores the hardware pin number.
Q89. If LEDstatus is LOW, which command does the loop execute?
Correct Answer: D | Marks: 1
Explanation:
The loop contains an if/else structure. When LEDstatus is false/LOW, the else branch writes LOW to LEDpin.
Q90. Why are both ESP8266WiFi.h and ESP8266WebServer.h included?
Correct Answer: D | Marks: 1
Explanation:
ESP8266WiFi.h supplies the Wi-Fi functionality, while ESP8266WebServer.h supplies the HTTP server class used by the program.
Q91. Numerical: The server is created as ESP8266WebServer server(80). What port number is used?
Correct Answer: D | Marks: 1
Explanation:
The constructor argument is 80, which is the port specified for the web server in the program.
Q92. Which platform is used in Experiment 12 as the MQTT server?
Correct Answer: D | Marks: 1
Explanation:
The code defines AIO_SERVER as io.adafruit.com, and the instructions require an Adafruit.io account.
Q93. Which protocol is used for communication with the Adafruit IO feed in the given code?
Correct Answer: D | Marks: 1
Explanation:
The program uses Adafruit_MQTT_Client and an Adafruit_MQTT_Subscribe object, indicating MQTT communication.
Q94. What is the AIO_SERVERPORT value shown for normal MQTT in the manual?
Correct Answer: D | Marks: 1
Explanation:
The manual defines AIO_SERVERPORT as 1883 and comments that 8883 may be used for SSL.
Q95. Which LED pin is used in Experiment 12?
Correct Answer: D | Marks: 1
Explanation:
The code defines LED_PIN as D1 and configures it as an OUTPUT.
Q96. What is the purpose of the Light1 subscription object?
Correct Answer: D | Marks: 1
Explanation:
The code creates Adafruit_MQTT_Subscribe Light1 for the feed AIO_USERNAME/feeds/light, so incoming feed changes can be processed.
Q97. If the subscribed message contains the character '1', what does atoi() make Light1_State become?
Correct Answer: D | Marks: 1
Explanation:
atoi() converts the text '1' to the integer value 1. The program then passes Light1_State to digitalWrite().
Q98. Numerical: The MQTT connection routine allows 3 retries. If all 3 attempts fail, how many additional retry attempts are made after the third failure?
Correct Answer: D | Marks: 1
Explanation:
The code initializes retries to 3 and decrements it after each failed attempt. When it reaches zero, the program enters while(1), so no fourth retry is made.
Q99. What sequence best matches the manual's setup instructions for voice control?
Correct Answer: D | Marks: 1
Explanation:
The manual lists the workflow in this order: create an Adafruit.io account, configure IFTTT, install the Adafruit MQTT library, upload the code and connect NodeMCU to Wi-Fi, then use Google Assistant voice commands.
Q100. Numerical: The manual lists MQTT port 1883 and mentions 8883 for SSL. What is the numerical difference between these two port numbers?
Correct Answer: D | Marks: 1
Explanation:
The two listed port numbers are 1883 and 8883. Their difference is 8883 − 1883 = 7000. The manual notes 1883 for MQTT and 8883 for SSL.