Raspberry Pi Laboratory Manual
Official interactive student guide for the NIELIT Raspberry Pi Practical Courseware. Featuring 20 hands-on experiments across digital GPIO, sensors, motor control, LCD displays, SPI/I2C buses, SQLite telemetry, and Cloud IoT messaging.
20
Total Practicals
10+
Reusable Library Modules
BCM
Standard GPIO Scheme
100%
Mocked CI Test Coverage
Interactive 40-Pin GPIO Header Pinout
Hover over any pin to check which practicals utilize it. Click any pin for detailed electrical specifications.
3.3V Power
5V Power
Ground (GND)
GPIO (General)
I2C Bus
SPI Bus
UART Serial
📦 Reusable Library API Reference (nielit_rpi)
Students and instructors can import these production-quality abstraction classes into their own custom projects.
from nielit_rpi.gpio import LEDController(pin: int)
Controls single-pin digital output. Methods:
on(), off(), toggle(), blink(on_time, off_time, n), property is_lit. Context-manager enabled.from nielit_rpi.gpio import ButtonReader(pin: int, pull_up: bool = True, bounce_time = None)
Reads digital inputs with software debounce. Callbacks:
when_pressed, when_released, property is_pressed.from nielit_rpi.gpio import PWMLEDController(pin: int, frequency: int = 100)
Controls perceived brightness and pulsing. Properties:
value (0.0 to 1.0), methods: pulse(), fade_in(), fade_out().from nielit_rpi.sensors import UltrasonicSensor(trigger_pin: int, echo_pin: int, max_distance: float = 4.0)
HC-SR04 distance measurement. Properties:
distance_cm, distance_m, method: in_range(threshold_cm).from nielit_rpi.sensors import DHTSensor(pin: board.Pin, sensor_type: str = "DHT11")
Reads ambient climate. Method:
read() -> tuple[temp, humidity] with automatic checksum retry handling.from nielit_rpi.actuators import ServoController(pin: int, min_angle=-90, max_angle=90)
Positions SG90 servo motor. Property:
angle (-90° to +90°), methods: sweep(), detach().from nielit_rpi.displays import I2CLCD(address: int = 0x27, bus_number: int = 1)
Controls 16x2 HD44780 LCD via PCF8574. Methods:
write_string(text, line), clear().from nielit_rpi.storage import SensorDataLogger(db_path: str, table_name: str)
SQLite telemetry store. Methods:
create_table(columns), log_reading(**kwargs), get_readings(limit), execute_query(query, params).⚡ Essential Laboratory Safety Rules
3.3V Logic Limit: Raspberry Pi GPIO pins operate strictly at 3.3V logic. NEVER connect a 5V sensor output or signal directly to a GPIO pin without a resistor voltage divider or logic level shifter.
Motor & Inductive Loads: Servos and high-power motors draw heavy current surges. Power them from an external 5V supply sharing a common Ground with the Pi. Do NOT power them from the Pi 3.3V rail.
Mains Isolation: Relays in educational practicals should only switch low-voltage DC loads (e.g. 12V lamps). Never handle 110V/230V AC mains electricity on an open breadboard.