BTE1522 DRE2213 – Week 8 Rasp Pi – GPIOs, Sensors, and Data Management

Today’s class introduced students to the versatile capabilities of the Raspberry Pi 4 as a single-board computer (SBC). The activities were structured in two sessions to progressively explore its features, bridging concepts from physical computing to data management.

Session 1: Getting Started with GPIOs and Programming Tools

The session began with an overview of the Raspberry Pi 4, highlighting the differences between an SBC and a microcontroller. While microcontrollers like the Raspberry Pi Pico are designed for running simple, specific tasks, SBCs like the Raspberry Pi 4 function as compact computers capable of multitasking, running a full Linux operating system, and supporting a wide range of applications.

Students set up their Raspberry Pi 4 devices, delving into the Linux-based desktop environment. They explored built-in programming tools such as Thonny IDE and Geany, experimenting with writing and running Python scripts.

Key activities included:

    1. Printing “Hello, World!” to the terminal as a warm-up to Python programming.
    2. Controlling LEDs: Students learned to light up an LED and control its state (on/off) using the GPIO pins.
    3. Keyboard-Controlled LEDs: Building on the basics, students wrote scripts to control an LED’s behavior using their computer keyboards, bridging hardware interaction and software logic.

Session 2: Playing with Sensors and Managing Data

The second session focused on the BME280 sensor, an I2C component capable of measuring temperature, pressure, and humidity. Students connected the sensor to the Raspberry Pi, read data from it, and explored ways to handle this information.

The main objectives included:

    1. Understanding how to communicate with I2C devices using Python libraries.
    2. Writing sensor data to a simple text file (.txt) as a database. This exercise demonstrated basic data logging, an essential concept in IoT and data-driven projects.

Crafting the Learning Journey

This week’s exercises were designed to expose students to the diverse features of the Raspberry Pi 4, an exposure in both hardware and software aspects. By the end of the session, students gained hands-on experience in programming, sensor integration, and data management.

Next week, students will build on these concepts by designing a real-time dashboard using Python, incorporating the skills acquired in today’s class to visualize and interact with data. Stay tuned as we continue our journey into the world of Raspberry Pi and digital making!