Skip to content

Final Project

In the past two weeks, I have been fully immersed in my final project, focusing on every aspect from electronics and programming to design models.

Interactive Play Research

Interactive play is a dynamic form of engagement that goes beyond traditional forms of entertainment, encouraging active participation and collaboration. It blends elements of creativity, exploration, and problem-solving, allowing individuals to shape their experiences in real-time. Whether through digital platforms, physical activities, or a combination of both, interactive play fosters social connection, cognitive development, and imaginative expression, making it a powerful tool for learning, entertainment, and personal growth. That is why we chose this theme, as it aligns perfectly with our goal of creating meaningful and engaging experiences.

1- IoT gaming system with generating power energy

2- More-than-Human Game Design: Playing in the Internet of Things

3- Data analytics on interactive indoor cycling exercises with virtual reality video games

4- Augmenting virtual spaces: Affective feedback in computer games

5- Developing the next generation of augmented reality games for pediatric healthcare

Keywords

IoT Video Games Tangible Interaction Intergeneration Cultural Heritage Hyper Physical/Digital IoT Objects Globalization Intent of Toys Edutainment STEM Outdoor play Behavior Change Healthcare

Abstract

The integration of Internet of Things (IoT) technology into various domains has transformed traditional activities and interactions. In the realm of video games, IoT enables seamless connectivity and real-time data exchange, enhancing gaming experiences with tangible interaction and augmented realities. Tangible Interaction allows users to engage with digital content through physical objects, bridging the gap between the digital and physical worlds. This approach is especially impactful in promoting intergenerational engagement, as it encourages participation across different age groups, fostering stronger family bonds and preserving cultural heritage through shared activities and storytelling.

The emergence of Hyper Physical/Digital IoT Objects epitomizes the fusion of physical and digital experiences, creating immersive environments that adapt to user behaviors and preferences. This technological convergence is further propelled by globalization, which broadens the accessibility and distribution of innovative products and services worldwide. In this context, the Internet of Toys has become a significant player, offering interactive and educational experiences that cater to young audiences. These smart toys contribute to edutainment, blending education and entertainment to create engaging learning environments.

The focus on STEM (Science, Technology, Engineering, and Mathematics) education is bolstered by these advancements, as interactive and connected toys stimulate interest and proficiency in these fields from an early age. Additionally, outdoor play is being redefined through IoT-enabled devices that encourage children to explore and learn in natural settings, promoting physical activity and environmental awareness.

IoT technologies also facilitate behavior change by providing real-time feedback and personalized experiences that motivate users to adopt healthier lifestyles and sustainable practices. As the lines between physical and digital worlds continue to blur, the integration of IoT in various sectors holds the potential to revolutionize how we interact, learn, and play, fostering a more connected and enriched global community.

DEEP Research

In our initial research, we found many interesting keywords and chose the five that stood out the most. We then did deeper research on those words and read papers related to them. After that, we brainstormed ideas and worked on combining the key concepts to shape our project.

Kaywords

These keywords drived from previous research papers and been selected from 15 keywords: Intergeneration Cultural Heritage Internat of Toys Outdoor Play Healthcare

1- Developing the next generation of augmented reality games for pediatric healthcare

2- ‘Roots and wings’: an exploration of intergenerational play

3-Motivations and challenges for grandparent–grandchild outdoor play in early childhood

Smart Dama

by YAQOOB

Hot or Cold & BABY AMBER

by FAISAL ALHAMMADI & ABDULLAH JANAHI

Project Idea

After careful consideration, we arrived at the decision to name our project “Hot n Cold”. This project is an engaging interactive game designed to celebrate cultural heritage, suitable for both indoor and outdoor environments. The game revolves around participants using a specially designed indicator device, which guides them as they search for a hidden object. The device responds to the player’s proximity, displaying “hot” when they are getting closer and “cold” when they are moving farther away. This innovative feedback system adds an exciting element of exploration and discovery, encouraging participants to stay actively engaged while learning about cultural heritage in a fun and immersive way. Through this project, we aim to merge technology with tradition, creating a meaningful and interactive experience for all players.

Embedded programming

To turn our idea into reality, we began with the programming phase, conducting thorough research to identify the best method for locating hidden devices. We discovered three potential approaches.

The first option was GPS, which can track a device’s location anywhere in the world. However, it has significant drawbacks: its accuracy is limited to around 10 meters, making it unsuitable for small devices, and it is best suited for outdoor use only.

The second option was Bluetooth beacons, which offer high accuracy and can function both indoors and outdoors. However, their performance is hindered by physical barriers, such as walls, which can jam the signal.

Finally, we explored Wi-Fi signal measurement, which addressed the limitations of both GPS and Bluetooth beacons. Wi-Fi provided the balance we needed—suitable for both indoor and outdoor use, with better precision and fewer interference issues. Based on this, we decided to use Wi-Fi measurement for our project.

We began by programming two ESP32 microcontrollers and integrating an RGB LED as an output device to visually indicate whether the system was functioning properly. Following this, we experimented with various microcontrollers, including the MKR1010 and ESP01, to explore different performance capabilities.

During testing, we encountered an issue where the code was unable to determine when the indicator device was positioned between ranges. To resolve this, we implemented an averaging filter, which helped smooth out fluctuations in signal strength. We then conducted a series of tests to fine-tune the system and define the optimal range for accurate detection, ensuring reliable performance in various environments.

Wi-Fi Strength Measurement

Wi-Fi strength measurement refers to the process of determining the quality and reliability of a Wi-Fi signal at a particular location. This measurement is typically expressed in terms of signal strength, often represented in decibels relative to one milliwatt (dBm). It helps assess how well a Wi-Fi network can support data transmission and connectivity. Common methods to measure Wi-Fi strength include:

  • RSSI (Received Signal Strength Indicator): A metric provided by Wi-Fi adapters indicating the power level of the received signal.

  • dBm: A logarithmic measurement of signal strength; higher values (closer to 0 dBm) indicate stronger signals, while lower values (e.g., -90 dBm) indicate weaker signals.

Tools like Wi-Fi analyzers and signal strength meters on smartphones or laptops are commonly used for these measurements. Wi-Fi strength measurement is crucial for optimizing network performance, troubleshooting connectivity issues, and ensuring reliable wireless communication.

ESP32

Receiver Code

    #include <WiFi.h>

    // Replace with your access point credentials
    const char* ssid = "ReceiverESP32";
    const char* password = "receiverpassword";

    // IP and port of the Transmitter ESP32
    const char* transmitterIP = "192.168.1.100";
    const int transmitterPort = 12345;

    WiFiServer server(80);
    WiFiClient client;

    void setup() {
    Serial.begin(115200);

    // Start Wi-Fi in Access Point mode
    WiFi.softAP(ssid, password);
    Serial.println("Receiver ESP32 started as Access Point");

    // Start UDP client
    client.connect(transmitterIP, transmitterPort);
    if (client.connected()) {
        Serial.println("Connected to Transmitter ESP32");
    } else {
        Serial.println("Failed to connect to Transmitter ESP32");
    }
    }

    void loop() {
    int n = WiFi.scanNetworks(); // Scan for available networks

    if (n > 0) {
        for (int i = 0; i < n; i++) {
        String data = "SSID: " + WiFi.SSID(i) + " | RSSI: " + String(WiFi.RSSI(i));
        Serial.println(data);

        if (client.connected()) {
            client.println(data); // Send data to Transmitter ESP32
        }
        }
    } else {
        Serial.println("No networks found");
    }

    delay(z); // Delay between scans
    }

Transmitter Code

    #include <WiFi.h>

    const char* ssid = "TransmitterESP32";
    const char* password = "transmitterpassword";

    WiFiServer server(12345);

    void setup() {
    Serial.begin(115200);

    // Start Wi-Fi in Access Point mode
    WiFi.softAP(ssid, password);
    Serial.println("Transmitter ESP32 started as Access Point");

    // Start the server
    server.begin();
    Serial.println("Server started, waiting for connection...");
    }

    void loop() {
    WiFiClient client = server.available(); // Check for incoming clients

    if (client) {
        Serial.println("Client connected");

        while (client.connected()) {
        if (client.available()) {
            String line = client.readStringUntil('\n');
            Serial.println(line); // Print received data
        }
        }

        client.stop();
        Serial.println("Client disconnected");
    }
    }

MKR1010 & LED

The code for the Arduino MKR 1010 includes two parts: one MKR 1010 configured as an access point (AP) and another as a client. The AP code sets up a Wi-Fi network with a specified SSID and password, allowing other devices to connect. The client code connects to this AP, measures the Wi-Fi signal strength (RSSI), and uses two LEDs to indicate signal strength: a red LED for strong signals and a blue LED for weak signals. The client continuously monitors the signal strength and updates the LED status accordingly, providing a visual representation of the Wi-Fi signal quality. Adjustments to the threshold values for weak and strong signals can be made based on the specific environment.

Access Point Code

    #include <SPI.h>
    #include <WiFiNINA.h>

    const char* ssid = "MKR1010_AP";
    const char* password = "12345678";

    void setup() {
    Serial.begin(9600);

    // Check for the WiFi module
    if (WiFi.status() == WL_NO_MODULE) {
        Serial.println("Communication with WiFi module failed!");
        while (true);
    }

    // Configure as Access Point
    Serial.print("Setting up Access Point: ");
    Serial.println(ssid);

    int status = WiFi.beginAP(ssid, password);

    if (status != WL_AP_LISTENING) {
        Serial.println("Creating Access Point failed!");
        while (true);
    }

    Serial.println("Access Point created successfully");
    }

    void loop() {
    // AP logic can be added here
    delay(1000);
    }

Client Code

    #include <SPI.h>
    #include <WiFiNINA.h>

    // Define LED pins
    const int blueLedPin = 6;
    const int redLedPin = 7;

    // Wi-Fi credentials
    const char* ssid = "MKR1010_AP";
    const char* password = "12345678";

    // Threshold for signal strength (dBm)
    const int weakThreshold = -70; // Adjust as needed
    const int strongThreshold = -50; // Adjust as needed

    void setup() {
    // Initialize serial communication
    Serial.begin(9600);

    // Initialize LED pins
    pinMode(blueLedPin, OUTPUT);
    pinMode(redLedPin, OUTPUT);

    // Connect to Wi-Fi
    Serial.println("Connecting to Wi-Fi...");
    WiFi.begin(ssid, password);

    // Wait for connection
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("Connected to Wi-Fi");

    // Print the IP address
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
    }

    void loop() {
    // Measure Wi-Fi signal strength
    int32_t rssi = WiFi.RSSI();

    // Print signal strength to Serial Monitor
    Serial.print("Signal Strength (RSSI): ");
    Serial.println(rssi);

    // Control LEDs based on signal strength
    if (rssi >= strongThreshold) {
        // Strong signal
        digitalWrite(redLedPin, HIGH); // Red LED on
        digitalWrite(blueLedPin, LOW); // Blue LED off
    } else if (rssi <= weakThreshold) {
        // Weak signal
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, HIGH); // Blue LED on
    } else {
        // Intermediate signal strength
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, LOW); // Blue LED off
    }

    // Delay before the next measurement
    delay(1000);
    }

ESP32 & LED

Access Point Code

    #include <WiFi.h>

    const char* ssid = "ESP32_AP";
    const char* password = "12345678";

    void setup() {
    Serial.begin(115200);

    // Configure as Access Point
    Serial.print("Setting up Access Point: ");
    Serial.println(ssid);

    WiFi.softAP(ssid, password);

    Serial.println("Access Point created successfully");
    Serial.print("IP Address: ");
    Serial.println(WiFi.softAPIP());
    }

    void loop() {
    // AP logic can be added here
    delay(1000);
    }

Client Code

    #include <WiFi.h>

    // Define LED pins
    const int blueLedPin = 2; // GPIO2 for blue LED
    const int redLedPin = 4;  // GPIO4 for red LED

    // Wi-Fi credentials
    const char* ssid = "ESP32_AP";
    const char* password = "12345678";

    // Threshold for signal strength (dBm)
    const int weakThreshold = -70; // Adjust as needed
    const int strongThreshold = -50; // Adjust as needed

    void setup() {
    // Initialize serial communication
    Serial.begin(115200);

    // Initialize LED pins
    pinMode(blueLedPin, OUTPUT);
    pinMode(redLedPin, OUTPUT);

    // Connect to Wi-Fi
    Serial.println("Connecting to Wi-Fi...");
    WiFi.begin(ssid, password);

    // Wait for connection
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("Connected to Wi-Fi");

    // Print the IP address
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
    }

    void loop() {
    // Measure Wi-Fi signal strength
    int32_t rssi = WiFi.RSSI();

    // Print signal strength to Serial Monitor
    Serial.print("Signal Strength (RSSI): ");
    Serial.println(rssi);

    // Control LEDs based on signal strength
    if (rssi >= strongThreshold) {
        // Strong signal
        digitalWrite(redLedPin, HIGH); // Red LED on
        digitalWrite(blueLedPin, LOW); // Blue LED off
    } else if (rssi <= weakThreshold) {
        // Weak signal
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, HIGH); // Blue LED on
    } else {
        // Intermediate signal strength
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, LOW); // Blue LED off
    }

    // Delay before the next measurement
    delay(1000);
    }

Result

Esp01

Install library, driver, and board for ESP8266

Access Point Code

    #include <ESP8266WiFi.h>

    const char* ssid = "ESP01_AP";
    const char* password = "12345678";

    void setup() {
    Serial.begin(115200);

    // Configure as Access Point
    Serial.print("Setting up Access Point: ");
    Serial.println(ssid);

    WiFi.mode(WIFI_AP);
    WiFi.softAP(ssid, password);

    Serial.println("Access Point created successfully");
    Serial.print("IP Address: ");
    Serial.println(WiFi.softAPIP());
    }

    void loop() {
    // AP logic can be added here
    delay(1000);
    }

Client Code

    #include <ESP8266WiFi.h>

    // Define LED pins (GPIO 0 and GPIO 2 are available on ESP-01)
    const int blueLedPin = 2; // GPIO2 for blue LED
    const int redLedPin = 0;  // GPIO0 for red LED

    // Wi-Fi credentials
    const char* ssid = "ESP01_AP";
    const char* password = "12345678";

    // Threshold for signal strength (dBm)
    const int weakThreshold = -70; // Adjust as needed
    const int strongThreshold = -50; // Adjust as needed

    void setup() {
    // Initialize serial communication
    Serial.begin(115200);

    // Initialize LED pins
    pinMode(blueLedPin, OUTPUT);
    pinMode(redLedPin, OUTPUT);

    // Connect to Wi-Fi
    Serial.println("Connecting to Wi-Fi...");
    WiFi.begin(ssid, password);

    // Wait for connection
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("Connected to Wi-Fi");

    // Print the IP address
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
    }

    void loop() {
    // Measure Wi-Fi signal strength
    int32_t rssi = WiFi.RSSI();

    // Print signal strength to Serial Monitor
    Serial.print("Signal Strength (RSSI): ");
    Serial.println(rssi);

    // Control LEDs based on signal strength
    if (rssi >= strongThreshold) {
        // Strong signal
        digitalWrite(redLedPin, HIGH); // Red LED on
        digitalWrite(blueLedPin, LOW); // Blue LED off
    } else if (rssi <= weakThreshold) {
        // Weak signal
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, HIGH); // Blue LED on
    } else {
        // Intermediate signal strength
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, LOW); // Blue LED off
    }

    // Delay before the next measurement
    delay(1000);
    }

ESP32 for Graphing

    #include <WiFi.h>

    // Define LED pins
    const int blueLedPin = 2; // GPIO2 for blue LED
    const int redLedPin = 4;  // GPIO4 for red LED

    // Wi-Fi credentials
    const char* ssid = "ESP32_AP";  // Replace with your network SSID
    const char* password = "12345678";  // Replace with your network password

    // Threshold for signal strength (dBm)
    const int weakThreshold = -70; // Adjust as needed

    void setup() {
    // Initialize serial communication
    Serial.begin(115200);

    // Initialize LED pins
    pinMode(blueLedPin, OUTPUT);
    pinMode(redLedPin, OUTPUT);

    // Connect to Wi-Fi
    Serial.println("Connecting to Wi-Fi...");
    WiFi.begin(ssid, password);

    // Wait for connection
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("Connected to Wi-Fi");

    // Print the IP address
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
    }

    void loop() {
    // Measure Wi-Fi signal strength
    int32_t rssi = WiFi.RSSI();

    // Print signal strength to Serial Monitor
    //Serial.print("x ");
    Serial.println(rssi);

    // Control LEDs based on signal strength
    if (rssi >= weakThreshold) {
        // Strong signal
        digitalWrite(redLedPin, HIGH); // Red LED on
        digitalWrite(blueLedPin, LOW); // Blue LED off
    } else {
        // Weak signal or no signal
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, HIGH); // Blue LED on
    }

    // Delay before the next measurement
    delay(1000);
    }

ESP01 with averaging filter

    #include <ESP8266WiFi.h>

    // Define LED pins (GPIO 0 and GPIO 2 are available on ESP-01)
    const int blueLedPin = 2; // GPIO2 for blue LED
    const int redLedPin = 0;  // GPIO0 for red LED

    // Wi-Fi credentials
    const char* ssid = "ESP32_AP";  // Replace with your network SSID
    const char* password = "12345678";  // Replace with your network password

    // Threshold for signal strength (dBm)
    const int weakThreshold = -57; // Adjust as needed

    // Averaging filter parameters
    const int numSamples = 6;  // Number of samples for averaging
    int32_t rssiSamples[numSamples];  // Array to store RSSI samples
    int sampleIndex = 0;  // Index to keep track of the current sample

    void setup() {
    // Initialize serial communication
    Serial.begin(115200);

    // Initialize LED pins
    pinMode(blueLedPin, OUTPUT);
    pinMode(redLedPin, OUTPUT);

    // Initialize RSSI samples to 0
    for (int i = 0; i < numSamples; i++) {
        rssiSamples[i] = 0;
    }

    // Connect to Wi-Fi
    Serial.println("Connecting to Wi-Fi...");
    WiFi.begin(ssid, password);

    // Wait for connection
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("Connected to Wi-Fi");

    // Print the IP address
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
    }

    void loop() {
    // Measure Wi-Fi signal strength
    int32_t rssi = WiFi.RSSI();

    // Handle the case when RSSI is 0 (no signal or disconnected)
    if (rssi == 0) {
        // No signal, turn on blue LED and turn off red LED
        digitalWrite(blueLedPin, HIGH);
        digitalWrite(redLedPin, LOW);
        return;  // Exit the loop to avoid further processing
    }

    // Store the new RSSI value in the samples array
    rssiSamples[sampleIndex] = rssi;
    sampleIndex = (sampleIndex + 1) % numSamples;  // Move to the next sample index, wrapping around

    // Calculate the average RSSI value
    int32_t avgRssi = 0;
    for (int i = 0; i < numSamples; i++) {
        avgRssi += rssiSamples[i];
    }
    avgRssi /= numSamples;

    // Print average signal strength to Serial Monitor
    Serial.print("Average Signal Strength (RSSI): ");
    Serial.println(avgRssi);

    // Control LEDs based on the average signal strength
    if (avgRssi >= weakThreshold) {
        // Strong signal
        digitalWrite(redLedPin, HIGH); // Red LED on
        digitalWrite(blueLedPin, LOW); // Blue LED off
    } else {
        // Weak signal
        digitalWrite(redLedPin, LOW);  // Red LED off
        digitalWrite(blueLedPin, HIGH); // Blue LED on
    }

    // Delay before the next measurement
    delay(1000);
    }

Electronics

Circuit Diagram

ESP01 Programming Circuit

alt text

ESP01 Utilizing Circuit

alt text

Indicator Connection Circuit

alt text

Materials

Qty Description
1 ESP32
4 ESP01
5 3.7V AAA battery
4 RGB LED
5 Switch
1 Buzzer
1 Wires
5 AAA Battery holder

2D and 3D Modeling

3D PRINTING

We designed two custom containers to house the electronics. The container for the hidden device was shaped to resemble a bomb switch, adding an element of intrigue and making it visually distinct. For the indicator device, we opted for an arrow-shaped design, symbolizing guidance and direction, making it intuitive for participants to follow. These designs not only serve a functional purpose but also enhance the overall thematic experience of the game.

prototypes

Indicator device

Hidden device

final designs

Indicator device

Hidden device

laser cutting

We used a laser cutting machine to precisely cut the cover for the indicator device from an acrylic sheet, ensuring a sleek and durable design. Additionally, we cut a small rectangular piece from an acrylic diffuser sheet, which was specifically used to soften and evenly distribute the LED light, enhancing the visibility and aesthetic of the device. These elements contributed to both the functionality and the polished look of the final product.

alt text

alt text

Download Indicator’s Cover

Download defuse rectangle

molding & casting

To decorate our indicator device, we added resin castings for a creative touch. The top half featured a flame design to represent “hot” when the player is closest, while the bottom half had snowflakes to indicate “cold” when they are farthest away. This added a visual element that matched the theme of the game, enhancing both its appearance and functionality.

Review

alt text

COMMENT

Throughout the development of our final project, we gained valuable experience in conducting thorough and professional research, as well as learning how to effectively utilize various machines to transform our ideas into reality. This journey taught us not only the technical aspects of creating a project but also the importance of teamwork and collaboration. We had a lot of fun working together, sharing ideas, and problem-solving as a team. One of the most significant lessons we learned is that mistakes are a natural part of the process. Every project comes with its own set of challenges, but what truly matters is not giving up. Persistence, resilience, and a willingness to learn from setbacks are essential in bringing any idea to completion. This mindset helped us stay focused and motivated, ensuring we pushed through to the finish line.


Last update: September 12, 2024