NEW
Font size
S
M
L
XL
WorksheetsPIF-Quiz Week 5 B
Total questions: 15
Worksheet time: 5mins
Name
Class
Date
1.
You want to turn on a ventilation fan when the temperature inside the greenhouse exceeds 30°C. Which of the following code snippets is the most appropriate?
a)
if (temperature < 30) { digitalWrite(fanPin, HIGH); }
b)
if (temperature > 30) { digitalWrite(fanPin, HIGH); }
c)
if (temperature == 30) { digitalWrite(fanPin, LOW); }
d)
if (temperature != 30) { digitalWrite(fanPin, LOW); }
2.
You are using a soil moisture sensor that outputs an analog value. Which Arduino function should you use to read the sensor data?
a)
digitalRead()
b)
analogRead()
c)
pinMode()
d)
digitalWrite()
3.
You want to connect a water pump to your Arduino. Since the pump operates at a higher voltage than the Arduino can provide, which component should you use?
a)
Resistor
b)
Capacitor
c)
Transistor
d)
Relay module
4.
You want to display the temperature and humidity readings on an LCD screen. Which Arduino library should you include in your code?
a)
Servo.h
b)
LiquidCrystal.h
c)
Wire.h
d)
SPI.h
5.
You want to automatically turn on the grow lights at 7:00 AM every day. Which Arduino module can help you achieve this?
a)
Ultrasonic sensor
b)
Real Time Clock (RTC) module
c)
GPS module
d)
Bluetooth module
6.
You notice that your water pump is running continuously, even when the soil moisture level is high. Which of the following could be a possible cause of this problem?
a)
Faulty soil moisture sensor
b)
Incorrect wiring
c)
Error in the code
d)
All of the above
7.
You want to store the temperature and humidity readings in an array for later analysis. Which data type should you use for the array?
a)
char
b)
int
c)
float
d)
boolean
8.
You want to create a function to calculate the average temperature over a certain period. Which keyword should you use to indicate that the function will return a floating-point value?
a)
void
b)
int
c)
float
d)
double
9.
You want to use a switch...case statement to control different actions based on the water level in the reservoir. Which variable type is most suitable for the switch expression?
a)
float
b)
boolean
c)
int
d)
char
10.
You want to continuously monitor the soil moisture level and turn on the water pump only when the moisture level drops below a certain threshold. Which loop structure is most appropriate for this task?
a)
for loop
b)
while loop
c)
Both a and b
d)
Neither a nor b
11.
You want to send an alert to your smartphone when the temperature exceeds a critical level. Which of the following communication modules can you use?
a)
Wi-Fi module
b)
Bluetooth module
c)
GSM/GPRS module
d)
All of the above
12.
You want to measure the light intensity using a photoresistor. Which circuit configuration should you use?
a)
Connect the photoresistor directly to a digital pin.
b)
Connect the photoresistor in series with an LED.
c)
Use the photoresistor as part of a voltage divider circuit connected to an analog pin.
d)
Connect the photoresistor to the Arduino's power supply.
13.
You want to improve the readability of your code. Which of the following practices can help you achieve this?
a)
Use meaningful variable names.
b)
Add comments to explain the code.
c)
Use proper indentation.
d)
All of the above.
14.
You want to create a timer interrupt that triggers a specific action every 5 seconds. Which Arduino library should you use?
a)
Servo.h
b)
LiquidCrystal.h
c)
Wire.h
d)
MsTimer2.h
15.
You want to ensure that your greenhouse environment control system is energy-efficient. Which of the following strategies can help you achieve this?
a)
Use low-power components.
b)
Implement sleep modes for the Arduino.
c)
Optimize the code to reduce unnecessary operations.
d)
All of the above.
Reset
