Close
0%
0%

Hydrate Loop

Hydrate Loop is a smart reminder tool that ensures users never forget to drink water throughout the day.

Similar projects worth following
0 followers
Greeting everyone and welcome back.

This is Hydrate Loop, a smart reminder tool that makes sure users never forget to drink water throughout the day.
This Reminder Tool consists of an XIAO SAMD21 Microcontroller and a customized RGB LED board. The LED glows green for two hours; after that, it turns sky blue and begins to flash quickly, signaling to the user that it is time to drink water. The sky-blue led will blink for 60 seconds before turning green again. After two hours, it will revert back to sky-blue, and the process will repeat indefinitely.

The star of this project is the Seeed Studio's XIAO SAMD21 M0 Development Board, which we are pairing with a custom-made RGB LED Board for controlling the WS2812B LEDs.

It is powered by the ATSAMD21G18A-MU microcontroller, which has an ARM Cortex-M0+ 32-bit CPU working at up to 48 MHz and a compact form factor of only 21x17.8mm, making it a suitable device for small projects.

It has 256KB Flash and 32KB SRAM, 11 digital/analog ports, a Type-C interface, and compatibility for the Arduino IDE, making it a perfect Arduino Uno/Nano replacement.

You can check out more details about the XIAO M0 below link:

https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html

The reason for preparing this project was really serious; I frequently forget to drink water while working. This device ensures that this does not happen because I live in India, where the recorded maximum temperature was around 52°C last year, and summer is fast approaching, meaning that I must take this practice seriously.

Heart of the Project - XIAO Microcontroller

The star of this project is the Seeed Studio's XIAO SAMD21 M0 Development Board, which we are pairing with a custom-made RGB LED Board for controlling the WS2812B LEDs.

It is powered by the ATSAMD21G18A-MU microcontroller, which has an ARM Cortex-M0+ 32-bit CPU working at up to 48 MHz and a compact form factor of only 21x17.8mm, making it a suitable device for small projects.

It has 256KB Flash and 32KB SRAM, 11 digital/analog ports, a Type-C interface, and compatibility for the Arduino IDE, making it a perfect Arduino Uno/Nano replacement.

You can check out more details about the XIAO M0 below link:

https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html

Seeed Studio Fusion

Seeed Fusion PCB Service offers one-stop prototyping for PCB manufacture and PCB assembly, and as a result, they produce superior-quality PCBs and fast turnkey PCBAs within 7 working days.

Seeed Studio Fusion PCB Assembly Service takes care of the entire fabrication process, from Seeed Studio Fusion Agile manufacturing and hardware customization to parts sourcing, assembly, and testing services, so you can be sure that they are getting a quality product.

After gauging market interest and verifying a working prototype, Seeed Propagate Service can help you bring the product to market with professional guidance and a strong network of connections.

RGB LED Board

We are repurposing one of our previously Created RGB LED circuits from an old project.

You can check out its article for a more thorough build guide for this circuit.

https://www.hackster.io/Arnov_Sharma_makes/wi-fi-status-box-f3d24f

The XIAO is connected to four WS2812B RGB LEDs via GPIO0. The WS2812B LEDs are all linked in parallel, with the first LED Din wired to GPIO0. The first LED Dout is connected to the Din of the second LED; the second LED Dout is connected to the Din of the third LED, and so on till the fourth LED.

Each LED has its own 100nf decoupling capacitor connected to VCC and GND.

3D DESIGN

The 3D model for this project was quite straightforward; we began by creating the model for the XIAO and WS2812B LED circuit in Fusion 360 and then created a fixture and diffuser-like part that will allow us to secure the setup on top of a laptop. We accomplished this by first making a diffuser part and then connecting the RGB LED circuit to it; the RGB LED will face the diffuser's inner side. For visual emphasis, we also put the phrase Drink Water inside the Diffuser, which will be visible when the LED lights up.

For placing the device on top of the laptop, we created a second holder-like component that will be secured to the rear side of the diffuser with two M2 screws; this component will allow us to position the entire device on the laptop.

Additionally, to add a slight aesthetic...

Read more »

WATER REMINDER v2.f3d

fusion - 607.29 kB - 03/30/2025 at 15:27

Download

WATER REMINDER v2.step

step - 385.78 kB - 03/30/2025 at 15:26

Download

01.stl

Standard Tesselated Geometry - 98.32 kB - 03/30/2025 at 15:26

Download

03.stl

Standard Tesselated Geometry - 15.12 kB - 03/30/2025 at 15:26

Download

02.stl

Standard Tesselated Geometry - 6.92 kB - 03/30/2025 at 15:26

Download

  • 1
    Assembly Process
    • Assembly priocess of this projects begins by pairing XIAO Dev board on the WS2812B RGB LED circuit.
    • We take our circuit and place it over the mounting screw bosses given on the diffuser part using two M2 screws.
    • Next we place the holder part in its place and use two M2 screws to secure it with the diffuser part.
    • At last, we use super glue to attach the Accent line part on the front side of the diffuser.
    • We now place the device on our laptop monitor and power it using a USB Type-C cable connected between our laptop and the XIAO dev board.
  • 2
    CODE

    Here's the code that we prepared and its a simple one. It is designed to control a set of WS2812B LEDs connected to a XIAO ESP32 microcontroller. it alternates between fading a green LED for a soothing effect and blinking a sky-blue LED to signal hydration reminders.

    #include <Adafruit_NeoPixel.h>
    
    // Pin connected to WS2812B LED
    #define LED_PIN 0
    // Number of LEDs
    #define NUM_LEDS 4
    
    Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
    
    // Timing variables
    unsigned long previousMillis = 0;
    const long twoHours = 7200000;         // Two hours in milliseconds
    const long blinkDuration = 30000;      // 30 seconds for blinking
    const long fadeInterval = 20;          // Interval for updating fade (in ms)
    const long blinkInterval = 500;        // Blinking interval in ms
    bool isBlinking = false;
    bool isFading = true;
    
    int fadeBrightness = 0;                // Brightness for fading
    int fadeDirection = 1;                 // 1 for increasing brightness, -1 for decreasing brightness
    
    void setup() {
        strip.begin();
        strip.show();                      // Initialize all LEDs to OFF
        setGreenFade(0);                   // Start with GREEN LED off
        previousMillis = millis();         // Start time tracking
    }
    
    void loop() {
        unsigned long currentMillis = millis();
    
        if (!isBlinking && (currentMillis - previousMillis >= twoHours)) {
            // Two hours passed, start blinking SKYBLUE LED
            isBlinking = true;
            isFading = false; // Stop fading during blinking
            previousMillis = currentMillis; // Reset timer for blinking duration
        }
    
        if (isBlinking) {
            // Blinking logic for SKYBLUE LED
            if (currentMillis - previousMillis < blinkDuration) {
                if ((currentMillis % blinkInterval) < (blinkInterval / 2)) {
                    setLEDColor(strip.Color(0, 255, 255)); // SKYBLUE ON
                } else {
                    setLEDColor(strip.Color(0, 0, 0));     // OFF
                }
            } else {
                // Blinking finished, reset to GREEN fading and restart the timer
                isBlinking = false;
                isFading = true;
                previousMillis = currentMillis;           // Reset timer for the next two-hour interval
            }
        }
    
        if (isFading) {
            // Handle fading effect for GREEN LED
            static unsigned long fadeMillis = 0;
            if (currentMillis - fadeMillis >= fadeInterval) {
                fadeMillis = currentMillis;
    
                fadeBrightness += fadeDirection * 5;      // Adjust brightness
                if (fadeBrightness <= 0 || fadeBrightness >= 255) {
                    fadeDirection *= -1;                  // Reverse direction at min or max brightness
                }
                setGreenFade(fadeBrightness);
            }
        }
    }
    
    // Function to set a specific color for all LEDs
    void setLEDColor(uint32_t color) {
        for (int i = 0; i < NUM_LEDS; i++) {
            strip.setPixelColor(i, color);
        }
        strip.show();
    }
    
    // Function to fade GREEN LED
    void setGreenFade(int brightness) {
        uint32_t color = strip.Color(0, brightness, 0);  // Set green brightness
        setLEDColor(color);
    }

    The Sketch operates on a cyclical timer, reminding users to drink water every two hours.

    if (!isBlinking && (currentMillis - previousMillis >= twoHours)) {
        isBlinking = true;
        isFading = false; // Stop fading during blinking
        previousMillis = currentMillis;
    }
    

    Non-blocking logic ensures smooth functionality, with seamless transitions between fading and blinking modes, offering both practicality and aesthetic appeal.

  • 3
    RESULT

    Here's the end result of this simple yet helpful build: a Water Reminder Tool that fosters a healthy habit of staying hydrated, which is vital for overall well-being.

    By providing periodic visual reminders with soothing and engaging light effects, it gently prompts users to drink water without being intrusive. This can be particularly beneficial for people with busy lifestyles who often forget to hydrate, as well as for individuals aiming to improve their hydration habits. The fading green light creates a calm environment during idle periods, while the blinking sky-blue LED acts as an effective visual cue, ensuring users don't overlook their hydration needs.

    For an updated future version, i would like to make some changes to this device, like for starters, adding an audio feedback, which is better than normal LED signaling and an inbuilt battery that will allow the user to directly power it instead of relying on a USB Port. For now this project is complete and this article provides full build instructions on how you can make this project.

    Leave a comment if you need any help regarding this project. This is it for today, folks.

    Thanks to Seeed Studio Fusion for supporting this project.

    You guys can check them out if you need great PCB and stencil service for less cost and great quality.

    And I'll be back with a new project pretty soon!

View all 3 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates