Morning Routine IOT

by tomha1 in Circuits > Arduino

203 Views, 2 Favorites, 0 Comments

Morning Routine IOT

morning routine IOT.png
Morning Routine IOT
circuit playground express board.jpg
חיבורים בין הלוח לesp.png

Hardware components :

  • Adafruit Circuit Playground Express
  • ESP8266
  • Micro USB cable
  • SmartPhone
  • Internet access (Wi-Fi)

Websites:

Adafruit Circuit Playground Express (Cpx)

Blynk IoT platform

Arduino IDE

Software and Apps :

  • Blynk app
  • Arduino IDE

Define the Environment

e306f9d5-5cab-4064-b465-6b5d8eabe1ad.jpg

Arduino IDE

Dounload and install Arduino IDE.

Install ESP8266 in Arduino IDE.

Blynk

Download the Blynk App from App store/Google play.

Sign up to Blynk via the App.
It is recommend that you use a valid email address, as it will simplify things later.
A Blynk account is used to save your projects and enable access from multiple devices from anywhere.

After you have successfully logged in, create a new project and choose the ESP8266 device and Wi-Fi as the connection type.

The authentication token will be sent to you and also shown in the settings of your project. A new number will be generated for each project you create.

The canvas is empty, click anywhere on it to open the widget box. Here are all the available widgets. Widget Settings - Each Widget has its own settings. Tap on the widget to get to them.

Choose the Widgets

WhatsApp Image 2021-08-31 at 19.04.11.jpeg
WhatsApp Image 2021-08-31 at 19.04.11 (2).jpeg
WhatsApp Image 2021-08-31 at 19.04.11 (1).jpeg
WhatsApp Image 2021-08-31 at 19.04.11 (3).jpeg

Controllers:

  • Button
  • Timer
  • zeRGBa


Displays:

  • Gauge


Notifications:

  • Email


Smartphone Sensors:

  • Accelerometer

Wake Up With the Cpx Alarm Clock

WhatsApp Image 2021-08-31 at 19.34.51.jpeg

Blynk:

I added the Timer controller widget with the name "Alarm Time". Timer set to virtual pin V9, Start time: 07:00 AM, Stop: 07:02 AM.


Code:

Jingle bells melody coded to Cpx and I wrote the function "BLYNK_WRITE(V9)" that will trigger at Timer Start time. The melody will play in 7:00 for maximum 6 times one after another. In order to stop the alarm you have to rotate the cpx board 180 degrees.

Choose the Light Color

927afcff-0249-4b58-b729-1a187edbaddd.jpg

Choose the mood lighting you want.


Blynk:

I added the zeRGBa controller widget. The output is in "Merge" mode and set the virtual pin to V0.


Code:

Wrote the function "BLYNK_WRITE(V0)" that will set the pixels colors by the board of zeRGBa in the app.

Rainbow Light Cycle

accelerometer.jpg



Blynk:
I added the Accelerometer smartphone sensor widget. Set the virtual pin to V3.


Code:
Wrote the function "BLYNK_WRITE(V3)" that will start a rainbow cycle animation If you flip your smartphone off, and will turn off when we flip the smartphone back on.

What to Wear by Weather Outside

WhatsApp Image 2021-08-31 at 20.27.22.jpeg
WhatsApp Image 2021-08-31 at 20.27.22 (1).jpeg

Take the Cpx board out of the Window and find out the temperature outside. The Cpx Will Tell You What to Wear Based on That:


Blynk:

Add the Button widget. Set the virtual pin to V2 and to "switch" mode.
Add the Email widget. Set the Email adress.

Code:

Wrote the function "BLYNK_WRITE(V2)" that checks the temperature in Celcius and then checks 3 cases and acts different dependence the case. if the temperature equal to or higher than 30 Celcius so the case "Hot" starts. If the temperature between 23 degrees to 29 degrees so case "MILD" starts. Any other result will handle by case "Cold".

Hot case: Email sends to Inbox with Recommendation to wear short clothes cause it hot outside. Cpx Start blinks 3 times to represent the case, with All Red pixels lights on.

MILD case: Email sends to Inbox with Recommendation to wear regular outfit cause it between hot and cold outside. Cpx Start blinks 3 times to represent the case, with All Green pixels lights on.

Cold case: Email sends to Inbox with Recommendation to wear long clothes cause it cold outside. Cpx Start blinks 3 times to represent the case, with All Blue pixels lights on.

Fire and Noise ALARM

8b0c908e-6b19-43f7-a059-a8bf93cec1cc.jpg

When you leave your home, a fire alarm and a noise alarm will be activated to alert you if something has happened while you are not home.

Blynk:

I added the Gauge widget to show the temperature from Cpx, and the Email widget is the same as previously added. Gauge set to pin V5, and range set between 18 and 60.
The email widget is the same one I previously added.

Code:

I wrote inside loop(): "Blynk.virtualWrite(V5,tempC)" this function keeps "Gauge" widget updated with recent temperature.
The cpx will send Fire Alarm notification to the Email when the temperature rises above 50 celsius degrees.

I wrote inside loop(): if (silence = CircuitPlayground.mic.soundPressureLevel(50) > 95) then the cpx will send Noise Alarm notification to the Email when a load noise sound in the house.

FINISH!

WhatsApp Image 2021-08-31 at 21.26.47.jpeg
84052299-cf0d-4b32-9780-2b5a5aad3a7b.jpg

You can arrange and organize the Blynk board as you wish and get going.

Or you can try my Morning Routine IOT app.

To start using it:

1. Download Blynk App: http://j.mp/blynk_Android or http://j.mp/blynk_Android

2. Touch the QR-code icon and point the camera to the code below

3. Enjoy my app!


Good Morning!