Project

# Title Team Members TA Documents Sponsor
23 Smart Snack Dispenser
Adam Kramer
Elinor Simmons
Eric Nieto Gonzalez
Surya Vasanth design_document1.pdf
final_paper1.pdf
grading_sheet1.pdf
photo1.jpeg
photo2.jpeg
presentation1.pdf
proposal1.pdf
video
Team Members:

- Eric Nieto Gonzalez
- Elinor Simmons
- Adam Kramer

# PROBLEM
One common problem many people face is difficulty in controlling snack portions, which can lead to overeating and unhealthy eating habits. Mindless snacking, especially when working, studying, or watching TV, often results in consuming more than intended. Similarly, there seem to be no machines handling this issue within the current market, leaving individuals to rely on willpower alone or resort to ineffective portioning methods such as manually separating snacks into smaller bags. Without a structured approach, people often struggle to regulate their intake, leading to issues such as weight gain, unhealthy eating patterns, and difficulty in maintaining a balanced diet.

# SOLUTION
The smart snack dispenser addresses this issue by allowing users to set portion sizes and control snack intake. By offering a structured approach to snacking, it helps users develop healthier eating habits, prevent overindulgence, and manage calorie intake more effectively. This solution is particularly beneficial for individuals trying to maintain a balanced diet and/or are tracking their food intake. The machine will offer a specific set of 10 snacks. This includes M&M's, Skittles, Goldfish, Almonds, Cashews, and others. The machine will also plug into a wall outlet.

The solution will include the following subsystems:

- Motor Subsystem: There will be a motor for each snack implanted so that the user can ask for that specific snack, allowing for it to be dropped down to be given to the user.

- Light Sensor/ Computer Vision Subsystem: There will also be a sensor for each snack as well to detect when the stock of each respective snack is running low. This will then be relayed back to the LCD Screen to inform everyone that one is running low.

- PIR Subsystem: This will take care of the machines dropping mechanism and ensuring that there is a tray the user is providing for their needed snacks. It will be a PIR sensor to detect if there is a tray present.

- Touchscreen LCD Display Subsystem: This will be the UI that allows the user to place their goals, access their profiles, and display crucial information. This will show things like date, time, type of snacks, and nutrition for that person to keep a log.

- RFID Subsystem: This will scan each person's ID to access their own personal nutritional goals and data. This way the machine can be used within like a family instead of just one person. Therefore, the machine will also have data on each person's nutrition.

- Portion Control Subsystem: This will make sure that the correct portion is being dispensed.

- Software Subsystem: This will handle all of the internal features. These will include a "lockout" system that will prevent the user from dispensing any more snacks once a set daily calorie limit is hit. There will also be a recommendation system to recommend a more sufficient snack if needed, the displaying of the date, time, type of snacks, and nutrition for that person to keep a log. There will be two modes offered as well. One is a casual mode that will just allow the user to pick whatever snack they want and choose a portion, this will not implement the lockout system. The other mode is the main mode which will provide a user a snack after choosing if they are in need of something that will, for example, help give them more energy or they want something with more protein.

# SUBSYSTEM 1
The Motor Subsystem is responsible for the snacks being dispensed correctly and no issues arising.

Design:

- Code the motors in the micro controller and ensure each functions properly with their respective snack.
- Create a format where only a certain amount of snacks gets dispensed with no issues.

Components:
- A motor per snack that will be in the machine.

# SUBSYSTEM 2
The Light Sensor Subsystem is responsible for checking the amount of snack present. It will also tell us when the snack on each one is running low.

Design:

- Code the light sensor where we know the depth of each snack container and then reduce the amount by a little.
- This will then allow us to detect when a snack is running low when that previous depth as been reach once more.

Components:
- A light sensor per snack that will be in the machine.

# SUBSYSTEM 3
The PIR Subsystem is responsible for checking if a tray is present or not.

Design:

- Code the PIR sensor in the micro controller and check when there is a tray present or not
- This can be done where we detect the light coming back soon since in the presence of a tray, it should not take long compared to nothing being present.

Components:
- One PIR sensor for the dispensary.
- Design the dispensary in a way that drops the snacks without blocking the PIR sensor.

# SUBSYSTEM 4
The Touchscreen LCD Display Subsystem is responsible for displaying all the needed information to the respective user.

Design:

- Code the LCD display to work properly with the rest of the sensor as mentioned.
- Create a solid user interface as well where the user can interact with the display.
- Display needed nutritional facts as well and constraints on the user if needed.

Components:

- One Touchscreen LCD display
- A memory to save all the data that will be implemented

# SUBSYSTEM 5
The RFID Subsystem is responsible for checking in each user and locate their respective data.

Design:
- Code the RFID system so that it functions properly with the user tags

Components:
- RFID reader
- RFID tag tag per user

# SUBSYSTEM 6
The Portion Control System will make sure the correct portion is being dispensed.

Design
- Create a frame that will hold the weight sensor.
- Code so that the weight sensor readings are read on the LCD and apply correct units.

Components
- Weight sensor

# SUBSYSTEM 7
The Software Subsystem will handle all of the internal features.

Design:
- Code the lockout system, the recommendation system, date, time, type of snacks, nutrition log.

Components:
- The ESP32, so we can have access to WIFI

# CRITERION FOR SUCCESS
Our project will be considered successful if it meets the following testable criteria.
1. The weight sensor is accurate with a 5% tolerance
1. The motor system dispenses the snack with minimal issues (motor doesn't jam and snacks don't get stuck while dispensing).
1. The user interface works properly and the internal software systems work at the appropriate times.
1. Both sensors for refilling and checking if a container is present are working properly.
1. Snack is dispensed in at most 3 seconds after the user chooses the amount of snack.

Microcontroller-based Occupancy Monitoring (MOM)

Vish Gopal Sekar, John Li, Franklin Moy

Microcontroller-based Occupancy Monitoring (MOM)

Featured Project

# Microcontroller-based Occupancy Monitoring (MOM)

Team Members:

- Franklin Moy (fmoy3)

- Vish Gopal Sekar (vg12)

- John Li (johnwl2)

# Problem

With the campus returning to normalcy from the pandemic, most, if not all, students have returned to campus for the school year. This means that more and more students will be going to the libraries to study, which in turn means that the limited space at the libraries will be filled up with the many students who are now back on campus. Even in the semesters during the pandemic, many students have entered libraries such as Grainger to find study space, only to leave 5 minutes later because all of the seats are taken. This is definitely a loss not only to someone's study time, but maybe also their motivation to study at that point in time.

# Solution

We plan on utilizing a fleet of microcontrollers that will scan for nearby Wi-Fi and Bluetooth network signals in different areas of a building. Since students nowadays will be using phones and/or laptops that emit Wi-Fi and Bluetooth signals, scanning for Wi-Fi and Bluetooth signals is a good way to estimate the fullness of a building. Our microcontrollers, which will be deployed in numerous dedicated areas of a building (called sectors), will be able to detect these connections. The microcontrollers will then conduct some light processing to compile the fullness data for its sector. We will then feed this data into an IoT core in the cloud which will process and interpret the data and send it to a web app that will display this information in a user-friendly format.

# Solution Components

## Microcontrollers with Radio Antenna Suite

Each microcontroller will scan for Wi-Fi and Bluetooth packets in its vicinity, then it will compile this data for a set timeframe and send its findings to the IoT Core in the Cloud subsystem. Each microcontroller will be programmed with custom software that will interface with its different radio antennas, compile the data of detected signals, and send this data to the IoT Core in the Cloud subsystem.

The microcontroller that would suit the job would be the ESP32. It can be programmed to run a suite of real-time operating systems, which are perfect for IoT applications such as this one. This enables straightforward software development and easy connectivity with our IoT Core in the Cloud. The ESP32 also comes equipped with a 2.4 GHz Wi-Fi transceiver, which will be used to connect to the IoT Core, and a Bluetooth Low Energy transceiver, which will be part of the radio antenna suite.

Most UIUC Wi-Fi access points are dual-band, meaning that they communicate using both the 2.4 GHz and 5 GHz frequencies. Because of this, we will need to connect a separate dual-band antenna to the ESP32. The simplest solution is to get a USB dual-band Wi-Fi transceiver, such as the TP-Link Nano AC600, and plug it into a USB Type-A breakout board that we will connect to each ESP32's GPIO pins. Our custom software will interface with the USB Wi-Fi transceiver to scan for Wi-Fi activity, while it will use the ESP32's own Bluetooth Low Energy transceiver to scan for Bluetooth activity.

## Battery Backup

It is possible that the power supply to a microcontroller could fail, either due to a faulty power supply or by human interference, such as pulling the plug. To mitigate the effects that this would have on the system, we plan on including a battery backup subsystem to each microcontroller. The battery backup subsystem will be able to not only power the microcontroller when it is unplugged, but it will also be able to charge the battery when it is plugged in.

Most ESP32 development boards, like the Adafruit HUZZAH32, have this subsystem built in. Should we decide to build this subsystem ourselves, we would use the following parts. Most, if not all, ESP32 microcontrollers use 3.3 volts as its operating voltage, so utilizing a 3.7 volt battery (in either an 18650 or LiPo form factor) with a voltage regulator would supply the necessary voltage for the microcontroller to operate. A battery charging circuit consisting of a charge management controller would also be needed to maintain battery safety and health.

## IoT Core in the Cloud

The IoT Core in the Cloud will handle the main processing of the data sent by the microcontrollers. Each microcontroller is connected to the IoT Core, which will likely be hosted on AWS, through the ESP32's included 2.4GHz Wi-Fi transceiver. We will also host on AWS the web app that interfaces with the IoT Core to display the fullness of the different sectors. This web app will initially be very simple and display only the estimated fullness. The web app will likely be built using a Python web framework such as Flask or Django.

# Criterion For Success

- Identify Wi-Fi and Bluetooth packets from a device and distinguish them from packets sent by different devices.

- Be able to estimate the occupancy of a sector within a reasonable margin of error (15%), as well as being able to compute its fullness relative to that sector's size.

- Display sector capacity information on the web app that is accurate within 5 minutes of a user accessing the page.

- Battery backup system keeps the microcontroller powered for at least 3 hours when the wall outlet is unplugged.

Project Videos