meta data for this page
  •  

This is an old revision of the document!


Team DAMP

Use this template to document your progress! (Add notes anywhere you deem necessary)

1. Group Introduction

2. Initial brainstorming ideas/concepts

Hackathon Ideation Summary – Initial Project Exploration

We began the ideation process by exploring IoT-based solutions that focus on changing individual behavior to promote sustainability, accessibility, and well-being. We explored several IoT-based concepts that aim to nudge individuals toward sustainable, healthy, and inclusive behaviors, using a combination of sensors, actuators, for IoT tools. Below are the documented ideas from our brainstorming process:

🚿 Smart Bath / Water Control System

  • Goal: Reduce water and energy waste by encouraging shorter, more efficient showers.
  • What it’s about: This system monitors shower duration using steam and temperature sensors. It gives real-time feedback using buzzers, RGB lights, or LCD messages when a user exceeds optimal limits. The aim is to build awareness of water usage and promote sustainable bathing habits.
  • Behavioral Nudge: Timed alerts and eco-scores after each shower encourage users to reduce consumption over time.
  • Uses:
    • Steam and temperature sensors to track shower duration and frequency.
    • Real-time nudges (via buzzer, RGB lights, or LCD display) when limits are exceeded.
    • Eco-feedback or daily stats to reward water-efficient behavior.

🌱 Sustainability Coach – In-Room Behavioral Monitoring

  • Goal: Help individuals become more energy-conscious in their personal spaces.
  • What it’s about: This system acts as a digital coach inside a user’s room. It monitors air conditioning use, artificial lighting, fan activity, and motion detection to identify unnecessary resource consumption. Feedback is delivered via lights, screen messages, and audio cues.
  • Behavioral Nudge: Personalized reminders like “Natural light available” or “Fan use unnecessary” reinforce energy-saving habits without being intrusive.
  • Uses:
    • Air Conditioning Use: Warns if temperature is unnecessarily low/high (Temp & Humidity Sensor).
    • Lighting Habits: Detects unnecessary artificial light use when natural light is sufficient (Light Sensor).
    • Fan Usage: Suggests natural ventilation over active cooling (Fan + Temp Sensor).
    • Idle Energy Consumption: Alerts if no motion is detected but devices/lights are left on.

🥩 Meat Consumption Awareness Coach (Concept)

  • Goal: Encourage more sustainable dietary choices by reducing unnecessary meat consumption.
  • What it’s about: While not fully developed, the concept involved using fridge/cooking access data to infer meat-heavy consumption patterns. The system would then prompt users with healthy plant-based alternatives or reminders through the display or audio.
  • Behavioral Nudge: Frequency-based alerts or daily summaries showing excessive food access could lead to more mindful eating choices.
  • Uses:
    • Logs fridge/cooking access times and compares with diet goals.
    • RFID integration could track user habits and trigger alternative food suggestions.
    • While not implemented, this idea is aligned with the final fridge project selected.

♿ EcoAccess Station – Adaptive Smart Environment for Inclusion

  • Goal: Combine energy efficiency with personalized accessibility for users with diverse needs.
  • What it’s about: EcoAccess Station uses RFID to identify users and adapt room conditions based on their physical or sensory requirements (e.g., mobility-impaired, heat-sensitive). It combines motion, temperature, and humidity sensors to optimize energy use while respecting user comfort.
  • Behavioral Nudge: Shows how responsive systems can balance inclusion with sustainability, teaching users to be more conscious about shared resource usage.
  • Uses:
    • Adjusts lighting, fan speed, or notifications based on user profile.
    • Reduces energy waste by activating systems only when needed.
    • Uses motion, temperature, and humidity sensors to evaluate environmental needs.
    • Provides accessible feedback through color-coded LEDs and simple audio/text messages.

❄️ Coach Fridge – Personal Eating Habits(Selected Project)

  • Goal: Promote healthier eating habits and reduce unconscious fridge use through personalized feedback.
  • What it’s about: Coach Fridge uses RFID to identify users and monitors their frequency, duration, and timing of fridge access using motion, steam, gas, and temperature sensors. Based on the behavior, it provides real-time nudges such as reminders to avoid late-night snacking or to shorten door-open time.
  • Behavioral Nudge: Uses lights, sound, and friendly screen messages to mimic a digital coach that helps users make better eating decisions over time.
  • System Features:
    • Identifies users with RFID to personalize the experience and track individual habits.
    • Monitors fridge usage patterns, including:
      • How often the fridge is accessed (access frequency)
      • What time of day it’s used (timing)
      • How long the door stays open (duration)
    • Uses sensor data to detect and respond to specific behaviors such as:
      • Late-night snacking — alerts the user if they frequently access the fridge during sleep hours
      • Leaving the fridge open too long — uses temperature and motion sensors to trigger reminders
      • Storing hot food — detects high humidity or steam and warns about food safety and energy waste
      • Poor food rotation — infers habits from repetitive access patterns without variation
      • Not eating enough fruits — tracks lack of food diversity through access frequency and meal prep signals
      • Ignoring seasonal energy needs — adapts feedback based on external temperature or predefined seasonal settings
    • Provides real-time feedback through:
      • LCD messages with health or sustainability tips
      • RGB/LED lights to indicate usage behavior (e.g., green = ideal, red = needs improvement)
      • Buzzer sounds for soft alerts and behavior warnings
    • Acts like an AI-powered fridge coach, using rule-based logic and behavior history to offer supportive, timely nudges and guide better food habits over time.

3. Day 2 Presentation slides

4. Finalised Idea, description & Functions

Idea: FRoast – Personal Coach Eating Habit Trainer

The project is a smart fridge system designed to monitor and influence users’ eating habits through real-time feedback and personalized behavior tracking. It uses RFID identification, sensors, and actuators to encourage healthier and more sustainable routines such as avoiding late-night snacking, reducing energy waste, and improving food management.

🔎 Description

Each time a user approaches the fridge, they are identified using an RFID tag. The system monitors fridge access patterns — how often, when, and for how long the fridge is used — and cross-references this with sensor data (e.g., steam, gas, temperature, motion) to detect potential habits like:

  • Frequent late-night visits
  • Leaving the fridge door open for too long
  • Storing hot food immediately
  • Poor food rotation or repetitive access
  • Lack of healthy or diverse food preparation

Real-time nudges are provided through LEDs, buzzer sounds, and messages on an LCD display, mimicking the role of a digital “fridge coach.”

⚙️ Functions

  • User Identification: RFID module links behavior to individual users.
  • Usage Tracking: Logs frequency, timing, and duration of fridge access.
  • Behavior Detection:
    • Steam/Gas sensors to detect hot food or cooking activity
    • Temperature sensor to detect door-open duration
    • Motion sensor to measure presence near the fridge
  • Feedback Mechanisms:
    • LCD display for personalized messages and tips
    • RGB/LED lights to indicate behavior status (e.g., green = healthy, red = excessive)
    • Buzzer for alerts when behaviors exceed limits
  • Habit Reinforcement:
    • Encourages mindful eating
    • Reduces unnecessary energy consumption
    • Simulates an AI-powered coach using rule-based logic

5. Future Improvements

While the current prototype effectively demonstrates the core concept of behavior tracking and real-time feedback, several improvements can be made to expand functionality and user impact:

  • Data Logging and Analysis

Store user behavior data (e.g., access time, duration, triggers) to analyze trends over days or weeks and generate visual feedback or reports.

  • Mobile App or Dashboard Integration

Develop a simple companion interface to allow users to view their eating habits, receive personalized suggestions, and set behavioral goals.

  • Nutritional Categorization

Add basic food recognition (via weight sensor or barcode scan) to help detect the type of food being accessed and give more specific dietary feedback.

  • Fridge Inventory Tracking

Track stored items using RFID or manual input to suggest food rotation and reduce waste (e.g., reminders for expiring items).

  • Voice Feedback System

Replace or supplement LCD messages with audio guidance for better accessibility, especially for children or visually impaired users.

  • Energy Optimization Module

Add external temperature detection to adapt internal feedback based on seasonal energy demands (e.g., reducing unnecessary opening in summer).

  • Machine Learning Integration

Train a simple model to adapt nudging patterns based on user-specific behaviors rather than using static thresholds.

These improvements would help transform FRoast from a rule-based behavior tool into a more adaptive, personalized, and accessible smart system.

6. SUSAF Analysis

7. Behavioral Change Analysis

FRoast is designed to influence user behavior through repeated exposure to personalized, real-time feedback. By monitoring interactions and providing subtle nudges, the system encourages users to adopt healthier and more sustainable eating habits over time.

🎯 Targeted Behaviors

  • Late-night snacking
  • Leaving the fridge open too long
  • Storing hot food improperly
  • Repetitive short visits (poor food rotation)
  • Ignoring seasonal energy efficiency
  • Lack of dietary awareness (e.g., not enough fruits or meal structure)

🔍 Behavior Detection Mechanism

  • RFID Identification links behavior data to individual users.
  • Sensor Data (motion, temperature, steam, gas) enables contextual understanding of fridge use.
  • Time-based Logic determines whether behaviors occur during target windows (e.g., night hours, meal prep times).
  • Usage Frequency & Duration are logged to identify repetitive or excessive patterns.

🔁 Feedback Strategy

  • Immediate feedback through RGB lights, buzzer alerts, and LCD messages reinforces self-awareness at the moment of action.
  • Positive reinforcement for reduced usage or healthy timing encourages habit building.
  • Warning signals during undesired behaviors (e.g., frequent night visits) create disruption that prompts reconsideration.

📈 Potential Impact Over Time

  • Increased mindfulness around food access
  • Reduction in energy waste (fridge left open or hot food storage)
  • Healthier timing of meals and snacks
  • Decrease in impulsive or unconscious food-related behavior

Through continued use, the system promotes gradual behavior shifts without requiring drastic user effort, relying instead on consistent micro-interventions tailored to individual patterns.

8. Final Day Presentation Slides

9. Final Code

import uasyncio as asyncio
from machine import Pin, PWM, SoftI2C, ADC, DAC
from i2c_lcd import I2cLcd
import time
import dht
from mfrc522_i2c import mfrc522
 
# Constants
SERVO_PIN = 5
BUZZER_PIN = 25
I2C_SCL = 22
I2C_SDA = 21
I2C_ADDR = 0x27
RFID_ADDR = 0x28
AUTHORIZED_ID = 547
SERVO_OPEN = 125
SERVO_CLOSE = 28
BUZZER_FREQ1 = 1000
BUZZER_FREQ2 = 1500
ALARM_DURATION = 0.5
HUMIDITY_THRESHOLD = 30
TEMP_THRESHOLD = 27
GAS_PIN = 23
GAS_SENSOR = Pin(GAS_PIN, Pin.IN, Pin.PULL_UP)
GAS_THRESHOLD = 70  # Adjust based on sensor calibration
 
# State
door_opened = False
open_time = 0
 
# I2C + LCD setup
i2c = SoftI2C(scl=Pin(I2C_SCL, Pin.OUT, pull=Pin.PULL_UP),
              sda=Pin(I2C_SDA, Pin.OUT, pull=Pin.PULL_UP),
              freq=100000)
lcd = I2cLcd(i2c, I2C_ADDR, 2, 16)
 
# Buzzer setup
buzzer = PWM(Pin(BUZZER_PIN))
buzzer.duty(0)
 
# RFID setup
rc522 = mfrc522(I2C_SCL, I2C_SDA, RFID_ADDR)
rc522.PCD_Init()
rc522.ShowReaderDetails()
 
# DHT Sensor setup
DHT_SENSOR = dht.DHT11(Pin(17))
# === STEAM SETUP ===
STEAM_SENSOR = ADC(Pin(34))  # Analog pin (VP/A2)
STEAM_SENSOR.atten(ADC.ATTN_11DB)  # Full voltage range (0-3.3V)
STEAM_THRESHOLD = 800  # Analog value above this = steam detected
 
 
async def move_servo(position):
    servo = PWM(Pin(SERVO_PIN))
    servo.freq(50)
    servo.duty(position)
    await asyncio.sleep(0.5)
    servo.deinit()
 
async def open_door():
    global door_opened, open_time
    print("Opening door")
    await move_servo(SERVO_OPEN)
    open_time = time.time()
    door_opened = True
 
async def close_door():
    global door_opened
    print("Closing door")
    await move_servo(SERVO_CLOSE)
    door_opened = False
 
 
async def play_alarm():
    print("Playing alarm")
    buzzer.duty(512)
    end_time = time.ticks_ms() + 2000
    while time.ticks_ms() < end_time:
        buzzer.freq(BUZZER_FREQ1)
        await asyncio.sleep(ALARM_DURATION)
        buzzer.freq(BUZZER_FREQ2)
        await asyncio.sleep(ALARM_DURATION)
    buzzer.duty(0)
 
 
async def scroll_text(text, row, delay=1):
    if len(text) <= 16:
        lcd.move_to(0, row)
        lcd.putstr(text + ' ' * (16 - len(text)))
        return
    for i in range(len(text) - 15):
        lcd.move_to(0, row)
        lcd.putstr(text[i:i + 16])
        await asyncio.sleep(delay)
 
async def show_message(upper, lower=""):
    lcd.clear()
    await scroll_text(upper, 0)
    await scroll_text(lower, 1)
 
# --- ASYNC TASKS ---
 
async def monitor_rfid():
    global door_opened, open_time
    while True:
        buzzer.duty(0)
        if rc522.PICC_IsNewCardPresent():
            if rc522.PICC_ReadCardSerial():
                data = sum(rc522.uid.uidByte[0:rc522.uid.size])
                print("Card UID:", data)
                if data == AUTHORIZED_ID:
                    if door_opened:
                        duration = time.time() - open_time
                        print("Duration:", duration)
                        await close_door()
                        if duration > 15:
                            await play_alarm()
                            await show_message("Your indecision is heating the planet.")
                        else:
                            await show_message("Thanks", "For closing me")
                    else:
                        await open_door()
 
                        # Time-based snacking roast
                        current_hour = time.localtime()[3]
                        if current_hour >= 23 or current_hour < 5:
                            await show_message("You hungry or just emotionally empty again?", "Go to sleep, goblin.")
                        else:
                            await show_message("Welcome!", "Door is open")
 
                else:
                    print("Not authorized")
                    await show_message("Access Denied", "Invalid Card")
        await asyncio.sleep(0.5)
 
def monitor_steam_sensor():
    print("🔍 Steam sensor activated...")
    while True:
        try:
            analog_value = STEAM_SENSOR.read()
            print("Steam sensor value:", analog_value)
 
            if analog_value > STEAM_THRESHOLD:
                await show_message("The fridge is not your sauna, pal.")
                print("🔥 Roast: The fridge is not your sauna.")
 
            await asyncio.sleep(2)
 
        except Exception as e:
            print("DHT read error:", e)
        await asyncio.sleep(4)
 
async def monitor_humidity():
    while True:
        try:
            DHT_SENSOR.measure() # Start DHT11 to measure data once.
            # Call the built-in function of DHT to obtain temperature
            # and humidity data and print them in “Shell”.
            temperature_value = DHT_SENSOR.temperature()
            humidity_value = DHT_SENSOR.humidity()
            print('temperature:', temperature_value,'℃','humidity:', humidity_value,'%')
            if temperature_value > TEMP_THRESHOLD:
                await show_message("Want to cool the Sahara too?")
            elif humidity_value > HUMIDITY_THRESHOLD:
                await show_message("Too hot in here!", "Not a sauna, pal.")
        except Exception as e:
            print("DHT read error:", e)
        await asyncio.sleep(4)
 
async def monitor_compartments():
    button1 = Pin(16, Pin.IN, Pin.PULL_UP)
 
    button2 = Pin(27, Pin.IN, Pin.PULL_UP)                          #close
 
    #Nest two for loops to make the module repeatedly display five states of red, green, blue, white and OFF.
 
    while True:
        try:
            btnVal1 = button1.value()  # Reads the value of button 1
 
            #print("button1 =",btnVal1)  #Print it out in the shell
 
            if(btnVal1 == 0):
 
                print("Those vitamins won’t drink themselves.")
 
            btnVal2 = button2.value()
 
            if(btnVal2 == 0):
 
                print("Food compartment opened")
        except Exception as e:
            print("Compartments read error:", e)
        await asyncio.sleep(0.1)
 
async def monitor_gas():
    while True:
        try:
            gas_level = GAS_SENSOR.value()
            print("Gas Level:", gas_level)
            if not gas_level:
                await show_message("You really like cultivating diseases, huh?", "Did your fruit die?")
        except Exception as e:
            print("Gas sensor error:", e)
        await asyncio.sleep(5)
 
# --- MAIN ---
async def main():
    await asyncio.gather(
        monitor_rfid(),
        monitor_humidity(),
        monitor_compartments(),
        monitor_steam_sensor(),
        monitor_gas()
    )
 
asyncio.run(main())