Tutorial Sheet for Ardunio and sensor (1)
Tutorial Sheet for Ardunio and sensor (1)
Class Work
----------------------------------------------------------------------------
Question2. Use an LDR sensor with an Arduino to turn on an LED when it gets dark (i.e., when
the LDR value falls below a certain threshold). Write the code for this application.
Question3.- How can you use an IR sensor to count the number of objects passing through a
detection zone? Write the code to implement this functionality.
void setup()
Serial.println(objectCount);
delay(100); // Small delay to avoid multiple detections from the same object }
Home Assignment
Q1. Write an Arduino program using IR sensor
i) In case detects movement then display “outsider in the park”
ii) In case movement not detected then display “park is safe”
“In case 1: LED will glow RED”. And “ in case 2 : LED will be off.”
Q2. Explain how to interface an LDR with an Arduino UNO to measure the intensity of light
and print the value on the serial monitor.
Q3: Write down a program to interface Arduino with Ultrasonic Sensor.
Q4. Explain how to interface a DHT11 temperature and humidity sensor with Arduino UNO
and write a program to read and display the temperature on the serial monitor.