You Shouldn't Do It

Get Started

About the Project

Have you ever struggled to do something that you really have to do because you keep losing attention?
For many people that thing is called “studying”.

Why would you need it?



You try to focus, but then a notification arrives on your smartphone and you think that you can afford a little break. When you’re done, you come back and you’re finally ready… right? Well, this is the exact time that your favourite show is on air, it won’t hurt to turn on the tv that is on your desk while you’re studying. But suddenly, your time is over, and you studied nothing!

  • Higher study performances
  • Health care
  • Time optimization

What we propose

Luckily, we can provide a solution! You Shouldn’t Do It targets mainly students that need (and want!) a little hand to keep their focus and optimize their time while being in their own study room. Our system reaches all the devices that could act as “distractions”, and disables them while you are studying (you will need to apply some “stickers” on your old-style distractions, like solitaire cards, and keep them in a safe place where we can check them during your work). As time goes and you keep up with your duty, you can earn some “break” points that can be spent to rehabilitate the craved devices for some time, to relax.

Beware, though, that the time spent sitting in front of the desk while daydreaming or playing solitaire won’t earn you anything! Indeed, YSDI can sense whether you are writing/speaking/turning pages frequently enough or not, and updates points accordingly to it. The “studying” action can be recognized through a special kind of writing desk together with the presence of the user sitting in front of it (the actions on the PC are also monitored). If it feels like the user is just distracted, losing time, without any spare points to be used, it recalls his attention back by playing unmistakable sounds and coloring the room with a red light. This feature can be disabled if needed, but also customized to accommodate those who want to waste as little time as possible, or those who simply would like to pick something more pleasant for their ears/eyes.





Furthermore...

  • YSDI wants to be the best friend of the student and knows that the human attention-span lasts for 45 minutes at most before concentration gets down; therefore, it understands when you deserve a short break. You might need a coffee and the system can turn on the coffee machine for you. When it notices you keep distracting yourself, it also suggests different options like a nap or a walk outside to relieve your mind.
  • Another supporting functionality to set a correct and pleasant environment where to study is playing customizable background sounds that help not being distracted from some spare external noises.
  • Moreover, we know that studying is a seriously threatening activity for one’s health, and health comes first. The system automatically adjusts lights in the room to be sure you don’t strain your eyesight. In particular when it gets dark outside and the natural light fades away YSDI regulates the right kind of lights inside the study room according to the user activity.
    It might sound futile, but it plays a big role in your aging.

In conclusion

Everyone is smart enough to study, you just need the right mindset,
so don’t waste your time doing something you shouldn’t do!

Aspects of AmI Systems

Sensing

Acquisition of data from the environment.

Reasoning

Data processing through some algorithms.

Acting

Practical changes on the environment based on sensing.

Interacting

Possibility of the user to communicate with the system.

Sensing

It recognizes if the student is really studying by sensing his actions on the writing desk, by detecting them sitting at the desk and by catching the sounds they produce when repeating the lesson.

YSDI also monitors the student’s activity on the basis of the Web-sites they are surfing-on or the programs they are running on their PC-desktop.

Reasoning

It combines the information acquired from the sensors to have an accurate perception of the real activity of the user. It correspondingly updates the scoring for the “break” points which the student can spend to get access to his favourable leisure devices.

Moreover, it understands when it’s time for a break to earn back energies and the needed concentration.

Acting

It acts by regulating the lights in the room to guarantee the best condition for the user basing on the their necessity and on the natural light coming from the outside.

It keeps control over the distraction devices.

It can produce background sounds helping the user focusing on the subject.

It activates the coffee machine if the user selects the "coffee-break" when a pause from study is suggested.

Interacting

It draws the user’s attention when it perceives they are getting way too distracted, even keeping track of the websites visited on pc.

It can suggest when they should be taking a break and proposes different options, like a nap or a walk outside, based on how frequently they are getting distracted.

AmI Features

These features are typical of AmI systems.
We believe our system shares all these, at least to a certain extent.

Sensitive

It keeps track of whether the user is studying or not by checking if they write/speak.

It perceives the luminosity in the room.

Responsive

It responds to the user’s behaviour acting mainly on the devices, but also keeps you on track if you get distracted.

Adaptive

It sets the environment to be optimized for comfortable and focused studying.
Its behavior varies if you study or you don't.

Transparent

It interacts in a very autonomous way with the user, without the need of complex interfaces,
but it also needs to be "opaque", in the sense that the user should not be able to pass through it.

Ubiquitous

It involves every distracting device in the room, but it is confined in that region.

Intelligent

It understands the behavior of the user to avoid distractions and cheating as much as possible.

Architecture

The goal of the system is to aid those who strive to stay focused while studying and want a little help to accomplish this.
It has to physically deny frequent access to distraction devices, such as, but not limited to: TVs, smartphones and portable consoles.

Nonetheless, YSDI doesn’t want to encage the user: it recognizes when the user is studying thanks to numerous sensors,
and thus grants proportionate leisure rehabilitating the devices through a score-based system. Specifically, it can identify when
the student needs a break by detecting when they are distracting too frequently and, accordingly, it can respond by
suggesting an outside walk or by preparing a coffee with a machine. Moreover, the system can also reproduce relaxing background sounds
to overcome disturbing noise and it can adapt internal room-light according to the actual environment brightness
in order to avoid long-term sight damage.

Although the system has several aiding features, it cannot force someone to study if they really don’t want to. Therefore, it can try to
make the user realize when they waste their time, and setup a positive environment, but it won’t act as a jailer that has to
prevent prisoners from escaping: there are lots of ways to get around this system, and preventing these is out of our scope, since
it is supposed that the user is a little bit self-conscious and works “in symbiosis” with YSDI.

Feature Priority
1 Keep track of when the user is sitting on a chair, speaking, using the writing desk or visiting study-related websites to automatically earn points. 1
2 Suggest a short break if the user is getting distracted too frequently. 1
3 Recall user’s attention by playing unmistakable sounds and by emitting strobe red-light when they have been distracted for long. 1
4 Disable devices that don’t have a battery (like TVs or gaming consoles), to be reactivated later spending earned points. 1
5 Regulate lights on the desk when the user is sitting on the chair, according to the environment brightness conditions. 2
6 Activate automatic coffee machine from remote, to avoid wasting of time. 2
7 Reproduce background sounds to overcome external noise that could drive your attention away. 2
8 Understand if the old-style distractions which Bluetooth stickers are applied on are being kept away. 3
9 Disable mobile devices through ad-hoc designed software. 3
10 Keep track of the user’s offline activities on the PC, scanning running processes. 3
11 Provide playlist customization. 3

What do the colours mean?

Core Distracting devices Environment Marginal

Hardware Components

  • Off the Shelf:
    • Raspberry Pi board (model B +)
    • Arduino Yun board
    • Arduino Uno board
    • Force sensitive resistor (IEFSR)
    • Load cell amplifier (HX711)
    • Razberry daughter card supporting Z-wave protocol
    • Z-wave smart programmable & controllable plug
    • Z-wave multisensor (to measure environment brightness)
    • Dimmable multicolor light bulb (Philips Hue)
    • EwEnt multimedia microphone
    • Music speakers (Music HP1800)
    • Bluetooth beacons

  • Ad-Hoc:
    • Writing desk which the student can use to write and to lean the book or the notes they are studying on.

Software Components

  • Libraries for sensors managed by Arduino boards: “HX711.h”, a special purpose library for the load cell amplifier, “Bridge.h”, “HttpClient.h”, “YunClient.h” and “SPI.h” for the chair pressure sensor and to transmit data from the Yun to the Raspberry in WiFi
  • sqlite3 to store accumulated sensor data in a database
  • Flask: v0.12.2
  • PyAudio: v0.2.11
  • pyserial: v3.4
  • requests: v2.18.4
  • “rest.py” provided by the teachers of this course for Z-Wave
  • “MultiThreading” module, developed by us for the Raspberry Pi computational node
  • “userPCapp” module, developed by us to keep track of the user’s activities thanks to their pc
  • YouTube API (for future improvement): to retrieve playlists and grant a personalized sound experience.


(Click on the image to see a more detailed version, reclick to reset)

  • Computational nodes:
  • Raspberry Pi: core of the entire system, it is meant as a local server, with a web interface as well. It receives and processes data from the following: Arduino Yun (chair), Arduino Uno (writing desk), z-wave multi, user’s pc (microphone and browser history), bluetooth beacons.
    It acts on: lights, loudspeaker sounds, z-wave plugs, ad-hoc software for mobile devices.

    User’s PC: it runs a software to keep track of the user’s browsing history (only Google Chrome for the demo) and also understand when they speak, therefore communicating with the central node.

    Arduino Yun: it interfaces with the IEFSR sensor on the chair and communicates variations via Wi-Fi.

    Arduino Uno: connected to the load cell under the writing desk, this node evaluates if significant variations happen, and delivers the refined data to the central core.

    Mobile devices: these run ad-hoc software that disables them for the study session. They can be reactivated with points or in case of emergency.

  • Sensors:
  • 4-in-1 Z-Wave sensor: it allows proper control of the light in the room where it’s placed.

    EwEnt multimedia microphone : it perceives when the user is speaking, maybe repeating a lesson.

    Load cell amplifier: placed underneath a writing desk to detect when the student is writing, or even turning pages.

    Force sensitive resistor (IEFSR): it checks if the user is sitting on the chair.

    Bluetooth stickers: to keep track of how far old-style distractions are from the user.

  • Actuators:
  • Z-Wave plugs: actuators that can electrically disable the devices connected to them. They are placed between the devices and the electrical supply.

    Loudspeaker: this allows to reproduce relaxing sounds to overcome external disturbance, but also to recall the user’s attention with mighty alarms.

    Philips Hue light bulb: the actuator to keep the luminosity at a reasonable level in the room. It’s also used to recall the attention.

  • Interfaces:
  • There are no dedicated interface devices besides the user’s pc.


  • Central Computational Node:
  • a server application running on the central core, Raspberry Pi. It offers an HTTP API for those modules that communicate via local network (user’s PC and Arduino Yun). It performs the remaining connections with a USB cable to Arduino Uno, Bluetooth for stickers and through external APIs for Z-Wave. Developed by our team. The features operated by this software are:

    • Managing the score: YSDI rewards the user with some relaxing minutes for the time they spend truly studying
    • Understanding the behavior: recall the attention or suggest a break
    • Processing data from sensors
    • Regulating the luminosity in the room
    • Disabling devices, so they can be reactivated later on spending points
    • Playing background sounds to cover external disturbance with something pleasant

  • Web Interface:
  • it is part of the server application hosted on the central core, although logically distinct. This is the website that the user interacts with to learn useful info and manage their study session and score. Playlists will be customized from here, too.

  • PC usage:
  • a desktop application running on the home PC to check the activity of the user when surfing the net and running programs. Developed by our team.

  • Microphone Check:
  • this piece of software acts as a gateway between the data collected on the microphone, which is connected to the PC, and the central core computations. It helps to understand the user’s activities. It actually is a different thread of the same desktop application of the PC usage to reduce the number of processes, but it is logically distinct.

  • Arduino Gateways:
  • specific software running on the Arduino’s to collect data and send them to the central core lightly refined. Important to understand the user’s activities.

  • Ad-Hoc Mobile Software:
  • this code is device-specific and is intended to disable it during study sessions. It communicates with the central core, which can then “unlock” it.


YSDI network develops mainly around two communication protocols: the WiFi protocol for the transmission in the local network and the Z-Wave protocol for interaction with Z-Wave devices installed inside the room ecosistem. Low level sensors are directly connected to Arduinos and communicate through them. Specifically, the system core, the Raspberry Pi board, uses the integrated WiFi card to retrieve data (in upstream direction) from the Arduino Yun and to communicate with the Philips Hue bridge (present inside the same network) for the smart bulb light control.

On the other side, the Z-Wave protocol allows the Raspberry to interact with the smart plugs and the multi-sensor (needed to measure the environment luminosity). In addition, Bluetooth is employed to keep track of the beacons which are applied on old-style distraction (as gaming cards) to monitor their presence inside the room. Finally, the system includes some wired interconnections: USB cables and a jack audio connectors. The former ones are employed to power up the speakers and Arduino Uno, as they also allow serial communication with the core unit, while the latter is needed to interface the speakers with the same Raspberry.

Encountered Issues

Here we keep track of the biggest problems we face while pursuing our goal.

  • We tried several times before we could get those right.
    We are sorry for the spam on the GitHub log, hopefully it won't happen again!

  • We understood that there are way too many possible distracting devices that have an internal battery.
    We then thought that it would simply be easier to lock those in a box that you can unlock with points, like everything else.
    While discussing with the teachers we were suggested to abandon our idea and treat the rest of the system as if
    we could really write such a blocking code, but mark this burden as a priority-3 feature.

  • We had several ideas to solve the problem: most of these were based around sensing a special
    kind of pen/pencil that would have been built for the occasion.
    Speaking with the teachers it became clear that our idea would have been challenging to realize.
    We then tested a load cell, which is meant to be placed under a writing desk, and it revealed
    such a high sensitivity that we can now detect when a page has been turned.

  • With our first tests after reflashing the OS we had serious doubts: it took more than 5 minutes just
    to open a browser, and many things weren't working as expected. We evaluated moving the computations
    on an external server. While time was flowing quickly, we had one member of our team focused
    exclusively on making this "great" device work: from a resource point of view, this is a huge cost
    that we didn't deserve to pay. It wasn't just us being dumb: it also took a couple of hours of
    assistance in lab to get it pseudo-working, in total.

  • We definetely thought so. We tested all the modules of our project on the pc, and they worked
    just fine. When we tried those on the Raspberry board we lost some time just to read online
    that we could only connect loudspeakers, because it doesn't allow input from there.
    This issue was a big cost as well, since it forced us to change the architecture of
    the system and change some modules in the last weeks at our disposal, in order to
    accomodate the new architecture. It could have helped knowing more about this device.

Our Team

Group 15

Edoardo Calvi

s224965
s224965@studenti.polito.it
ThatDodoThough
Software Developer

Matteo Garbarino

s224352
s224352@studenti.polito.it
MatteGarba
Software Developer

Gianluca Moret

s223074
gianluca.moret@studenti.polito.it
GianluMoret
Hardware Designer

Oliviero Vouch

s226777
oliviero.vouch@gmail.com
OlivieroVouch
Hardware Designer