Introduction: IoT Kit: Self Stress Reduction
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:
- Short demo: https://www.youtube.com/watch?v=Ey7w1-B9fYU
- Full tutorial: https://www.youtube.com/watch?v=4iIKyHKX2Ko
Supplies
Those all the components are needed for our kit:
Hardware Components:
- ESP32 microcontroller
- Adafruit NeoPixel LED strip
- DHT22 temperature and humidity sensor
- Servo motor
- Joystick button
- Light sensor
- Battery pack for portability
- Connecting wires
- Breadboard (optional)
- Essential oil diffuser
Software Components:
- Blynk app for controlling and monitoring the system
- make.com for handling web service interactions
- Arduino IDE for programming the ESP32 (attached code)
Attachments
Step 1: Assemble the Hardware
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.
Step 2: 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.
Step 3: Program the ESP32
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.
Step 4: Configure Blynk App
Create a New Project
- Open the Blynk app on your smartphone.
- Tap the “New Project” button.
- Enter a project name, select the ESP32 board, and tap “Create.”
- 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.”
Step 5: 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.
Step 6: Testing and Calibration
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.
Step 7: 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.