Skip to content

πŸ”˜ Mini Project β€” IoT Button System

This tutorial walks you through building a small end-to-end IoT system: a physical button connected to an Arduino board that communicates with a cloud backend hosted on Amazon Web Services.

By the end, you will have a working IoT pipeline from a physical button press to cloud-side logic and back.

sequenceDiagram
    box Edge Device
        participant PB as Push Button
        participant L as LED
        participant A as Arduino
    end

    box AWS Cloud
        participant I as AWS IoT Core
        participant R as Lambda: run_backend
        participant T as Lambda: get_time
    end

    PB->>A: Button pressed
    A->>L: LED off

    A->>I: MQTT Publish\nTopic: arduino/outgoing\nPayload: { timezone_offset }

    I->>R: IoT Rule triggers run_backend\n(event payload forwarded)

    R->>T: Call get_time(timezone_offset)
    T-->>R: Return { minutes }

    R->>I: MQTT Publish\nTopic: arduino/inbound\nPayload: { minutes }

    I->>A: Deliver MQTT message\nTopic: arduino/inbound\n{ minutes }

    A->>L: Blink LED N times\n(N = current minute)

    A->>L: LED on

🎯 Main objectives β€” build the backbone of an IoT cloud system

  • Build a complete system using an Arduino, MQTT, AWS IoT Core, and AWS Lambda.
  • Publish and subscribe to MQTT topics (arduino/outgoing, arduino/inbound).
  • Trigger a Lambda function from an IoT rule and process cloud-side logic.
  • Send data back to the device and translate it into a physical action (LED blinking).
  • Understand the full edge β†’ cloud β†’ edge communication loop.

These are exactly the building blocks β€” an edge device, connectivity, and a cloud backend β€” that the Smart Supermarket IoT system will be built on, just at group scale.

🀝 Secondary objectives β€” tools and workflow for collaborative programming

  • Practice the collaborative git workflow you'll rely on as a group: feature branches, pull requests, code review, and version tags (see Development Workflow).
  • Version the project using Git and GitHub.
  • Develop embedded firmware using PlatformIO and Visual Studio Code instead of the Arduino IDE.
  • Apply good security practices (secrets files, IAM users and roles, secure MQTT policies).
  • Structure a multi-component system clearly.

πŸ—ΊοΈ Structure of the tutorial

Warning

IoT systems mix hardware, firmware, networking, and cloud infrastructure. When something does not work, the issue could be anywhere. If you connect everything at once, debugging quickly becomes painful.

Thus, this tutorial follows a strict order:

  1. Make the hardware work.
  2. Make the device talk to your computer.
  3. Make it connect to the Internet.
  4. Make it talk to AWS.
  5. Add backend logic in the cloud.
  6. Visualize the data on a dashboard.

Take the tasks in order. Do not move on until the current step behaves exactly as expected. That discipline is what makes larger systems manageable.

πŸ“š Mini project structure

The mini project is split over three sessions. Each session has a Lecture Notes page covering the background you need, followed by one or more hands-on Task pages.

Session Lecture Notes Tasks
Session 1 Embedded systems, firmware, and PlatformIO Task 1 β€” Building and testing the edge device
Session 2 Networking, MQTT, and AWS IoT Core Task 2 β€” Connecting the edge device to the internet, Task 3 β€” Connecting the edge device to AWS IoT Core
Session 3 Serverless backends with AWS Lambda Task 4 β€” Building the system backend with AWS Lambda, Task 5 β€” Creating a dashboard on AWS

Before you start, follow the Getting Started guide to set up your tools and clone the project.

πŸ… Grading

Having each pull request marked Ready for review on time is worth 10% of your mini project grade β€” 2% per task (5 tasks Γ— 2%).

A review does not require your implementation to work β€” it just requires that you asked for one in time. A review can either:

  • confirm that your implementation works as expected, or
  • explain that it doesn't, while providing enough information to help you troubleshoot it.