← Home
MECHANICAL ENGINEERING MCQ

Fundamentals of IoT and Sensors

IOT & Sensors Lab

Q1. In Experiment 1, which NodeMCU pin is defined as LED_PIN in the given program?
Correct Answer: A   |   Marks: 1
Q2. Which function reads the state of the pushbutton in Experiment 1?
Correct Answer: A   |   Marks: 1
Q3. What pin mode is assigned to BUTTON_PIN in Experiment 1?
Correct Answer: A   |   Marks: 1
Q4. If digitalRead(BUTTON_PIN) returns HIGH, what does the Experiment 1 program do?
Correct Answer: A   |   Marks: 1
Q5. Why is a 10 kΩ resistor used in the Experiment 1 circuit?
Correct Answer: A   |   Marks: 1
Q6. Which function sets a NodeMCU pin to operate as an input or output?
Correct Answer: A   |   Marks: 1
Q7. What is the output action when the pushbutton is not pressed in Experiment 1?
Correct Answer: A   |   Marks: 1
Q8. Which pair correctly represents the digital input and output pins in Experiment 1?
Correct Answer: A   |   Marks: 1
Q9. If the button signal alternates HIGH and LOW, the LED in Experiment 1 will primarily:
Correct Answer: A   |   Marks: 1
Q10. Which pin is used as POT_PIN for analog input in Experiment 2?
Correct Answer: A   |   Marks: 1
Q11. What ADC reading range is used in the Experiment 2 program?
Correct Answer: A   |   Marks: 1
Q12. Which function reads the potentiometer in Experiment 2?
Correct Answer: A   |   Marks: 1
Q13. Why is map(potValue, 0, 1023, 0, 255) used in Experiment 2?
Correct Answer: A   |   Marks: 1
Q14. What is the purpose of analogWriteRange(1023) in Experiment 2?
Correct Answer: A   |   Marks: 1
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
Q16. Numerical: If potValue = 256, what approximate 8-bit brightness does the given mapping produce?
Correct Answer: A   |   Marks: 1
Q17. Numerical: If the ADC value is 1023, what brightness value is obtained from the stated mapping?
Correct Answer: A   |   Marks: 1
Q18. Numerical: If the ADC reading is 0, what brightness value is obtained from the Experiment 2 mapping?
Correct Answer: A   |   Marks: 1
Q19. Which sensor is used for object detection in Experiment 3?
Correct Answer: A   |   Marks: 1
Q20. Which NodeMCU pin is assigned to the IR sensor in Experiment 3?
Correct Answer: A   |   Marks: 1
Q21. Which pin is assigned to the LED in Experiment 3?
Correct Answer: A   |   Marks: 1
Q22. Which pin is assigned to the buzzer in Experiment 3?
Correct Answer: A   |   Marks: 1
Q23. What function is used to read the IR sensor's digital state?
Correct Answer: A   |   Marks: 1
Q24. When value == 1 in Experiment 3, which combination is activated?
Correct Answer: A   |   Marks: 1
Q25. What is the purpose of noTone(Buzzer_pin) in the else branch?
Correct Answer: A   |   Marks: 1
Q26. Numerical: The buzzer is commanded with tone(Buzzer_pin, 1000). What is the commanded frequency?
Correct Answer: B   |   Marks: 1
Q27. If the IR sensor continuously returns 0 in Experiment 3, what steady output state should be expected?
Correct Answer: B   |   Marks: 1
Q28. Which component is used to capture light sensitivity in Experiment 4?
Correct Answer: B   |   Marks: 1
Q29. Which NodeMCU pin is read in the LDR program?
Correct Answer: B   |   Marks: 1
Q30. What serial communication speed is initialized in Experiment 4?
Correct Answer: B   |   Marks: 1
Q31. What is the purpose of sensorValue = analogRead(A0)?
Correct Answer: B   |   Marks: 1
Q32. Numerical: Using voltage = sensorValue × 5/1023, what voltage is calculated for sensorValue = 512?
Correct Answer: B   |   Marks: 1
Q33. Numerical: Using the same formula, what voltage is obtained when sensorValue = 1023?
Correct Answer: B   |   Marks: 1
Q34. Numerical: Using the stated conversion, what voltage corresponds to sensorValue = 0?
Correct Answer: B   |   Marks: 1
Q35. Why is Serial.println(voltage) used in Experiment 4?
Correct Answer: B   |   Marks: 1
Q36. What does PWM stand for in Experiment 5?
Correct Answer: B   |   Marks: 1
Q37. Which pin is used for the LED in the Experiment 5 program?
Correct Answer: B   |   Marks: 1
Q38. Which Arduino function is used to set the PWM output value in Experiment 5?
Correct Answer: B   |   Marks: 1
Q39. Numerical: In the loop for(int i=0; i<=1024; i++), how many integer values are traversed?
Correct Answer: B   |   Marks: 1
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
Q41. Numerical: At i = 512, approximately what fraction of a 0–1024 command range is represented?
Correct Answer: B   |   Marks: 1
Q42. Why is pinMode(led_pin, OUTPUT) required before analogWrite() in the experiment?
Correct Answer: B   |   Marks: 1
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
Q44. Which pin is configured as the trigger pin in Experiment 6?
Correct Answer: B   |   Marks: 1
Q45. Which pin is configured as the echo pin in Experiment 6?
Correct Answer: B   |   Marks: 1
Q46. How long is the trigger pulse set HIGH in the given program?
Correct Answer: B   |   Marks: 1
Q47. Which function measures the duration of the HIGH echo pulse?
Correct Answer: B   |   Marks: 1
Q48. Numerical: If duration = 1000 µs, what distance does distance = duration × 0.034/2 give?
Correct Answer: B   |   Marks: 1
Q49. Numerical: If duration = 2000 µs, what distance is calculated by the manual's formula?
Correct Answer: B   |   Marks: 1
Q50. Numerical: If the calculated distance is 51 cm, approximately what echo duration is implied by the same formula?
Correct Answer: B   |   Marks: 1
Q51. Why is the trigger pin first driven LOW and held for 2 microseconds?
Correct Answer: C   |   Marks: 1
Q52. Which sensor is used in Experiment 7 to measure humidity and temperature?
Correct Answer: C   |   Marks: 1
Q53. Which library is included in the DHT11 program?
Correct Answer: C   |   Marks: 1
Q54. Which pin is assigned to DHT_pin in Experiment 7?
Correct Answer: C   |   Marks: 1
Q55. Which function reads temperature from the DHT11 object?
Correct Answer: C   |   Marks: 1
Q56. Which function reads relative humidity?
Correct Answer: C   |   Marks: 1
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
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
Q59. Why is dht.begin() called in setup()?
Correct Answer: C   |   Marks: 1
Q60. What is the primary purpose of Experiment 8?
Correct Answer: C   |   Marks: 1
Q61. Which Wi-Fi library is included in the ThingSpeak upload program?
Correct Answer: C   |   Marks: 1
Q62. In the program, what does apiKey represent?
Correct Answer: C   |   Marks: 1
Q63. How many fields does the manual state can be used in a ThingSpeak channel?
Correct Answer: C   |   Marks: 1
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
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
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
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
Q68. Which library provides the web server functionality in Experiment 9?
Correct Answer: C   |   Marks: 1
Q69. Which function creates the NodeMCU access point in Experiment 9?
Correct Answer: C   |   Marks: 1
Q70. Which URL path is registered for switching the LED ON?
Correct Answer: C   |   Marks: 1
Q71. Which HTTP status code is sent when a requested page is not found?
Correct Answer: C   |   Marks: 1
Q72. What is the role of server.handleClient() in loop()?
Correct Answer: C   |   Marks: 1
Q73. Numerical: The local IP address in the program is 192.168.2.1. What is the fourth octet?
Correct Answer: C   |   Marks: 1
Q74. If LEDstatus is HIGH when loop() executes, which output command is performed?
Correct Answer: C   |   Marks: 1
Q75. Which HTML action is used by the generated page to request the LED-on route?
Correct Answer: C   |   Marks: 1
Q76. What external service is used in Experiment 10 to tweet sensor data through ThingSpeak?
Correct Answer: D   |   Marks: 1
Q77. Which sensor supplies the temperature and humidity data for Experiment 10?
Correct Answer: D   |   Marks: 1
Q78. Which API endpoint is used in the program to update the ThingTweet status?
Correct Answer: D   |   Marks: 1
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
Q80. Why is client.stop() called after the ThingSpeak request?
Correct Answer: D   |   Marks: 1
Q81. Which function is used to establish the Wi-Fi connection in Experiment 10?
Correct Answer: D   |   Marks: 1
Q82. What does the status text sent to ThingTweet contain in the main program?
Correct Answer: D   |   Marks: 1
Q83. If WiFi.status() never becomes WL_CONNECTED during setup, what does the program's while loop do?
Correct Answer: D   |   Marks: 1
Q84. What is the aim of Experiment 11?
Correct Answer: D   |   Marks: 1
Q85. Which pin is assigned to LEDpin in the Experiment 11 program?
Correct Answer: D   |   Marks: 1
Q86. Which web server class is instantiated in Experiment 11?
Correct Answer: D   |   Marks: 1
Q87. Numerical: The subnet mask shown in the program is 255.255.255.0. How many octets are 255?
Correct Answer: D   |   Marks: 1
Q88. What variable stores the current LED state in the Experiment 11 program?
Correct Answer: D   |   Marks: 1
Q89. If LEDstatus is LOW, which command does the loop execute?
Correct Answer: D   |   Marks: 1
Q90. Why are both ESP8266WiFi.h and ESP8266WebServer.h included?
Correct Answer: D   |   Marks: 1
Q91. Numerical: The server is created as ESP8266WebServer server(80). What port number is used?
Correct Answer: D   |   Marks: 1
Q92. Which platform is used in Experiment 12 as the MQTT server?
Correct Answer: D   |   Marks: 1
Q93. Which protocol is used for communication with the Adafruit IO feed in the given code?
Correct Answer: D   |   Marks: 1
Q94. What is the AIO_SERVERPORT value shown for normal MQTT in the manual?
Correct Answer: D   |   Marks: 1
Q95. Which LED pin is used in Experiment 12?
Correct Answer: D   |   Marks: 1
Q96. What is the purpose of the Light1 subscription object?
Correct Answer: D   |   Marks: 1
Q97. If the subscribed message contains the character '1', what does atoi() make Light1_State become?
Correct Answer: D   |   Marks: 1
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
Q99. What sequence best matches the manual's setup instructions for voice control?
Correct Answer: D   |   Marks: 1
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