IoT Kit: Self Stress Reduction

by GuyG51 in Living > Health

197 Views, 0 Favorites, 0 Comments

IoT Kit: Self Stress Reduction

Self Stress Reducer - Short demo

This Stress Reduction IoT Kit integrates multiple technologies to provide a comprehensive solution for reducing stress and promoting relaxation. Its portability, ease of use, and integration with various IoT platforms make it a versatile tool for users seeking a more relaxed and stress-free environment. The project demonstrates the potential of IoT in enhancing everyday activities and improving overall well-being.

You can find here some videos about the kit:

Supplies

2.png

Those all the components are needed for our kit:


Hardware Components:

  1. ESP32 microcontroller
  2. Adafruit NeoPixel LED strip
  3. DHT22 temperature and humidity sensor
  4. Servo motor
  5. Joystick button
  6. Light sensor
  7. Battery pack for portability
  8. Connecting wires
  9. Breadboard (optional)
  10. Essential oil diffuser

Software Components:

  1. Blynk app for controlling and monitoring the system
  2. make.com for handling web service interactions
  3. Arduino IDE for programming the ESP32 (attached code)

Downloads

Assemble the Hardware

4.jpg
Screenshot_20240801-094438~2.png

At first, we will connect all the hardware components to the microcontroller:


Connect the ESP32 to the Battery Pack:

  • Connect the battery pack to the power pins of the ESP32.

Connect the Adafruit NeoPixel LED Strip:

  • Connect the data pin of the LED strip to GPIO 14 on the ESP32.
  • Connect the power and ground pins to the 3.3V and GND pins on the ESP32.

Connect the DHT22 Sensor:

  • Connect the data pin to GPIO 4 on the ESP32.
  • Connect the power and ground pins to the 3.3V and GND pins on the ESP32.
  • Place to sensor outside of the box.

Connect the Servo Motor:

  • Connect the control pin to GPIO 16 on the ESP32.
  • Connect the power and ground pins to the 3.3V and GND pins on the ESP32.
  • Connect the motor with a thin thread to a bottle of lavender oil.

Connect the Joystick Button:

  • Connect the button pin to GPIO 17 on the ESP32.
  • Connect the power and ground pins to the 3.3V and GND pins on the ESP32.

Connect the Light Sensor:

  • Connect the data pin to GPIO 36 (analog input) on the ESP32.
  • Connect the power and ground pins to the 3.3V and GND pins on the ESP32.
  • place the sensor inside the box.

Set Up the ESP Software

Install the Arduino IDE:

  • Download and install the Arduino IDE from here.

Install the ESP32 Board Package:

  • Open the Arduino IDE and go to File > Preferences.
  • In the "Additional Board Manager URLs" field, enter: https://dl.espressif.com/dl/package_esp32_index.json
  • Go to Tools > Board > Board Manager, search for "ESP32" and install the package.

Install Required Libraries:

  • Install the Blynk library by going to Sketch > Include Library > Manage Libraries, then search for and install "Blynk."
  • Install the Adafruit NeoPixel, DHT, and Servo libraries similarly.

Program the ESP32

4.png

Use to supplied code above to program the ESP32.


Write the Code:

  • Open a new sketch in the Arduino IDE and write the code to control the components.

Update your parameters:

  • Enter your Wi-Fi SSID and password in the code
  • Enter your friend's phone number and name.

Upload the Code:

  • Connect the ESP32 to your computer using a USB cable.
  • Select the correct board and port in the Arduino IDE (Tools > Board > ESP32 Dev Module, Tools > Port).
  • Upload the code to the ESP32.

Configure Blynk App

5.png

Create a New Project

  1. Open the Blynk app on your smartphone.
  2. Tap the “New Project” button.
  3. Enter a project name, select the ESP32 board, and tap “Create.”
  4. You will receive an Auth Token via email. This token is necessary to connect your hardware to the Blynk app.


Add Widgets:

Gauge Widget (Temperature):

  • Tap on the canvas to open the widget box.
  • Select the “Gauge” widget.
  • Place it on the canvas and tap to configure.
  • Set the name to “Temperature” and choose virtual pin V0.
  • Set the range (e.g., 0 to 50 degrees Celsius).

Gauge Widget (Humidity):

  • Tap on the canvas to open the widget box.
  • Select the “Gauge” widget.
  • Place it on the canvas and tap to configure.
  • Set the name to “Humidity” and choose virtual pin V1.
  • Set the range (e.g., 0 to 100%).

Button Widget (Breath Train Start):

  • Tap on the canvas to open the widget box.
  • Select the “Button” widget.
  • Place it on the canvas and tap to configure.
  • Set the name to “Breath Train Start” and choose virtual pin V2.
  • Set the mode to “Switch.”

Labeled Value Widget (Breath Counter):

  • Tap on the canvas to open the widget box.
  • Select the “Labeled Value” widget.
  • Place it on the canvas and tap to configure.
  • Set the name to “Breath Counter” and choose virtual pin V3.

Button Widget (Diffuser):

  • Tap on the canvas to open the widget box.
  • Select the “Button” widget.
  • Place it on the canvas and tap to configure.
  • Set the name to “Diffuser” and choose virtual pin V4.
  • Set the mode to “Switch.”


Integrate Make.com

Set Up make.com:

  • Create an account on make.com.
  • Set up three scenarios: one for sending an SMS, one for starting a music playlist in Spotify, and one for stopping the music.
  • Use a webhook to trigger each scenario when the respective button is pressed in the Blynk app.

Send SMS

  • Create a new scenario and add a webhook module.
  • Configure the webhook URL and note it for later use.
  • Add an SMS module and configure it to send an SMS to a specific phone number.

Start Music Playlist

  • Create a new scenario and add a webhook module.
  • Configure the webhook URL and note it for later use.
  • Add a Spotify module and configure it to start playing a specific playlist.

Stop Music

  • Create a new scenario and add a webhook module.
  • Configure the webhook URL and note it for later use.
  • Add a Spotify module and configure it to stop playing the current music.

Integrate all API requests for those workbook into the esp32 code.

Testing and Calibration

Screenshot_20240801-094342.png

Test Each Component:

  • Verify that the LED strip guides breathing exercises correctly.
  • Ensure the emergency button sends an SMS.
  • Test the diffuser to dispense lavender oil.
  • Check the environmental monitoring for accurate temperature and humidity readings.

Calibrate Sensors:

  • Adjust the sensors and code as necessary to ensure accurate readings and functionality.

Enclose Components:

  • Place all components in a suitable enclosure for portability and protection.
  • Ensure the battery pack is securely connected and accessible for recharging.

Label and Document:

  • Label all connections and components for easy identification.
  • Document the setup and usage instructions for future reference.

Enjoy and Relex

The Self Stress Reduction IoT Kit is a sophisticated blend of hardware and software that offers a multifaceted approach to stress management. By integrating environmental monitoring, guided breathing exercises, aromatherapy, and automated music playback, the kit provides a holistic solution to enhance relaxation and well-being. The use of an emergency alert system adds a layer of safety, ensuring quick assistance during high-stress moments. Its portability and seamless integration with IoT platforms like Blynk and make.com highlight the potential of technology to improve everyday life.

We hope this kit helps you reduce stress and relax.