Internet of Things
TinkerforgeCode in ActionAbout Me
  • Course Outline
  • 1 - Getting Started
    • Overview
    • Connect to the LED
    • Getting Started
      • Glitch
      • The Application Template
    • Concepts in Programming
      • What is Programming?
      • Variables
      • Functions and Commands
      • Control Structures
      • Loops
      • Objects and Libraries
    • Programming Simple Web Apps
    • Exercises
      • 1.1 Buttons and Inputs
  • 2 - Internet of Things
    • Overview
    • IoT in our Apps
      • Getting Started
        • Hardware Kit
        • Brick Viewer and Daemon
      • Connect to the Devices
        • The Tinkerforge Device Manager
      • Program the Devices
        • RGB LED
        • RGB LED Button
        • OLED Display
        • Sensors
          • Humidity Sensor
          • Ambient Light Sensor
    • Components and Use Cases
    • Exercises
      • 2.1 Lights and Buttons
      • 2.2 Sensors
      • 2.3 Display
  • 3 - Artificial Intelligence
    • Overview
    • AI in our Apps
      • Google's Teachable Machine
      • Face Recognition
      • Training a Custom Model
    • Rules vs. Learning
    • Learning from Data
    • Use Cases
      • Computer Vision
        • Image Classification
        • Handwriting Recognition
    • Machine Learning Algorithms
      • Artificial Neural Networks
      • Decision Trees
      • Logistic Regression
    • Exercises
      • 3.1 Rules vs. Learning
      • 3.2 Fruits and Vegetables
      • 3.3 Face Recognition
      • 3.4 A Classifier for Iris
  • 4 - Cloud & APIs
    • Overview
    • APIs in our Apps
    • Cloud and APIs
      • Weather API
      • NASA Open APIs
      • EDAMAM Nutrition and Recipes API
    • Push Notifications
    • Exercises
  • 5 - App Project
    • Overview
    • Summer 2021
    • Summer 2022
  • Appendix
    • Other Devices
      • Motorized Linear Poti
      • Sound Pressure Sensor
      • NFC Reader
      • Motion Detector
    • UI Features
      • Realtime Charts
      • Countdown Timer
    • Digital Computers
      • Overview
      • The Binary System
      • Code Systems
      • Logic Gates
      • Binary Addition
      • From Analog to Digital
    • Cheat Sheets
    • Projects
      • IoT @ Pickup-Boxes
Powered by GitBook
On this page
  • Smart Fridge
  • Epic 1: Temperature Control
  • Epic 2: Stock Management
  • Hints
  • Column layouts
  • Disable buttons

Was this helpful?

  1. 5 - App Project

Summer 2021

The problem description for the app project in the summer term 2021.

PreviousOverviewNextSummer 2022

Last updated 4 years ago

Was this helpful?

Smart Fridge

In the app project for this semester, your goal is to build and simulate a smart refrigerator (abbreviated as fridge) out of components that you learned about in the last few weeks. More precisely, your web app is going to simulate the interactive control display (ICD) of your smart fridge. In addition to the ICD, the small OLED display will be used to output the most important information to the user, in case the web app fails.

The figure below shows an example scribble of how the ICD could look as a web app. In the following, you find a list of functional requirements for the smart fridge. To complete the app project, your group must implement all requirements. You should be able to implement the requirements separately, although there are dependencies between them that require a certain order of implementation.

Epic 1: Temperature Control

The smart fridge's temperature is essential to keep all food safe. Thus, the smart fridge's comes with an automatic control and warning system for the temperature:

  • 1.1: At any time, the IDC and the OLED display should inform the user about the current temperature and the target temperature that is currently set.

  • 1.2: On the ICD, the user should be able to set a new target temperature using an input field and a button.

  • 1.3: On the ICD, if the current temperature differs from the target temperature by a certain threshold, the current temperature should be shown in orange (warning) and red (critical), depending on how far off the current temperature is. The regular color (e.g. black) should be used, if the value is OK. The OLED display is not affected by the thresholds.

  • 1.4: Analogous to the previous task, the LED should blink orange and red when a threshold is exceeded. It should steadily light up in green when the temperature status is OK.

  • 1.5: When the current temperature is critical, send a push notification to the user's smartphone and inform him/her about the current status. At the same time, the LED button should start blinking red to indicate that a user's action is necessary. When the user pushes the button, the LED button turns off again.

  • 1.6: Make sure you send only one push notification. There should not be any further push notifications until the user pushed the LED button.

Epic 2: Stock Management

Your smart fridge keeps track of what's inside. For this, the smart fridge employs a small camera and a machine learning model trained to recognize different foods when a person holds them into the camera.

  • 2.1: The smart fridge should be able to recognize 3 different types of foods of your choice. Train a machine learning model to recognize a food item when you hold it in front of the camera.

  • 2.2: When the food was successfully recognized, the user can choose to press one of two buttons on the ICD. The first is labeled "Stock Item" and adds the current food item to the fridge. The second is labeled "Unstock Item" and removes the current food item from the fridge.

  • 2.3: Make sure that both buttons are only active when the respective action can be performed. E.g. both should be inactive when no food item is recognized. The "Unstock Item" button should only be active when the current stock for the recognized food item is > 0.

  • 2.4: A terminal should display a text message when an item was stocked or unstocked.

  • 2.5: The smart fridge should keep stock of all food items and display the current stock in a table or some other visual format. Make sure that the smart fridge won't let the stock for a food item become negative.

  • 2.6: When the stock level of a food item falls below 3, the smart fridge should send a push notification telling the user that is has automatically added the food item to the shopping list.

Hints

Column layouts

Disable buttons

To enable or disable a button with JavaScript, you can simply set or remove the disabled attribute.

var btn = document.getElementById("btn");

// Disable a button
btn.setAttribute("disabled", "");

// Enable a button
btn.removeAttribute("disabled");

To create a column-layout as shown in the scribble above, take a look at . We are already using the Bootstrap framework in our app template, so you are ready to go.

Boostrap's grid system
This is how the ICD could look like. But feel free to create your own version of the ICD.