ICSE Class 9 Robotics - Experiments & Programs
1. Line Follower Robot
Objective: Design a robot that follows a black line on a white surface.
Materials: IR sensors, Arduino Uno, motor driver (L298N), DC motors, chassis, wheels, jumper wires.
Procedure:
1. Assemble the robot chassis and attach the DC motors.
2. Connect IR sensors to the Arduino's analog pins.
3. Wire the motor driver to the Arduino and motors.
4. Upload the line-following code to the Arduino.
5. Place the robot on a track with a black line and observe its movement.
Expected Output: The robot detects the black line using IR sensors and adjusts its motors to follow the path
accurately.
2. Obstacle Avoidance Robot
Objective: Create a robot that detects and avoids obstacles using ultrasonic sensors.
Materials: Ultrasonic sensor (HC-SR04), Arduino Uno, motor driver, DC motors, chassis, wheels.
Procedure:
1. Mount the ultrasonic sensor on the front of the robot.
2. Connect the sensor to the Arduino's digital pins.
3. Wire the motor driver and motors to the Arduino.
4. Upload the obstacle avoidance code to the Arduino.
5. Test the robot in an environment with obstacles.
Expected Output: The robot moves forward and, upon detecting an obstacle, changes direction to avoid it.
3. Python: LED Blinking
ICSE Class 9 Robotics - Experiments & Programs
Objective: Control an LED to blink at regular intervals using Python.
Code:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
while True:
GPIO.output(18, GPIO.HIGH)
time.sleep(1)
GPIO.output(18, GPIO.LOW)
time.sleep(1)
Expected Output: The LED connected to GPIO pin 18 turns on and off every second.
4. Python: Temperature Sensor Reading
Objective: Read and display temperature data from a sensor.
Code:
import Adafruit_DHT
sensor = Adafruit_DHT.DHT11
pin = 4
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
if humidity is not None and temperature is not None:
print(f'Temp={temperature:0.1f}C Humidity={humidity:0.1f}%')
else:
print('Failed to get reading. Try again!')
Expected Output: Displays the current temperature and humidity readings from the DHT11 sensor.