{"id":575,"date":"2025-10-28T07:29:47","date_gmt":"2025-10-28T05:29:47","guid":{"rendered":"https:\/\/www.hh3dlab.fi\/blog\/?p=575"},"modified":"2025-10-28T07:46:18","modified_gmt":"2025-10-28T05:46:18","slug":"sip-n-sense-intelligence-mug-project","status":"publish","type":"post","link":"https:\/\/www.hh3dlab.fi\/blog\/iot\/sip-n-sense-intelligence-mug-project\/","title":{"rendered":"Sip &#8216;n&#8217; Sense &#8211; Intelligent mug project"},"content":{"rendered":"<h1><strong>Introduction<\/strong><\/h1>\n<p style=\"font-weight: 400\">When we first began our studies at Haaga-Helia University of Applied Sciences, we were immediately intrigued by the world of IoT. Our journey started with the very first course, Internet of Things: A Business Perspective, where we explored different approaches to creating IoT solutions. From the beginning, our main goal was to develop a component of a weather station. From that point on, we were hooked.<\/p>\n<p style=\"font-weight: 400\">We joined a course introduced by our teacher, Heikki Hietala, called the <em>International IT Seminar for Students<\/em>. In this class, we delved deeper into coding with Arduino and experimented with creating various devices, such as smartwatches and radio stations. One of the highlights was traveling to Spain with our classmates, where we connected with students from around the world and shared our knowledge of the IoT field.<\/p>\n<p style=\"font-weight: 400\">In conclusion, while we had already gained some knowledge of IoT programming from previous classes, we remain eager to expand our skills and learn more each day.<\/p>\n<h1><strong>Ideas<\/strong><\/h1>\n<p style=\"font-weight: 400\">At the start of this project, we already had a pretty clear vision of what we wanted to create. Our goal was to build something fun and practical that could be used at student events, a playful gadget that works as a memorable party trick.<\/p>\n<p>The first idea we had were:<\/p>\n<ol>\n<li>1. IoT Truth or Dare Cube, A physical cube you shake, and the result is shown on a connected app with fun challenges.<\/li>\n<li>Elevator Prank box, A device you carry that automatically plays elevator music when you stop moving for more than 10 seconds.<\/li>\n<li>Plant Whisperer Mug, A mug that \u201ctalks\u201d to your nearby plant via Bluetooth and shares fun plant updates when you drink near it (like \u201cYour plant is jealous of your water\u201d).<\/li>\n<li>Mood Doorbell, instead of a ding-dong, the doorbell plays random sound effects (lightsaber, goat scream, Mario coin) each time it\u2019s pressed. You can update sounds via app.<\/li>\n<li>IoT Shoesoles, Measure how many steps you take in a day but instead of fitness stats, it gives random fun facts or jokes based on your steps.<\/li>\n<\/ol>\n<p>But what we chose to continue this project with is a <strong>Sip \u2018n\u2019 Sense<\/strong>:<\/p>\n<p style=\"font-weight: 400\">A cup that tracks how often you drink water and sends you random motivational or silly push notifications like <em>\u201cYou\u2019re basically a cactus, drink up!\u201d <\/em>What we\u2019re going to do is add an alcohol content tracker that detects if there is alcohol in the mug. If the mug detects alcohol, it will send a message to your device with a hilarious message like <em>\u201coh, it\u2019s that kind of Monday huh?\u201d<\/em> etc.<\/p>\n<h1><strong>What did we need to learn<\/strong><\/h1>\n<p style=\"font-weight: 400\">At the beginning, we needed to learn how to use several new components and integrate them together: the ESP32 microcontroller, HC-SR04 ultrasonic sensor, MQ-3 alcohol sensor, GPS NEO-6M, infrared thermometer, push button, and WS2812B LED strip. We also had to learn how to program Telegram bots to send and receive notifications from our device.<\/p>\n<p style=\"font-weight: 400\">The <strong>initial scope<\/strong> of the project was to create a playful IoT device called <em>Sip \u2018n\u2019 Sense<\/em>: a smart mug that could track how often you drink, detect alcohol content, measure temperature, and send witty push notifications to encourage hydration (or joke about drinking alcohol).<\/p>\n<p style=\"font-weight: 400\">Our <strong>learning objectives<\/strong> included:<\/p>\n<ul>\n<li>Understanding and wiring different sensors (ultrasonic, alcohol, GPS, temperature).<\/li>\n<li>Programming ESP32 in the Arduino IDE and using libraries like TinyGPSPlus, UniversalTelegramBot, and Adafruit_NeoPixel.<\/li>\n<li>Designing and implementing a Telegram bot for user interaction.<\/li>\n<li>Calibrating sensors to produce meaningful readings.<\/li>\n<li>Measuring physical dimensions of the mug to calculate liquid levels accurately.<\/li>\n<li>Using 3D printing to create a lid that fits all components.<\/li>\n<li>Integrating LED lights to visualize the water level in a fun way.<\/li>\n<\/ul>\n<h1><strong>The building phase<\/strong><\/h1>\n<p style=\"font-weight: 400\">At the beginning of this class, our task was to build monitor lights and screens that could detect the distance between the monitor and an object. Here\u2019s a short video collage showcasing the result. The components used in the project above included an I2C backpack for the LCD screen, Arduino, ultrasonic distance sensor, breadboard, cables, LEDs, jumpers, resistors, and push buttons. Enjoy.<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"IoT Experimental Project - Video\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/FIF0QG19cNg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p style=\"font-weight: 400\">After completing that, we moved on to the next stage, the truly fun part of the class: building the device itself. The components used in this project included an MQ3 gas sensor, HC-SR04 ultrasonic sensor, NEO-6M GPS module, and an ESP32.<\/p>\n<p style=\"font-weight: 400\">We started by naming the components on the breadboard: ESP, GPS, MQ3 ALKO and HC-U\u00c4S and powering the board using the ESP32.<\/p>\n<p style=\"font-weight: 400\">The <strong>HC \u2013SR04 ultra sensor<\/strong> is connected as follows:<\/p>\n<p style=\"font-weight: 400\">VCC \u2013 5V<\/p>\n<p style=\"font-weight: 400\">GND \u2013 GND<\/p>\n<p style=\"font-weight: 400\">Trig \u2013 ESP32 (5)<\/p>\n<p style=\"font-weight: 400\">Echo \u2013 ESP32 (18)<\/p>\n<p style=\"font-weight: 400\"><strong>The alcohol sensor MQ-3<\/strong> are connected as follows:<br \/>\nVCC \u2013 5V<\/p>\n<p style=\"font-weight: 400\">GND \u2013 GND<\/p>\n<p style=\"font-weight: 400\">A0 \u2013 ESP32 (34)<\/p>\n<p style=\"font-weight: 400\">The MQ-3 sensor requires a warm-up period, so it\u2019s recommended to wait 20\u201360 seconds before taking measurements.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-579\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753.jpeg?resize=628%2C354&#038;ssl=1\" alt=\"\" width=\"628\" height=\"354\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?resize=2048%2C1152&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1753-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/p>\n<p style=\"font-weight: 400\">The next step was connecting the entire project to our computer and the Arduino IDE. We also installed the ESP32 library and Tiny-GPSPlus. We changed the Board to ESP32 Dev Module. To proceed, we needed to charge the battery of the MQ-3 alcohol sensor. We kept the device plugged in from Monday to Thursday. The HC-SR04 ultrasonic sensor and the MQ-3 alcohol sensor work seamlessly together within the same code. We still need to interpret the readings from the MQ-3 sensor. Next, we will focus on developing the Telegram bot.<\/p>\n<p style=\"font-weight: 400\"><strong>Telegram bot: <\/strong><\/p>\n<p style=\"font-weight: 400\">We decided that the device would send all notifications directly to the Telegram app on the user\u2019s personal device. The name of our bot is <strong>Sip \u2018n\u2019 Sense Agent<\/strong>. For easier navigation and a shorter reference, we chose the username <strong>sipsense_bot<\/strong>. We used Telegram\u2019s BotFather to create our own bot and generated an API token to access the HTTP API (8282242915:AAE5X0HZzxufftgeFMc_x0Xt9DlzCqjDFik).\u00a0 This token can be used by anyone to control our bot, so it must be kept secure. Here is the page: <a href=\"https:\/\/t.me\/sipnsense_bot\">https:\/\/t.me\/sipnsense_bot<\/a> The chat ID is 6435133404. We included the library UniversalTelegramBot.<\/p>\n<p style=\"font-weight: 400\">The code is working, and the Telegram bot is now functional. Currently, interacting with the bot requires entering a command such as \/status to receive distance information. We are still testing to ensure everything works properly before integrating the device into the mug.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-580\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.04.jpeg?resize=225%2C422&#038;ssl=1\" alt=\"\" width=\"225\" height=\"422\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.04.jpeg?resize=160%2C300&amp;ssl=1 160w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.04.jpeg?resize=547%2C1024&amp;ssl=1 547w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.04.jpeg?w=672&amp;ssl=1 672w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-581\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.16.jpeg?resize=450%2C60&#038;ssl=1\" alt=\"\" width=\"450\" height=\"60\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.16.jpeg?resize=300%2C40&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.16.jpeg?resize=1024%2C137&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.16.jpeg?resize=768%2C102&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.16.jpeg?w=1470&amp;ssl=1 1470w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/Image-2.10.2025-at-15.16.jpeg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/p>\n<p style=\"font-weight: 400\">The cup we have has a capacity of 650 ml.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-583\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921.jpeg?resize=534%2C301&#038;ssl=1\" alt=\"\" width=\"534\" height=\"301\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?resize=2048%2C1152&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_1921-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/p>\n<p style=\"font-weight: 400\">Next on creating a separate code to get the alcohol sensor functioning as well. The command to access it is \/alcohol. The chatbot does answer the command, but we still need to figure out what the MQ-3 alcohol sensor value means. After a bit of research online, we found that if the value is below 3500, the drink contains alcohol. We merged the codes. The command for checking the amount of liquid is \/water, and for alcohol, it is \/alcohol.<\/p>\n<p>The next step is to measure the cup. The following measurements are required:<\/p>\n<ol>\n<li><strong>Height<\/strong><br \/>\nMeasure from the bottom of the cup to the lower edge of the lid (or the rim if there is no lid).<br \/>\nUse a ruler or measuring tape.<\/li>\n<li><strong>Diameter \/ Width<\/strong><\/li>\n<\/ol>\n<p style=\"font-weight: 400\"><strong>Top (opening):<\/strong> Measure across the widest part of the cup\u2019s mouth.<\/p>\n<p style=\"font-weight: 400\"><strong>Bottom:<\/strong> Measure the base diameter if it is smaller than the opening.<\/p>\n<ol start=\"3\">\n<li><strong>Body Diameter at Different Points<\/strong><br \/>\nIf the cup narrows toward the bottom (conical shape), measure the diameters at a few points (e.g., at 1\/3 and 2\/3 of the height).<\/li>\n<li><strong>Lid Diameter and Height<\/strong><br \/>\nIf the cup has a lid, measure its width and height (if it extends above the cup).<\/li>\n<li><strong>Lid-to-Cup Connection<\/strong><br \/>\nMeasure how deep the lid fits into the mouth of the cup to ensure accurate volume calculation.<\/li>\n<li><strong>Curves \/ Textures<\/strong><br \/>\nThis is less often necessary for volume calculation, but for a more detailed model you can measure the height or depth of textured surfaces (this cup has an embossed pattern).<\/li>\n<li><strong>Cup Capacity<\/strong><br \/>\nConfirm that the 650 ml capacity was measured at the correct level (full, without overflowing).<\/li>\n<\/ol>\n<table style=\"font-weight: 400\">\n<tbody>\n<tr>\n<td width=\"163\"><strong>Measurement<\/strong><\/td>\n<td width=\"100\"><strong>Value<\/strong><\/td>\n<td width=\"271\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Height<\/td>\n<td width=\"100\">19.5 cm<\/td>\n<td width=\"271\">Total height of the cup (without straw)<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Lid<\/td>\n<td width=\"100\">8 cm \u00d7 1 cm<\/td>\n<td width=\"271\">Lid diameter and lid height<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Top diameter<\/td>\n<td width=\"100\">9.5 cm<\/td>\n<td width=\"271\">Diameter across the top opening<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Top width<\/td>\n<td width=\"100\">8 cm<\/td>\n<td width=\"271\">Width of the cup at the top edge<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Top circumference<\/td>\n<td width=\"100\">31.5 cm<\/td>\n<td width=\"271\">Circumference of the cup at the top<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Middle circumference<\/td>\n<td width=\"100\">28 cm<\/td>\n<td width=\"271\">Circumference of the cup at the middle<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Bottom diameter<\/td>\n<td width=\"100\">6.5 cm<\/td>\n<td width=\"271\">Diameter across the bottom<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Bottom width<\/td>\n<td width=\"100\">5 cm<\/td>\n<td width=\"271\">Width of the cup at the bottom edge<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Bottom circumference<\/td>\n<td width=\"100\">24 cm<\/td>\n<td width=\"271\">Circumference of the cup at the bottom<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Cup wall thickness<\/td>\n<td width=\"100\">1 cm<\/td>\n<td width=\"271\">Thickness of the cup material<\/td>\n<\/tr>\n<tr>\n<td width=\"163\">Bottom wall thickness<\/td>\n<td width=\"100\">2 cm<\/td>\n<td width=\"271\">Thickness of the bottom cup material<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"font-weight: 400\">The first result showed that the mug\u2019s capacity corresponds to 16.7 cm in height. We wanted to ensure that the cup accounts for its material, with a wall thickness of 1 cm on each side and 2 cm on the bottom. The liquid capacity measurement works. We poured some water into the cup and found that the capacity was 18.57 ml. Ultimately, the measurements we needed were the height of the cup, the height of the bottom wall, the volume in milliliters, the top diameter, and the bottom diameter.<\/p>\n<p style=\"font-weight: 400\">We are still not entirely sure whether the alcohol sensor readings are as accurate as we would like. We decided that knowing the exact alcohol percentage is unnecessary; we only need to receive a notification when the cup detects alcohol.<\/p>\n<p style=\"font-weight: 400\"><strong>Infrared thermometer<\/strong><\/p>\n<p style=\"font-weight: 400\">The next component we decided to add to our project was an infrared thermometer (model HW-691), which measures the temperature of the liquid inside the mug.<\/p>\n<p style=\"font-weight: 400\">HW-691<\/p>\n<p style=\"font-weight: 400\">VCC \u2013 3.3V<\/p>\n<p style=\"font-weight: 400\">GND-GND<\/p>\n<p style=\"font-weight: 400\">SDA \u2013 GPIO21 (PC Data)<\/p>\n<p style=\"font-weight: 400\">SCL \u2013 GPIO22 (PC Clock)<\/p>\n<p style=\"font-weight: 400\">To enable the infrared thermometer, we included the Adafruit_MLX90614 library in our project. The thermometer functions correctly, as verified by comparing its readings with another thermostat and by measuring various objects, such as my hand. We added a single line of code to ensure the device sends all detected data to the bot. The message now includes all the data: water measurement, water temperature, and alcohol content.<\/p>\n<p style=\"font-weight: 400\"><strong>Single press button<\/strong><\/p>\n<p style=\"font-weight: 400\">To ensure the bot provides the cup\u2019s status, we added a single-press button to the device. When pressed, the sensor detects that the mug has been refilled. This was added because the sensor was previously picking up all liquid movements in the mug, sending us false information.<\/p>\n<p style=\"font-weight: 400\">Single press button \u2013 GPIO23<\/p>\n<p style=\"font-weight: 400\">GND \u2013 GND<\/p>\n<p style=\"font-weight: 400\"><strong>3D printing<\/strong><\/p>\n<p style=\"font-weight: 400\">We wanted to assemble the entire mug so that all the parts fit securely together. To achieve this, our teacher 3D-printed a new lid for the mug, which already had holes for the HC-SR04 ultrasonic sensor.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-584\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155.jpeg?resize=549%2C309&#038;ssl=1\" alt=\"\" width=\"549\" height=\"309\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?resize=2048%2C1152&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2155-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/p>\n<p style=\"font-weight: 400\"><strong>LED-strip<\/strong><\/p>\n<p style=\"font-weight: 400\">As we progressed, we chose to integrate LED strip lights (WS2812B-LED) to visually indicate the mug\u2019s fill level. We added the Adafruit_NeoPixel library to make the LED strip work. The LED strip receives data from the HC-SR04 ultrasonic sensor and illuminates the LEDs up to the corresponding level. We assigned color indicators to the levels: blue for full, green for half, and red for almost empty or empty. The slot on ESP32 is GPIO 27<\/p>\n<p style=\"font-weight: 400\">We know the measurements of the mug: 19.5 cm tall, with a top circumference of 31.5 cm and a bottom circumference of 24 cm. Its total capacity is 650 ml. The mug is wrapped with a WS2812B LED strip containing 38 LEDs, placed approximately evenly around its surface. Our goal is to have the LEDs visually indicate the waterline, showing how full the mug is at any given time. The next step is to determine the best way to structure and configure the device so the LED display accurately represents the water level.<\/p>\n<p style=\"font-weight: 400\">The LED strip now displays the water level inside the mug: green LEDs represent the filled portion, while pink LEDs indicate the empty space above the water.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-585\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658.jpeg?resize=543%2C306&#038;ssl=1\" alt=\"\" width=\"543\" height=\"306\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?resize=2048%2C1152&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2658-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/p>\n<p style=\"font-weight: 400\">We integrated a light function for the alcohol sensor. Whenever the device detects alcohol, the LEDs flash red for 10 seconds every minute, continuing as long as alcohol is present in the mug. For practical use, we modified the code so that all functions remain active for a duration of 5 minutes.<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"IoT-sip &#039;n&#039; sense\" width=\"640\" height=\"480\" src=\"https:\/\/www.youtube.com\/embed\/aN821wNQYhY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<h1><strong>The outcome<\/strong><\/h1>\n<p style=\"font-weight: 400\">The outcome of the project was a working prototype that we are proud of. The mug can successfully detect its water level using the ultrasonic sensor, measure whether there is alcohol in the drink, read the temperature of the liquid with the infrared thermometer, and display the water level visually using LED lights. It sends information directly to our Telegram bot, where we can use simple commands such as \/water, \/alcohol, and \/status to get live updates. While we initially planned to include GPS tracking, we decided to leave it out in the final version to keep the project simpler and more practical.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-586\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809.jpeg?resize=533%2C300&#038;ssl=1\" alt=\"\" width=\"533\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?resize=2048%2C1152&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2025\/10\/IMG_2809-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/p>\n<p style=\"font-weight: 400\">Through this project, we learned a great deal about IoT development. We gained hands-on experience in wiring, troubleshooting, and calibrating sensors, and we learned how to work with the ESP32 microcontroller to combine data from multiple inputs. We also learned about integrating software and hardware by building a Telegram bot and connecting it to our mug, and about how 3D-printed components can be used to make custom enclosures for electronics. Most importantly, we learned how to keep a project moving forward by solving problems as they came up, such as when our sensors weren\u2019t working due to cable issues or when we needed to simplify our design to make it practical.<\/p>\n<p style=\"font-weight: 400\">This course definitely made us more interested in tinkering. The process of experimenting with code, wiring up sensors, and seeing the mug slowly come to life was very satisfying and has inspired us to keep building new things. It didn\u2019t feel like a one-off project but rather a starting point for exploring IoT further.<\/p>\n<p style=\"font-weight: 400\">In the future, we have many ideas for continuing this work. We would like to create a fully wireless and rechargeable version of the mug, add Bluetooth connectivity to make it easier to pair with smartphones, and perhaps even connect it to a health tracking app so it can automatically log daily water intake. Additionally, the project could include programmable LED light patterns, GPS functionality, and sound features to enhance interactivity and user experience. We are also interested in building some of the other devices we brainstormed at the start of the course, such as the IoT Truth-or-Dare Cube or the Mood Doorbell, and exploring how the same concept could be applied to other fun gadgets, like plant pots that light up to show soil moisture levels.<\/p>\n<p>&nbsp;<\/p>\n<p><span data-contrast=\"auto\">\u2728\u00a0Brought\u00a0to life\u00a0by\u00a0the\u00a0unstoppables: Katja Koskela and Inka Lindstr\u00f6m<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:276}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Finished\u00a0on 9.10.2025\u00a0after\u00a0<\/span><i><span data-contrast=\"auto\">way<\/span><\/i><span data-contrast=\"auto\"> too many energy drinks \ud83e\uddc3<\/span><\/p>\n<p><span data-contrast=\"auto\">\ud83d\ude80\u00a0We\u00a0hope\u00a0you\u00a0love\u00a0it as\u00a0much\u00a0as\u00a0we\u00a0loved\u00a0building\u00a0it!<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:0,&quot;335551620&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:276}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction When we first began our studies at Haaga-Helia University of Applied Sciences, we were immediately intrigued by the world of IoT. Our journey started with the very first course, Internet of Things: A Business Perspective, where we explored different approaches to creating IoT solutions. From the beginning, our main goal was to develop a [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[19,20,50,15,62],"tags":[],"class_list":["post-575","post","type-post","status-publish","format-standard","hentry","category-arduino","category-esp32","category-innovation-course","category-iot","category-sensors"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":268,"url":"https:\/\/www.hh3dlab.fi\/blog\/madrid-2022\/team-5-introduction\/","url_meta":{"origin":575,"position":0},"title":"Team 5 &#8211; Introduction","author":"Madrid Team 5","date":"30.3.2022","format":false,"excerpt":"Hello all, this is an introduction post to Team 5 for Madrid seminar 2022. Our group of students from Haaga-Helia UAS will go to Madrid seminar to teach other students how to build an IoT device that sends GPS, temperature etc. data to the server and displays the information on\u2026","rel":"","context":"In &quot;ESP32&quot;","block_context":{"text":"ESP32","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/esp32\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":5,"url":"https:\/\/www.hh3dlab.fi\/blog\/3d-robo-lab\/tervetuloa-haaga-helian-3d-robo-labiin\/","url_meta":{"origin":575,"position":1},"title":"Haaga-Helia 3D + Robo Lab equipment","author":"Heikki Hietala, lab admin","date":"13.3.2022","format":false,"excerpt":"Haaga-Helia 3D + Robo Lab is the 3D, robotics and IoT research lab at our University. 3D is a family of technologies that can be seen to affect every field of business today. Virtual reality, augmented reality, mixed reality, 3D modeling, scanning and printing open new business opportunities every day.\u2026","rel":"","context":"In &quot;3D + Robo Lab&quot;","block_context":{"text":"3D + Robo Lab","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/3d-robo-lab\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20190202_194403_807.jpg?fit=1200%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20190202_194403_807.jpg?fit=1200%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20190202_194403_807.jpg?fit=1200%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20190202_194403_807.jpg?fit=1200%2C1200&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20190202_194403_807.jpg?fit=1200%2C1200&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":643,"url":"https:\/\/www.hh3dlab.fi\/blog\/3d-robo-lab\/643\/","url_meta":{"origin":575,"position":2},"title":"The Smart Gardener \u2013 A Connected Plant Pot","author":"Heikki Hietala, lab admin","date":"20.3.2026","format":false,"excerpt":"By Florent Gilli\u00e9ron, Julien Mignon & L\u00e9on Ehrwein Introduction We are three students taking the IoT Experimental Project - DIG008AS3AE-3004. Our backgrounds are quite different. Florent and Julien had some prior experience with coding and web development and worked with microcontrollers and physical sensors before. L\u00e9on had no experience at\u2026","rel":"","context":"In &quot;3D + Robo Lab&quot;","block_context":{"text":"3D + Robo Lab","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/3d-robo-lab\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-643-2.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-643-2.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-643-2.jpeg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":418,"url":"https:\/\/www.hh3dlab.fi\/blog\/iot\/the-electricity-price-lamp\/","url_meta":{"origin":575,"position":3},"title":"The electricity price lamp","author":"Heikki Hietala, lab admin","date":"22.12.2022","format":false,"excerpt":"We could say that we are pretty much beginners in this field. One member of the group has done the blender course. In our school we have done so far some coding with java script, css, html and used some code library. In our team were Heidi, Juho, Robert, Hannes\u2026","rel":"","context":"In &quot;3D printing&quot;","block_context":{"text":"3D printing","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/3d-printing\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image-20.png?fit=563%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image-20.png?fit=563%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image-20.png?fit=563%2C750&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":533,"url":"https:\/\/www.hh3dlab.fi\/blog\/3d-robo-lab\/iot-space-adventure-developing-a-retro-arcade-style-handheld-gaming-device-with-esp32-and-fun-controls\/","url_meta":{"origin":575,"position":4},"title":"IoT Space Adventure: Developing a retro arcade style handheld gaming device with ESP32 and fun controls.","author":"Heikki Hietala, lab admin","date":"16.4.2024","format":false,"excerpt":"Introduction Video demonstration: https:\/\/www.youtube.com\/watch?v=9Bk4u3yt4mI GitHub repository: https:\/\/github.com\/Gianou\/Haaga-Helia-IoT-Experimental-Project Our team consisted of three students: David, Isabelle, and Sara. We have diverse backgrounds and sets of skills within IT. Sara is a second year Business Information Technology student from Haaga-Helia. Her major is in digital services and design, but she studies Front-end\u2026","rel":"","context":"In &quot;3D&quot;","block_context":{"text":"3D","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/3d\/"},"img":{"alt_text":"Idea lists","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2024\/04\/upload-4-205x300.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":396,"url":"https:\/\/www.hh3dlab.fi\/blog\/blog\/moon-phases-matrix\/","url_meta":{"origin":575,"position":5},"title":"Moon Phases Matrix","author":"Heikki Hietala, lab admin","date":"12.12.2022","format":false,"excerpt":"by Aliisa Myllym\u00e4ki Introduction Hello, I\u2019m a second-year student at Haaga-Helia, named Aliisa. I have no previous experience with robotics, so I started this course as a blank canvas, open to learn anything and everything. I took this course to see if robotics were something I would feel drawn to,\u2026","rel":"","context":"In &quot;blog&quot;","block_context":{"text":"blog","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image.png?fit=639%2C922&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image.png?fit=639%2C922&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image.png?fit=639%2C922&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts\/575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/comments?post=575"}],"version-history":[{"count":12,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts\/575\/revisions"}],"predecessor-version":[{"id":612,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts\/575\/revisions\/612"}],"wp:attachment":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/media?parent=575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/categories?post=575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/tags?post=575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}