IoT - Student Helper

by AviaKeren in Workshop > Tools

58 Views, 0 Favorites, 0 Comments

IoT - Student Helper

logo.png

Hi there 👋🏻

In the last two years, we as students faced really hard and challenging times.

As it feels like COVID is here to stay, we wanted to build something that will help us with the study routine to maximize the learning time during the day in order to succeed in the exams!


In the following project we will walk through all the steps in order to implement 4 things that will help all students:

  1. A dedicated feature for when you are studying, that will recognize while you are using your smartphone and will send notifications to your smartphone until you will put it back.
  2. A smart alarm clock that will monitor the daily sunrise, create a zoom meeting and send it to your study friends. This alarm will also turn the AC in your room an hour and a half after the sunrise, so it will be warm and nice when you get up and will wake you up two hours after the sunrise.
  3. Breaks manager will be connected to your tasks application and will help you manage better your time, especially when you are on a break.
  4. Exams day ritual that will help you get through these days. The idea of this feature is to help lower the stress before exams by turning on the TV and the AC so you will get some relaxing time. It will also remind you 15 mins before the exam starts.

Some verbal explanations about what we're going to do: https://youtu.be/WvDB8B6ajJM

A small teaser ;) : https://youtu.be/50i2L_IaEQc

Supplies

In order to implement this entire project you will need:

  • 2 Arduino Circuit Playground Express with ESP8266 connected
  • Smart Phone holder - 3D printer instructions are added, if you have a printer, you can use anything that'll hold your phone above the board and close to it.
  • Sensibo - nice to have but not required

Set Up

Blynk enviorment set-up.png
ESP 8266 chip connecter.png

Installing Arduino IDE for Circuit Playground Express:

  • Download Arduino IDE 1.8.19: https://www.arduino.cc/en/software.
  • Now, when you have the software running, connect the Arduino to the computer USB port.
  • Set the right port under Tools -> Port -> COMXXX (Circuit Playground Express)
  • Set the right board under Tools -> Board -> Circuit Playground Express
  • You can also watch this tutorial: https://www.youtube.com/watch?v=d2c0p3C5owg


Connect the ESP8266 chip to the CPX - use the attached photo for your convenience


Set Up the Integromat:

  • Go to https://www.integromat.com/en/login
  • Create a new account or login


Set Up the Blynk:

  • Go to https://blynk.cloud/dashboard/global
  • Create a new account or login
  • Create a new template, give it the same configuration as in the image
  • Go to search -> new device -> from template -> choose the app you just created and create application.

Set the code:

  • Go to the code, enter your wifi name & pass into the ssid[] and pass[] variables respectively inside the secondary and main code.
  • On Blynk, go to search -> the app you just created -> device info -> copy the board on the top right of the screen to the top of your code.
  • There'll be more guidelines during the instructable.


Using Phone While Studying

WhatsApp Image 2022-02-11 at 11.46.29.jpeg
WhatsApp Image 2022-02-11 at 12.02.52.jpeg

This is the first feature we will implement from the list above.

The idea of this feature is to run while you're studying and to monitor if you're trying to use your phone by using the light sensor. If a phone usage was detected, the CPX board will trigger the Integromat's webhook which will eventually trigger your phone and send you multiple notifications telling you to put down your phone and get back to study until you'll put it back.


HOW?

  1. Create a new scenario in the Integromat and add the following in this order:
  2. Webhooks - This will be the URL to connect to the Integromat, connect and save the URL you get.
  3. Router - this will come in handy later when adding more scenarios to that webhook
  4. Repeaters and sleep tools, this is where you decide for yourself how intense do you want it to be, in our cases we decided to send 3 messages every iteration for 3 iterations with a 10 seconds cooldown in-between each iteration.
  5. in the path between the repeater and the router put the filter if val equal to 1
  6. Finally, connect your phone to the Integromat, there're options for both IOS and Android and decide the title and body of the message.
  7. (attached a screenshot)
  8. Connect the Blynk webhook to the Integromat:
  9. In the template, you created go to Datastreams
  10. Click on edit -> new Datastreams -> Virtual Pin.
  11. Fill in the details like in the attached image click create and save.
  12. Go to settings -> webhooks -> add webhook.
  13. Fill in the name, choose device, DataStream (the virtual pin you have just created), copy the webhook URL from item 1.a, in the webhook trigger event section choose "device sends data to data stream" and in the query parameters section type "val" and give it the value device pin value.
  14. Go back to your template -> web dashboard -> edit -> and drag a slider into the screen -> fill the title and connect it to the Datastream you created in item 2.b.
  15. Set your physical environment:
  16. inside the main CPX code, in the action function, replace the pin you just created in 2.b. with V0 if the pin you just created isn't V0.
  17. Upload the code to the board.
  18. Activate the CPX board holding the main CPX code.
  19. Click on one of the two buttons on the board until you get two blue lights.
  20. Quickly place the CPX board inside the smartphone holder you created.
  21. Place your phone on the Smartphone Holder and activate the CPX board and give it a try!
  22. When you're done studying press one of the two buttons on the board until one blue light is shown to deactivate the sensor.

Smart Alarm Clock

WhatsApp Image 2022-02-11 at 12.30.34.jpeg

The idea of this feature is to run while you're sleeping and monitor the sunrise by using the light sensor. When the sunrise is detected, the CPX board will trigger the Integromat's webhook which will start a countdown of an hour and a half and will activate your AC afterward and another 30 mins countdown after that which will eventually call an alarm clock. In addition, this will send a zoom link to all of your friends.


HOW?

  1. Create a new scenario in the Integromat and add the following in this order:
  2. Go to the scenario you've created in the previous step
  3. Create a second router and connect it to the router you created in the previous step.
  4. in the path between the first and the second router put the filter if "val" equal to 2
  5. From the second router, create a route to a zoom, create a meeting module and connect it to a third router. From the third router create two paths, one to Gmail send a message module with your friends' email and in the body of the message put join URL. and one to google chrome send a notification with the "start URL" in the URL section.
  6. Connect the second path of the second router to a repeater and sleep tool, the repeater is needed because the max sleep time possible is 5 minutes so we repeated that several times, for an hour and a half - use 18 repeats of 300 seconds each.
  7. Connect the sleep module to a router and in the path create a filter dependent on "i" the number of iterations and put the last iteration number.
  8. From the router create one route to an HTTP request that'll turn on the "Sansibo", for more information about the request you can refer here: https://sensibo.github.io/#servers.
  9. From the same router create another route to a repeater and sleep tool, this time give it a 30-minute count (6 repeats of 300 seconds each)
  10. Finally, connect another HTTP request to that sleep tool with a condition on that path base on "j" the number of iterations on the second repeater. In the HTTP request insert the following URL: https://{blynk-server}.blynk.cloud/external/api/update?token={your blynk token}&{pin name}=1 where blynk-server is one of the following: fra1, lon1, ny3, sgp1, blr1.
  11. Connect the Blynk webhook to the Integromat:
  12. In the template, you created go to Datastreams and create another virtual pin, add it in pin_name from 1.i.
  13. Go back to your template -> web dashboard -> edit -> and drag a switch slider into the screen -> fill the title.
  14. Set your physical environment:
  15. inside the main CPX code, in the "BLYNL_WRITE(V1)" function, replace the pin you just created in 2.a. with V1 if the pin you just created isn't V1.
  16. Upload the code to the boards
  17. Activate the CPX board holding the secondary CPX code and put it by the windows (make sure the room is dark when you do so).
  18. Activate the CPX board holding the main CPX code and Place it by your bed.
  19. Have a Good-night, tomorrow you'll wake up to the sounds of the main CPX and will have a zoom link waiting for you
  20. To turn off the main CPX board, just move the switch button.
  21. To re-activate the scenario, move the switch button on the secondary CPX.

Breaks Manager

Task manager.png

The idea of this feature is to get the maximum benefit and productivity out of your daily studying day by connecting to your tasks manager and gain in instructions fitting for each break.


HOW?


  1. Connect to Smart task(https://www.smarttask.io/):
  2. First, try to plan how your day will look like, we chose the following day routing: 9:00, 13:00 and 16:30 study-time begin, 12:00 lunch-break, 16:00 - short break.
  3. after your planned how do you want your day to look like, add the tasks
  4. Connect to Chatwork (https://www.chatwork.com/service/packages/chatwork/pre_register.php?plan=free&lang=en&page=login):
  5. after you and all of your friends signed in, create a chat room and add all of your friends to it.
  6. Create a new scenario in the Integromat and add the following in this order:
  7. First, add SmartTask, watch task completion module.
  8. Create an HTTP request to a time API, we advise you to use this one: https://www.timeapi.io/api/Time/current/zone?timeZone={time_zone} (make sure to fill your time zone).
  9. Create a router
  10. From the router create a path with the filter: date:time (time operator) equal to 12:00. to a second router, this will be the lunch-time router - connect everything related to your lunch to this router (we advise you to connect your phone and send it a message informing you this is a long lunch break and a chrome notification with a link to the current series you're watching on Netflix or any other streaming service).
  11. From the first router create another path with the filter: date:time (time operator) equal to 13:00 or 16:30 (a 9:00 one isn't needed because you already have the smart alarm clock). to a third router, this will be the back to study router - connect everything related back from break (we advise you to connect it to your phone with a notification to get back to study and to the chat workroom you created in step 2, to call your friends to come back to zoom).
  12. From the first router create another path with the filter: date:time (time operator) equal to 16:00. to a fourth router, this will be the short break router - connect everything related to a short break (we advise you to connect it to your phone with a notification that this is a short break and to chrome notification with some short stretching video (https://www.youtube.com/watch?v=KPG1tJW8dwQ) to help you release your muscles a bit) In this case you can also add a time that'll inform you via the board, add repeaters and sleeps and connect it to HTTP request (use the same URL from step 3 1 i).
  13. Set your physical environment:
  14. Activate the CPX board holding the main CPX code and Place it near you.

Exam's Day Ritual

Exam's Day Ritual.png

The idea of this feature is to get you in a calming mood before an exam, the scenario will control everything around you and you need to do is just sit on the couch and relaxed.

HOW?

  1. Connect to your google calendar:
  2. Add all your exams date, make sure they have the "exam" in their name:
  3. Set these events to mail you 30 minutes before each one of them.
  4. Create a new scenario in the Integromat and add the following in this order:
  5. Gmail watch emails module, add the Gmail filter type and query by - subject: exam.
  6. Connect the Gmail module to a router.
  7. From the router create a path to an HTTP request that will control the "Sansibo" (more information can be found in step 3).
  8. From the router create another path to an HTTP request that will send a request to blynk: https://{blynk server}.blynk.cloud/external/api/update?token={app token}&{pin name}=1 (more information can be found in step 3).
  9. From the router create another path and connect it to your phone with some message like "your exam starts in 30 minutes, go chill at the living room".
  10. From the router create another path that'll connect to tools and repeater which will count 15 minutes (3 repeats of 300 seconds each).
  11. Connect the sleep tool to a second router which will hold 2 HTTP requests, one for each CPX board. The first request will be https://{blynk server}.blynk.cloud/external/api/update?token={app token}&{pin name}=1 and the pin name will be the same one we called in step 2. d. The second Request will be to the pin we created for step 3.
  12. Connect the Blynk:
  13. In the template, you created go to Datastreams and create another virtual pin, add it in pin_name from 2.f.
  14. Go back to your template -> web dashboard -> edit -> and drag a switch slider into the screen -> fill the title.
  15. Set your physical environment:
  16. inside the secondary CPX code, in the "BLYNL_WRITE(V2)" function, replace the pin you just created in 2.a. with V2 if the pin you just created isn't V2.
  17. Set the irSend code in the function from 2.a. to point at your protocol and command (use the IR_Reader code on one of the boards and point your t.v controller at it, pressing the turn-off button to detect the right info).
  18. upload the code to the boards.
  19. Activate the CPX board holding the secondary CPX code and put it near the t.v
  20. Activate the CPX board holding the main CPX code and Place it by the couch
  21. Relax
  22. To turn off the main CPX board alarm clock, just move the switch button.

Ace Every Exam!

Blynk layout.png

If you followed all the steps, your integromat scenarios should look like in the steps above and your Blynk app should look like the picture above.

Now that you have everything set up, you can have a stressless exams period with the least responsibility on your shoulders possible.

We hope the instructable was clear enough and that you'll ace all your exams!