WakeSecure

by amirkap in Circuits > Mobile

143 Views, 4 Favorites, 0 Comments

WakeSecure

IOT Alarm System / Clock.

In this project, we developed an IoT-enabled alarm system and alarm clock using the Arduino ESP32. This multifunctional device combines the features of a traditional alarm clock with an alarm system, enhanced by modern IoT capabilities. It includes sensors to monitor environmental factors, triggering an alarm for security purposes or to alert users to specific conditions. Additionally, when the alarm clock is stopped, the device provides daily information such as weather updates, historical events and interesting facts, adding a unique touch to the user's morning routine. The integration with the internet allows for remote control and customization, making it a versatile and convenient solution for modern living.

Supplies

  • Arduino ESP32

The following sensors for Arduino ESP32:

  • Microphone
  • Light sensor
  • Speaker x2
  • I2S
  • Led Strip
  • Power Supply/Battery

Setting Up the Hardware

WhatsApp Image 2024-03-17 at 14.29.51.jpeg
  1. Connect the Microphone: Connect the microphone to the analog input pin (e.g., GPIO 34) on the ESP32.
  2. Attach the LED Strip: Connect the LED strip's data input to a digital output pin (e.g., GPIO 5) on the ESP32.
  3. Hook Up the Speakers: Connect the speaker to the I2S pins (e.g., GPIO 25, 26, and 27 for DOUT, LRCK, and BCLK, respectively). Connect the 2nd speaker to GPIO 21.
  4. Connect the Light Sensor: Connect the light sensor to the analog input pin (e.g., GPIO 35) on the ESP32.
  5. Power Supply: Connect the power supply or battery to the ESP32, ensuring it provides the necessary voltage and current for your components.

Setting Up the Software

  1. Install Arduino IDE: If you haven't already, download and install the Arduino IDE from the official website.
  2. Install ESP32 Board: Follow the instructions here to add the ESP32 board to your Arduino IDE.
  3. Install Required Libraries: Install the following libraries using the Library Manager in the Arduino IDE:
  • Blynk
  • Adafruit NeoPixel
  • ArduinoJson
  • Audio (for I2S speaker output) - Download from https://github.com/schreibfaul1/ESP32-audioI2S

4. Load the Sketch: Copy the provided sketch into a new Arduino sketch file.

Downloads

Configuring Blynk

WhatsApp Image 2024-03-17 at 14.49.44.jpeg
WhatsApp Image 2024-03-17 at 14.49.45.jpeg
  1. Set Up Blynk on the Website: Go to the Blynk website and sign up for an account. Create a new template for your project, and note the Template ID and Device Name. Use these to replace the placeholders in your Arduino sketch (BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME).
  2. Generate Auth Token: In your template, create a new device. Blynk will generate an authentication token for this device. Copy this token and replace the placeholder in your Arduino sketch (BLYNK_AUTH_TOKEN).
  3. Set Up Blynk App: Download the Blynk app on your smartphone and log in. Create a new project in the app using the same template you created on the website. Select ESP32 as the device and Wi-Fi as the connection type.
  4. Add Widgets: Add widgets to your Blynk app as shown in the picture.
  5. Configure Widgets: Assign virtual pins to each widget as defined in the sketch (e.g., V0 for the clock button, V3 for the time slider), see picture.


Finalizing and Testing

WhatsApp Image 2024-03-17 at 15.00.47.jpeg
  1. Enter Credentials: In the sketch, fill in your Wi-Fi SSID and password.
  2. Upload the Sketch: Connect the ESP32 to your computer and upload the sketch using the Arduino IDE.
  3. Test the System: Once uploaded, test the system by interacting with the Blynk app and observing the behavior of the alarm system and clock.

Conclusion

Congratulations! You've successfully created an IoT alarm system and clock with the Arduino ESP32.

With this project, you can start your day informed and secure, with the convenience of IoT technology at your fingertips.