BTE1522
DRE2213








The world is digital, but life is analog..
BTE1522
DRE2213








Onboarding, Pre Survey, Basic Concepts in Python Programming. Game Canvas, Snake Creation.
Have a shot – Play With It
This week, we started building the foundation for our programming journey. Before we can create a complete game or work with sensors, we first need to understand how to communicate with a computer through code.
Setting Up: Thonny and Our First Game Window
We began by setting up Thonny as our Python programming environment and getting our first game window running.
Along the way, we explored an important concept for game development: coordinates and pixels.
A screen can be thought of as a coordinate system where the position of an object is represented using values such as X and Y. Understanding coordinates will become increasingly important as we start moving our game objects in the coming weeks.
We also had our first look at colour representation using RGB values, which allows us to define colours digitally.
Step 1: Building Through a Tiered Activity
After completing Step 1, we moved into our first hands-on activity using the Fill-in → Debug → Extend → Create progression:
Alongside these activities, we also included:
The idea is simple: don’t just make the code run—understand what you are doing.
Programming Is Like Talking to a Computer
Learning programming is, in many ways, like learning how to communicate or give instructions to a computer.
Computers are very precise. They follow the instructions we provide, but they do not automatically understand what we meant.
This week, you may have already noticed some important characteristics of Python:
These may seem like small details, but they form the basic “language rules” we need to follow when communicating with a computer.
A First Look at the Command Line
You may also have noticed that we started using CMD / Command Prompt when installing Python libraries.
This is another important skill.
Programming is not only about writing code inside Thonny. As we progress, you will encounter different tools and environments for installing libraries, running programs, and interacting with your development environment.
So, don’t be afraid of the command line! ????
What’s Next?
For next week, we will continue our journey with Step 2 and Step 3 of the game development.
We will gradually introduce more programming concepts while continuing to build our game.
Remember:
Don’t rush to finish the game. Focus on understanding the code as you build it.
Important: Activity 1 Submission
Please make sure you submit Activity 1 through the web platform.
I will be referring to your Activity 1 submission for class attendance, so please make sure it is completed and submitted.
See you in Week 2!
Keep coding, keep debugging, and keep asking: “Why does this code work?”











Hi everyone,
A warm welcome to all BTE1522 – Innovation and DRE2213 – Programming and Data Structure students!
This semester, we are bringing a refreshed approach to learning programming. Both courses are designed to build your competencies in Python programming, innovation, and data structures—but instead of learning programming only through examples and exercises, we will be building, experimenting, troubleshooting, and making things work.
Phase 1: Learn Python by Building a Snake Game
We will begin with something familiar and fun: a Snake game.

As you build the game step by step, you will encounter and apply Python concepts such as:
The game is not simply the end product. The code is the learning environment.
When something does not work, you will troubleshoot it. When the snake behaves unexpectedly, you will investigate why. When you modify the game, you will need to understand what the existing code is doing.
That is where programming starts to make sense.
Phase 2: From Digital to Physical – Meet LilEx
Once we have built our programming foundation, we will move from the digital world into physical computing.
I am excited to introduce LilEx – the sensor node to the class.

Here, you will begin working with real sensors and real data.
You will learn how to:
SENSE → STORE → VISUALISE
You will read data from sensors, process and structure the data, store it in a database, and eventually present it through a dashboard.
This is where Python moves beyond the screen.
Your program will no longer simply move a character on a game window. Your code will interact with the physical world.
And What About AI?
Yes, you could ask AI to generate the Snake game.
You could also ask AI to generate the sensor code, database, and dashboard.
But that is not the main purpose of this semester.
For this phase of your learning, we will intentionally focus on developing the fundamental competencies step by step, without AI assistance during class activities.
Why?
Because I want you to experience the process of thinking through the code.
When you eventually use AI for a larger project, you should be able to look at the generated code and ask:
What does this code actually do?
Why does it work?
Is this the right solution?
How can I modify it?
That is very different from simply copying and running AI-generated code.
Code with AI, not code by AI.
AI can become a powerful learning and development partner—but first, we need to build the foundation that allows us to work with AI intelligently.
So, Welcome Aboard!
This semester will be about more than learning Python syntax.
It will be about building competency through making:
Learn → Build → Break → Troubleshoot → Understand → Improve → Create
From a Snake game to LilEx sensor-based systems, we will gradually move from digital programming to physical computing, data structures, IoT, and dashboards.
I am excited to have both BTE1522 and DRE2213 on board this semester.
Let’s learn, build, experiment—and see where your ideas take us.
Welcome to the class!
*UMPSA STEM Lab Raspberry Pi Programming Synopsis can be found here.
In the Raspberry Pi IoT session, 24 UMPSA mentors were introduced to the concept of the Internet of Things (IoT) using Raspberry Pi on the UMP STEM Cube, a pico-satellite learning kit specifically designed to facilitate engineering learning.
The content covered basic digital input/output operations on onboard LEDs, as well as topics such as dashboard design using gyro meter and BMU280 sensor data, including collecting and storing data in a cloud database. Participants learned to interface sensors with Raspberry Pi boards and develop IoT applications for real-world scenarios. The session provided students with valuable insights into IoT technology and its applications in various domains.
A special appreciation is extended to En Mohd Jamil Jaafar for coordination in facilitating communication between the participants and the UMPSA STEM Lab :).

















I recently attended a sharing session by Prof Hilman on research and teaching technology in Electronic Engineering, and it left a strong impression, particularly in terms of how much care and thought he puts into his teaching.
What stood out most was Prof Hilman’s creativity and long-term commitment to his classroom. Over the years, he has developed a series of learning kits that are used across different levels of the programme, from first year right up to final year. These kits are not one-size-fits-all; instead, they are modular, covering topics ranging from analog electronics and RF to sensor design. You can clearly see that they were built with progression in mind, allowing students to grow into the complexity of the subject rather than being overwhelmed by it.
Having developed teaching kits myself, mainly for mini robotics, embedded systems, and IoT, I found myself very much on the same page. Designing kits for teaching is rewarding, but it also comes with its own set of challenges, especially when it comes to deciding how much to give students and how much to leave for them to figure out on their own.
When I talk about “giving everything,” I’m referring to situations where kits / modules that are highly prepared: dedicated PCBs, predefined functional blocks, and ready-to-use modules. This certainly helps students get started more quickly and reduces frustration. At the same time, we sometimes forget that designing those things, like laying out a PCB or deciding how a circuit or functions (in software programming) should be structured, is also an important part of learning.
On the other end of the spectrum is giving students only the bare minimum and expecting them to build everything from scratch. While this can be very powerful for learning, it is not always easy to manage in a real classroom. Students learn at different speeds, and ensuring that everyone can keep up within a fixed semester timeline can be quite challenging.
This is something I’ve often thought about through the lens of the white‑box versus black‑box approach, which I also discussed in my earlier works on tiered scaffolding approaches in Python Slider Game and the STEMCube platform. Both approaches have their place, and the real question is how to strike the right balance.
During the session, I raised this question with Prof Hilman, and we had a good discussion around it. What I found particularly insightful was his view that modularity helps bridge the gap between these two extremes. By designing kits in modules, we can decide which parts are “given” and which parts students are encouraged to develop themselves. As students progress, more of the system can be opened up to them. This makes the learning process more flexible and helps accommodate different learning paces within the same class.
We also touched briefly on the role of AI in analog design, especially during the early design and optimisation stages. While still an evolving area, it sparked an interesting discussion about how such tools might eventually support both teaching and research in electronics engineering.
Overall, the session was a good reminder that effective teaching innovation doesn’t come from choosing one extreme over another, but from carefully designing learning experiences that evolve with students. Prof Hilman’s modular approach is a practical example of how this balance can be achieved, and it’s certainly something I will continue to reflect on in my own teaching practice.
Nurul – March 9th



Well done everyone!
Students from BTE 1522 and DRE2213 presented their final projects, and the outcomes were impressive =).
What began at the start of the course as an introduction to beginner Python programming through a simple Pygame slider game (Pygame assignments) has now evolved into fully functional sensor-based systems using Raspberry Pi and the BME280 environmental sensor.
This transition from a purely digital game environment to a real-world, physically embedded system, was intentional =).
By first grounding students in Python fundamentals (variables, loops, conditionals, event handling, and logic flow) through game development, students were able to focus later on how their code interacts with the physical world.
Learning Python Through Motion, Data, and Innovation: BTE1522 Project Showcase
Students from BTE1522 – Innovation (Python) recently presented their final projects, and the results clearly demonstrated how hands-on, sensor-driven learning can elevate Python programming skills.
In this course, students worked with the MPU6050 motion sensor on the LilEx 5 platform, moving beyond basic scripting to build end-to-end data-driven systems involving sensing, storage, and visualization.
Project Focus
Each student group was tasked to:
Read motion data from the MPU6050 using Python
Design and conduct structured data collection for different human movements
Store the data in a database of their choice
Build a dashboard to visualize and interpret the collected data
This workflow mirrors real-world IoT and data engineering pipelines.
Movement-Based Data Collection
Students collected sensor data based on well-defined criteria, including:
Standing
Leaning left and right (roll)
Bending forward and backward (pitch)
Lying down
They carefully controlled parameters such as:
Sampling rate
Timeframe per movement
Sensor placement
Calibration procedures
This encouraged students to think critically about data quality, consistency, and repeatability, not just code correctness.
Using Python, students transformed raw accelerometer and gyroscope readings into structured datasets. They then explored different tools and platforms to:
Build databases
Create dashboards for visualization and interpretation
Through this process, students learned that innovation is not only about building something new, but also about making data understandable and useful.
Physical Embodiment as a Learning Strategy
Similar to DRE2213, this course emphasized learning through physical embodiment. Students could directly observe how body movement affected sensor readings, reinforcing their understanding of:
Coordinate axes
Sensor fusion concepts
Time-series data behavior
By linking physical motion to Python code and visual dashboards, abstract programming concepts became concrete and intuitive.
Overall, student performance was very satisfying. Good job everyone.
The projects demonstrated strong engagement, creativity, and a growing confidence in Python programming.
The project videos embedded below highlight how students applied Python not just as a programming language, but as a tool for sensing, data analysis, and innovation.
In their final projects, DRE2213 students successfully demonstrated:
Closed-loop sensing systems
Integrating the BME280 sensor with Raspberry Pi using Python, where sensor readings triggered real-time responses such as LEDs and buzzers.
Data logging and storage
Students independently explored multiple database solutions:
Firebase
Google Sheets / Spreadsheet-based logging
This showed strong initiative and adaptability beyond what was explicitly taught.
Dashboard development and visualization
A wide range of dashboard approaches were implemented, including:
HTML-based dashboards
Adafruit IO
Flask web applications
Streamlit dashboards
Each solution reflected different design choices, yet all achieved the same goal: making sensor data meaningful, visible, and interactive.
https://youtube.com/shorts/KYIy1CRj6Nk?si=2cHH3TGO1eFjDp9y
https://www.youtube.com/shorts/KYIy1CRj6Nk
https://youtube.com/shorts/KYIy1CRj6Nk?si=2cHH3TGO1eFjDp9y
What stood out most was how BTE1522 and DRE2213 students connected abstract Python code to tangible outcomes. Seeing a buzzer activate, an LED respond, or a dashboard update in real time helped students understand what their code is doing, not just whether it runs.
This combination of:
Digital embodiment (game-based learning with Pygame), and
Physical embodiment (real sensors, real data, real feedback)
proved to be a powerful approach in helping students grasp programming concepts more deeply and confidently.
The quality of the projects and the variety of technical approaches exceeded expectations. Students demonstrated not only programming skills, but also problem-solving, system integration, and creativity.
The embedded project videos below showcase their work and reflect a learning journey that truly bridges Python programming and real-world applications.
Nurul Hazlina – Feb 4th

Today students from BHE 25/26 I participated in a hands-on programming training session designed to make learning Python both engaging and intuitive. The session ran from 8:30 AM to 12:45 PM and combined game-based learning with practical tool setup for future advanced applications.
The training introduced students to core programming concepts through an interactive Slider Game, followed by the installation of Visual Studio Code (VS Code) to prepare them for more advanced work in image and data processing.

Session 1: Learning Python Basics Through the Slider Game
Time: 8:30 AM – 12:30 PM
Instead of starting with abstract syntax and long code examples, students learned Python fundamentals by building and modifying a simple Slider Game. This approach allowed concepts to emerge naturally through interaction and experimentation.
Through guided activities, students progressively explored:
Variables – storing and updating player positions, scores, and timers
Mathematical operations – controlling movement speed, scoring, and boundaries
Control structures (loops & conditionals) – managing enemy movement, collisions, and game flow
Event handling – responding to keyboard inputs for real-time player control
Data structures – using lists to manage multiple enemies and game objects
Functions – organizing code for clarity and reusability
Debugging and logical thinking – testing, observing outcomes, and refining logic







By the end of the session, students were not just reading code—they were seeing their code come alive on the screen.



Learning by Seeing and Doing: Digital & Physical Embodiment
A key strength of the Slider Game approach is embodied learning. As students interacted with the game—moving the player, triggering collisions, or adjusting timing—they could immediately visualize the effect of each programming concept.
This form of digital embodiment supports deeper understanding:
Students test hypotheses by changing values and logic
Immediate visual feedback reinforces correct reasoning
Errors become learning opportunities rather than frustrations
By observing how their code directly influences game behavior, students developed stronger intuition about how programming logic works in real systems.


Session 2: Preparing for Advanced Applications
Time: 12:30 PM – 12:45 PM
In the final segment, students were guided through the installation and setup of Visual Studio Code (VS Code)—a widely used development environment for professional and academic programming. This is as part of their preparation for their upcoming flying professor’s class in March 2026.
This step prepares students for:
Advanced Python development
Image processing and computer vision
Data analysis and visualization
Future projects involving AI and intelligent systems
Introducing VS Code early helps students transition smoothly from learning concepts to building more complex, real-world applications.



This training demonstrated that game-based and embodied learning can significantly enhance how students grasp programming fundamentals. By combining interaction, visualization, and hands-on practice, students build confidence, curiosity, and problem-solving skills—key foundations for future work in computing and engineering.
Moving forward, similar sessions will continue to explore how interactive digital environments and intelligent scaffolding can further support meaningful learning in programming education.
Further UMPSA STEM Lab work on Slider Game and Digital Embodiment can be accessed here.
Bringing Python, IoT, and Physical Computing Together =)..
Today’s class marked an important milestone for DRE2213 – Programming and Data Structure, as students presented their final projects developed using Raspberry Pi and Python, with a strong focus on environmental sensing using the BME280 sensor. The SULAM session showcased not only technical competence, but also how far the students have progressed in applying programming concepts to real-world systems – in Perpustakaan UMPSA Pekan Monitoring System.
I am truly impressed by the level of achievement demonstrated by the students. Each group successfully implemented a complete IoT-based system, covering three essential components of modern embedded and data-driven applications.
1. Closed-Loop Sensor Integration
Students demonstrated their ability to build closed-loop systems by interfacing the BME280 temperature, humidity, and pressure sensor with the Raspberry Pi. Based on predefined threshold values, the system was able to trigger actuators such as LEDs and buzzers, reinforcing key concepts in sensor reading, decision-making logic, and control flow in Python.
Another highlight was the diversity in data management approaches. Some groups opted for cloud-based databases such as Firebase, while others used Google Sheets or local storage solutions. This exposed students to different data structures, data persistence methods, and practical considerations in handling sensor data over time.
Students also demonstrated creativity and flexibility in building dashboards to visualize sensor data. A wide range of tools were used, including:
HTML-based dashboards
Adafruit IO
Flask web applications
Streamlit dashboards
This variety reflects students’ growing confidence in selecting appropriate tools and frameworks to communicate data effectively.
From Games to Physical Systems – A Meaningful Learning Journey
At the beginning of this course, students were introduced to Python programming through a slider game developed using Pygame. This approach allowed them to grasp fundamental programming concepts—such as variables, loops, conditionals, and functions—within a digital and interactive environment.
As the course progressed, students transitioned from digital game development to physical computing projects, applying the same programming principles to real hardware and sensors. This combination of digital embodiment (game development) and physical embodiment (IoT systems) provided a strong foundation for understanding how software interacts with the real world.
Learning programming in an interactive and hands-on manner enables students to truly understand what their code is doing. Instead of writing abstract programs, they can see, hear, and measure the outcomes of their code—whether it is a game reacting to user input or a sensor triggering a buzzer based on environmental conditions.
Closing Reflections
Today’s presentations clearly demonstrated that interactive, project-based learning is an effective way to teach programming and data structures. By engaging with both digital and physical systems, students developed not only technical skills but also problem-solving confidence and design thinking.
Well done to all DRE2213 students on your excellent work. Your projects reflect strong effort, creativity, and meaningful learning. Keep building, keep experimenting, and keep pushing the boundaries of what you can create with Python and Raspberry Pi.












Good
Good =)
This week, Week 11, we reached an important milestone in the IoT learning journey. Building upon the foundations established in Weeks 9 and 10, this week’s activity focused on visualising sensor data through dashboards, using two different approaches:
A cloud-hosted dashboard using Adafruit IO
A self-hosted dashboard using HTML served directly from the Raspberry Pi Pico W (LilEx3)
By the end of this session, you no longer just reading sensors — but you’ve design a complete IoT data pipelines, from sensing to networking to visualisation.
This week is we transit our attention from collecting data to presenting data.
Using the BME280 environmental sensor, you are able to work with:
Temperature
Humidity
Atmospheric pressure
The same sensor data was then visualised using two different dashboard approaches, highlighting important design choices in IoT systems.
Approach 1: Cloud Dashboard Using Adafruit IO – Refer to Act 7 in TINTA and Google Classsroom
This method introduces students to cloud-based IoT platforms, a common industry practice.
Key concepts:
WiFi connectivity
MQTT protocol
Publishing data to a third-party server
Remote access and visualisation


Code Explanation (Adafruit IO Method)
Imports modules for hardware control, networking, MQTT communication, and the BME280 sensor.
Initializes the I2C bus and the BME280 sensor.
Connects the Pico W to a WiFi network.
Configures the MQTT client for communication with Adafruit IO.
Reads sensor values and publishes temperature data to the cloud dashboard.
This approach shows how sensor data can be accessed anywhere in the world, but depends on external services and internet connectivity.


Approach 2: Self-Hosted HTML Dashboard on Pico W
This method shifts learning toward edge computing and embedded web servers.
Key concepts:
HTTP client–server model
Serving HTML from a microcontroller
JSON data exchange
JavaScript-based live updates
Local network dashboards

Code Explanation (HTML Dashboard Method)
Enables the Pico W to act as a web server.
Stores the dashboard webpage directly in Python memory.
Starts an HTTP server on port 80.
Distinguishes between:
Page requests (/)
Data requests (/data)
Reads temperature, humidity, and pressure in real time.
JavaScript on the webpage periodically requests new sensor data and updates the display without refreshing the page.
This approach emphasizes system integration, where the device itself becomes the dashboard — similar to ground stations and embedded monitoring panels.

Comparing Both Dashboard Approaches
| Feature | Adafruit IO | HTML on Pico W |
|---|---|---|
| Hosting | Cloud | Local (device) |
| Internet required | Yes | Local WiFi only |
| Protocol | MQTT | HTTP |
| Complexity | Lower | Higher |
| Control | Limited | Full |
| Educational value | Intro to IoT cloud | Full-stack IoT |
Both approaches are valuable, and understanding when to use each is an important engineering skill.
Bringing It All Together
By connecting:
Weeks 9 & 10 (MPU6050 motion sensing & data logging)
Week 11 (IoT dashboards and networking)
you are now capable of:
Interfacing multiple sensors
Logging and processing data
Transmitting data over networks
Designing dashboards (cloud and local)
Building complete IoT systems
At this stage, you are no longer following isolated tutorials, but are now ready to design and execute their own IoT projects.










