Tv Smart Timer con Arduino

(English version below)
Un pensiero con cui i genitori si devono confrontare quotidianamente è quello di porre un limite al tempo in cui i pargoletti sono davanti alla televisione. Sappiamo tutti i danni che può fare l’eccessiva esposizione allo schermo domestico! Una regola potrebbe essere: massimo due ore di TV al giorno, magari distribuite lungo la giornata. La parte facile è stabilire le regole, il problema sta nel farle rispettare! E poi come si fa a contabilizzare i minuti in modo che non si oltrepassi il limite stabilito? Un modo per arginare (non azzerare, perché questo non è possibile…) le continue discussioni quotidiane sulla TV e per rendere semplice il conteggio del tempo è quello di sfruttare la tecnologia. Un timer TV come quello oggetto di questo post, si propone come una possibile soluzione al problema.

Tv Smart Timer
Il TV Smart Timer, che possiamo abbreviare in STS, è pensato per essere semplice da usare, sia per i bambini che per i genitori. Il bambino ha a disposizione un certo tempo stabilito dal papà o dalla mamma e lo può gestire come vuole durante la giornata. Il tempo disponibile, visibile dal display, può essere controllato dal bottone rosso che si vede nella foto. Quando il bambino vuole vedere la TV (naturalmente dopo aver fatto i compiti!) preme il bottone rosso, che dà corrente alla TV e nel contempo fa partire il timer, scalando da quel momento in poi il tempo disponibile. Quando per qualsiasi motivo si vuole fermare la visione, basta premere di nuovo il bottone rosso, il timer si ferma (compare la scritta "Paused") e la TV si spegne. Inoltre il display comincia a lampeggiare lentamente quando rimane meno di un'ora, così il bambino può decidere cosa fare del tempo rimanente.
In questo modo il bambino impara a gestire il suo "tempo TV" ed i genitori sono sicuri che il tempo giornaliero stabilito non viene sforato. Il timer dispone di un orologio datario interno con cui, allo scadere del giorno, resetta il tempo disponibile alla durata iniziale. Non c'è quindi bisogno che il genitore resetti manualmente il tempo per il giorno seguente. 
Il genitore accede alle impostazioni del timer tramite una speciale "chiavetta" (in basso nella foto). Inserendo la chiavetta nell'alloggiamento previsto, si abilita una speciale menù da cui si può regolare l'orologio interno, stabilire il tempo massimo e resettare manualmente il timer. A chiavetta inserita, il timer viene disabilitato ed il televisore è sempre alimentato, così da permettere ai grandi di guardare la TV senza ... limiti di tempo. Naturalmente a chiavetta inserita il timer è disabilitato, il count-down si ferma e quando la si toglie il timer viene riabilitato.
Il TST è costruito tutto intorno ad Arduino, utilizzando un Arduino Uno, un display LCD a 2 righe per 16 caratteri e un orologio RTC.

Schema di massima del timer
La chiavetta è realizzata in maniera molto semplice: ho utilizzato una spina RJ45 (quelle per i cavi di rete per intenderci) con una resistenza di un dato valore su due degli otto contatti. Facile da costruire o da rifare in caso si dovesse perdere o rompere.

Complessivamente TST è costituito dai seguenti componenti:
  1. Un Arduino Uno
  2. Un shield LCD 2 x 16 caratteri
  3. Un modulo RTC con DS1307
  4. Un relè 5V
  5. Un grosso pulsante
  6. Una presa RJ45
  7. Una spina RJ45
Lo schema elettrico e il codice sorgente che fa funzionare il timer si può trovare qui (Github).
Nella foto qui sopra il relè non si vede perché è posto in una scatola separata, vicino alla presa di corrente della TV, sia per ragioni di praticità che di sicurezza.

L'alloggiamento del relè vicino la presa elettrica


English translation:

An Arduino based TV Smart Timer

A concern that parents have every day is to limit the time their children spend watching television. We all know the damage that excessive exposure to a TV screen can make! One can impose a rule like "a maximum of two TV hours per day", even distributed over the course of the day. The easy part is setting the rules. The problems come when children have to comply them! And how do you take into account the time elapsed, so that kids do not exceed the time limit agreed? Relying on technology could be one way to cut down (not to cut out, this is impossible ...) the daily discussions. Technology could also count the minutes for us. A TV Smart Timer, like the one in this post, could be the possible solution to this problem.
The TV Smart Timer, which we can shorten to TST, is designed to be easy to use, for both children and parents. Everyday there is a certain amount of time available for the child to watch TV. It is set up by his/her dad or mom and he/she can handle it as he/she likes during the day. The time available, shown on the display, can be controlled by the big red button in the picture. When the child wants to watch TV (of course after the homework is done!) he/she presses the red button, which turns on the TV and starts the timer. When there is less than one hour left, the device's display starts to blink slowly. This way the child is aware of the remaining time. Whenever he or she wants to stop enjoing TV, all that they have to do is press the red button again. After that the timer stops (the word "Paused" appears on display) and the TV turns off.
This way, kids learn to manage their "TV time" and parents are certain that the time set up won't be exceeded. TST has an internal clock that resets the available time to the initial duration. This happens at the end of every day.
The parent accesses the timer settings via a special "key": you can see it at the bottom of the picture. The key is made in a very simple way: I used an RJ45 plug (those for network cables) with a resistor on two of the eight contacts. Easy to make or to rebuild if you lose it.
By plugging in the key into its socket, a special menu is enabled, from which you can adjust the internal clock, set the maximum time or reset the timer manually. With key inserted, the timer is disabled and the TV is always turned on, so that the older ones can watch TV without ... time limits. Of course when the key is inserted the timer is disabled and stopped.
The TST is built around Arduino, using an Arduino Uno, a 2-line 16-character LCD display and an RTC watch.

TST is made with the following components:
An Arduino One
An LCD shield 2 x 16 characters
An RTC module with DS1307
A 5V relay
A big button
An RJ45 socket
One RJ45 plug
Schematics and source code can be found here (Github).
You cannot see the 5V relay, because it is placed in a separate box, near the TV socket, mainly for safety reasons.

Commenti