Difference between revisions of "SRS - Tachymètre"

From air
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 22: Line 22:
   
 
= Introduction=
 
= Introduction=
== Objectif du projet==
+
== Goal of the project ==
 
:The aim of the project is to learn how to use the Cohorte platform to develop a web application which displays an historic of measures made by a sensor and stored on a remote server.
 
:The aim of the project is to learn how to use the Cohorte platform to develop a web application which displays an historic of measures made by a sensor and stored on a remote server.
 
:The main point of the project is to be able to transmit and process the information from the measures given by the sensor to the processed data on the user interface. Moreover, there is a more mathematical step, that consist in calculating the speed with the frequency, and filtering the signal to eliminate noise.
 
:The main point of the project is to be able to transmit and process the information from the measures given by the sensor to the processed data on the user interface. Moreover, there is a more mathematical step, that consist in calculating the speed with the frequency, and filtering the signal to eliminate noise.
   
== Visée du produit==
+
== Scope of the product ==
  +
:The implementation of the sensor on the Raspberry and the process of measures can be added on any other application that needs movement detection in front of the sensor. The steps of calculation and storage on the server have to be autonomous so that any number of sensors are connected to the application.
:L’implémentation du capteur sur le Raspberry Pi et le traitement de ces mesures peuvent être intégrés à n’importe quelle autre application nécessitant la détection de mouvements ou de passages devant le capteur. Ces étapes de traitement et d’envoi ou de stockage doivent être autonomes pour qu’un nombre quelconque de capteurs puissent faire partie de l’application.
 
  +
:The storage on the server and the interface have to be scalable. During the project, we only have one sensor, but the application we want to develop should be able to displays data form several sensors, which are characterised by a unique identifier, a name, an owner, GPS coordinates, … Besides, an interface has to be implemented on the Raspberry so that the owner can define all these attributes on the sensor in a way that it can be clearly identified by the Cohorte application.
:Le stockage sur le serveur et l’interface doivent être conçus pour être évolutifs. En effet, lors de notre projet nous ne disposons que d’un capteur, mais l’application à développer doit pouvoir interroger et afficher les données de plusieurs capteurs, qui seront reconnus par un identifiant unique, un nom, un propriétaire, des coordonnées GPS, etc… De plus, une interface doit être implémentée sur le Raspberry pour que le propriétaire puisse définir ces attributs sur le capteur pour qu’il soit recensé avec clarté sur l’interface utilisateur.
 
:De cette façon, le système aura la possibilité d’être utilisé par des clients ou d’autres entreprises.
 
   
  +
== Definitions, acronyms and abbreviations ==
== Définitions, acronymes et abréviations==
 
* Raspberry Pi : Ordinateur monocarte (processeur ARM) à taille réduite, compatible avec de nombreux périphériques (clavier, souris, …). Le Raspberry Pi peut héberger un programme, offrant ainsi de nombreuses possibilités d’utilisation. Pour notre projet, le Raspberry nous sert de support pour le capteur. De plus, il héberge le code qui va traiter les mesures et les envoyer au serveur.
+
* Raspberry Pi : Reduced size computer (ARM processor), compatible with devices like keyboards, mouses, … The Raspberry Pi can host a program, providing many opportunities of use. In our project, the Raspberry is linked to the Arduino, and host the python modules that process the data and send it to the server.
   
* Arduino : Carte comportant un microcontrôleur programmable pour produire et analyser des signaux électriques. Pour notre projet, l'Arduino nous sert pour obtenir les mesures du capteur HB100. Une fois les valeurs de tension et de fréquences transformées en distance et vitesse, l'Arduino envoie les données au Raspberry par liaison série.
+
* Arduino : Programmable microcontroller able to generate and analyse electric signals. For our project, the Arduino get the measures from the HB100 sensor. Once the voltage and frequency values are available, they are transformed into distance and speed values, and send to the Raspberry by serial link.
   
  +
* ARM processor : Low consumption processor, equipped with a simpler architecture than other families of processors. ARM processors are mainly used on embedded computing like smartphones.
* Processeur ARM : processeurs à faible consommation, dotés d'une architecture plus simple que les autres familles de processeurs. Les processeurs ARM sont dominants dans le domaine de l'informatique embarquée comme les téléphones mobiles.
 
   
  +
* HB100 : Proximity sensor that provide a voltage and frequency measure. The voltage gives an information about the distance between the sensor and the object, whereas the frequency allows to calculate the speed of the object thanks to the Doppler effect (see below). The distance variation corresponds to the direction of movement.
* HB100 : Capteur de proximité qui renvoie une mesure de tension et une mesure de fréquence. La mesure de tension permet d'obtenir la distance entre le mobile et le capteur, tandis que la fréquence permet de calculer la vitesse du mobile grâce à l'effet Doppler (voir ci-dessous). La courbe de distance permet d'obtenir le sens de circulation du mobile, selon si la variation est croissante ou décroissante.
 
   
  +
* Cohorte : Development platform created by Isandlatech that provides tools to program distributed applications on different independent devices, including the programming languages. Cohorte allows to do component oriented programming, which means that the application is flexible, and the different components are autonomous.
* Cohorte : plate-forme de développement développé par Isandlatech qui fournit des outils pour créer des applications réparties sur plusieurs systèmes indépendants, y compris au niveau du langage de programmation. Il s’agit d’outils orientés composant et services, ce qui permet une importante flexibilité et une application dont les différents isolats sont indépendants.
 
   
  +
* SQLite : Database engine in a C library that allows table interrogation with SQL requests. In our server, the database contains only one table, so SQLite is quite enough for the management of the server.
* SQLite : Moteur de base de données relationnelles développé en C. Cette bibliothèque permet l'interrogation des tables via des requêtes dans le langage SQL. L'interêt pour ce projet est que notre base de données ne contient qu'une table, et que SQLite suffit amplement pour l'interrogation du serveur par l'application web.
 
   
  +
* Doppler effect : Physical phenomenon that consist in a frequency shift between the transmitter and the receiver when the distance between them is changing. With this phenomenon, we can calculate the speed of an object thanks to the relation between the measured frequency and the speed of the object.
* Effet Doppler : Phénomène physique qui consiste en un décalage de le fréquence des ondes entre l'émetteur et le récepteur lorsque la distance entre ces deux points varie dans le temps. Ce phénomène permet de calculer la vitesse de déplacement d'un mobile grâce à une relation mathématique entre la fréquence mesurée, l'angle entre l'axe de mesure du capteur et le déplacement du mobile.
 
   
  +
* Raw data : Data returned by the sensor and send to the Arduino (voltage, frequency, timestamp).
* Données brutes : données acquises par le capteur sur le Raspberry Pi. Il s'agit de la tension, de la fréquence, et du timestamp de l'échantillon.
 
   
  +
* Processed data : Data returned by the process of raw data on the Raspberry (average speed, maximum speed, direction, date).
* Données élaborées : données obtenues par le traitement des données brutes. Ce traitement consiste en l'obtention de la vitesse et du sens de déplacement de l'objet. Il s'agit d'une mesure contenant la vitesse, le sens, et la date.
 
   
  +
* Synthetic data : Analysis of processed data. For example, it could be a distribution of the flow during a month, or at a precise moment of the day, or also an historic of speed.
* Données synthétiques : données représentant une analyse des données élaborées. Il peut s'agir d'une répartition du nombre de passage dans le mois ou dans une plage d'horaires, ou bien de statistiques sur les vitesses (vitesse maximum, moyenne par jour) par plage horaire.
 
   
* Timestamp : date, heure minute et seconde à laquelle la mesure est faite.
+
* Timestamp : date, hour, minute and second when the measure is done.
   
= Description du projet=
+
= Description of the project=
  +
== Product perspective ==
== Perspective du produit==
 
  +
: The product is meant to be a presence detector whose measurements are saved to interrogate them in the user interface. We could imagine many use like domestic surveillance (a detector with a bell), or also a road traffic detector.
:Le produit a pour but d’être un détecteur de présence dont les mesures sont sauvegardées dans le but d’une interrogation par une interface utilisateur. On peut alors imaginer de nombreuses utilisations comme de la surveillance domestique (radar lié avec une alarme), ou tout simplement un appareil de mesure de trafic. Les données pouvant être triées et analysées (moyennes, histogramme), il y a une possibilité d’étude poussée de tronçon routier.
 
  +
: In a fuller version of the product, we should integrate an authentication system that allows groups of users with different access permissions.
:Dans une version plus aboutie du produit, on pourrait introduire un système d’authentification. Cela permettrait d’implémenter des groupes d’utilisateurs avec des permissions d’accès différentes selon les groupes.
 
   
  +
== Product functions ==
== Fonctionnalités==
 
  +
: The sensor is able to measure speed and distance. Therefore, the aim is to detect the speed of objects in front of the sensor (pedestrians, cyclists, cars, …) and date this detection. The web interface gets the data from the server and displays it with the possibility to restrict to a certain time of day, or a date range, or to make graphs.
: Le capteur permet d’avoir une mesure de proximité et de vitesse. Le but est donc de mesurer la vitesse des objets passant devant le capteur (piétons, cyclistes, voiture, …) et de dater cette mesure. Les données sont stockées sur un serveur qui va permettre l’utilisation d’une interface graphique. Cette interface utilisateur affiche l’historique des mesures, avec diverses actions comme la sélection d’une plage de dates pour un affichage plus ciblé, ou encore la présentation des données sous la forme de graphiques pour permettre une analyse plus pointue du trafic.
 
   
  +
== General constraints ==
== Caractéristiques utilisateur==
 
  +
: The constraints of the project are the use of Cohorte and the Raspberry Pi with the sensor.
== Contraintes générales==
 
  +
: There is no constraint about the programming language, because thanks to Cohorte, the different components can be developed in different languages : Python or Java for the Raspberry, Java and SQLite for the server, and HTML/CSS/Javascript for the web interface.
: Les contraintes de ce projet sont l’utilisation de Cohorte et du Raspberry Pi comme support pour le capteur.
 
:Il n’y a pas de contraintes pour le langage de programmation, car grâce à Cohorte, les différents composants peuvent être développés dans différents langage : Python ou Java pour le Raspberry, Java et SQLite pour le stockage sur le serveur, et HTML/CSS/Javascript pour l’interface web.
 
   
== Assumptions and dependencies==
 
 
= Specific requirements, covering functional, non-functional and interface requirements=
 
= Specific requirements, covering functional, non-functional and interface requirements=
   
== Exigences fonctionnelles ==
+
== Functional requirements ==
  +
'''Data acquisition function'''
'''Fonction d’acquisitions des données'''
 
  +
: Getting of physical values : speed and distance
: Récupération des valeurs physiques : Vitesse et proximité
 
: Propagation des données par consommation d’un service fourni par un composant distant.
+
: Sending of processed data by consuming a service provided by a remote component.
   
'''Fonction d’agrégation'''
+
'''Aggregation function'''
  +
: Storage of the data in a server.
: Stockage de la donnée (service write).
 
   
'''Fonction interface utilisateur'''
+
'''User interface function'''
  +
: Data presentation components.
: Composants de récupération et de présentation des données (voir cas d'usage).
 
   
  +
== Non-functional requirements ==
== Exigences non-fonctionnelles ==
 
'''Qualité du réseau'''
+
'''Quality of the network'''
  +
: Store the data on the device allows to avoid losing data in the event of link loss.
: Une solution de stockage des mesures dans le cache du Raspberry permet de prévenir la perte des données en cas d'indisponibilité du réseau.
 
   
'''Environnement du capteur'''
+
'''Sensor environment'''
  +
: The measurements have to be filtred to eliminate the noise generate by the environment (street, wind, …).
: Il est nécessaire de traiter les mesures pour ne pas tenir compte du bruit dû à l'environnement.
 
   
== Exigences de l’interface ==
+
== Interface requirements ==
  +
: Compatibility multi-platform (different browser, mobile version of the software).
'''Ergonomie'''
 
  +
: Interactivity (date range selection, creation of graphs, …).
: Compatibilité multi-support (différents navigateurs, version mobile).
 
: Interactions (sélection de plage de dates, affichage de graphiques, …).
 
: Nécessité de transparence pour l'utilisateur.
 
   
= Cas d'usage =
+
= Use case =
== Interaction de l’utilisateur avec l’interface web ==
+
== Interaction between user and web interface ==
  +
: - The user connects to the website and authenticate with his loin and password
: - L’utilisateur entre sur le site web et s’authentifie avec un login et un mot de passe
 
  +
: - The user can choose to click on “all” to display all the data from every sensors (sorted in descending order of date)
: - L’utilisateur peut choisir de cliquer sur “tout” pour afficher l’ensemble des données de tous les capteurs (triées par date décroissante)
 
  +
:: Data displayed : date, average speed, maximum speed, direction, sensor
:: -la date / vitesse moyenne / sens / capteur
 
   
  +
: - The user choose a sensor in the sensor list (green : connected, red : disconnected)
: - L’utilisateur choisit un capteur parmi la liste des capteurs installés (vert : connecté, rouge : déconnecté) :
 
:: -onglet données élaborées :
+
:: - Processed data tab :
  +
::: - The system displays the processed data in a table (sorted in descending order of date)
::: -le système affiche les données élaborées dans un tableau (triées par date décroissante)
 
  +
:::: Data displayed : date, average speed, maximum speed, direction, sensor
:::: - la date (Heure / Minute / Jour / Mois / Année) / vitesse moyenne (km/h) / sens (sens du capteur, contresens du capteur)
 
::: - L’utilisateur peut cliquer sur les liens de pagination pour naviguer dans les données élaborées
+
::: - The user can click on pagination links to browse the data.
  +
::: - The user can filtrate the data with two types of parameters :
::: - L’utilisateur peut filtrer les données affichées en fonction des paramètres suivants :
 
:::: - entre deux dates d1 et d2
+
:::: - Between two dates
:::: - une vitesse max / min.
+
:::: - A minimum / maximum speed value
:: - onglet données synthétisées :
+
:: - Synthetic data tab :
  +
::: - The user can make parameterized analyses choosing the option “historic”, or a distribution choosing the option “distribution. The parameters are :
::: - L'utilisateur peut obtenir des analyses paramétrées des données élaborées en choisissant l'option "historique" en fontion de :
 
:::: - un type de donnée :
+
:::: - Selection of the type of data :
::::: - le nombre de passages
+
::::: - Number of moves
::::: - la vitesse moyenne (km/h)
+
::::: - Average speed
::::: - la vitesse maximum (km/h)
+
::::: - Maximum speed
:::: - une plage de date :
+
:::: - Selection of a date range :
::::: - une date de début (JJ/MM/AAAA)
+
::::: - Start date (DD/MM/YYYY)
::::: - une date de fin (JJ/MM/AAAA)
+
::::: - End date (DD/MM/YYYY)
:::: - une plage horaire :
+
:::: - Selection of time slot :
::::: - heure de début (HH/MM)
+
::::: - Start hour (HH/MM)
::::: - heure de fin (HH/MM)
+
::::: - End hour (HH/MM)
  +
:: - Administration tab :
::: - L'utilisateur peut également obtenir une répartition des vitesses de passage en choisissant l'option "répartition" en fonction de :
 
  +
::: - The system displays events related to the selected sensor in a table (sorted in descending order of date) :
:: - onglet administrateur :
 
  +
:::: - Selection of a date range :
::: - le système affiche un tableau des événements relatifs au capteur sélectionné (trié par date décroissante) :
 
:::: - une plage de date :
+
::::: - Start date (DD/MM/YYYY)
::::: - une date de début (JJ/MM/AAAA)
+
::::: - End date (DD/MM/YYYY)
::::: - une date de fin (JJ/MM/AAAA)
+
:::: - Selection of time slot :
:::: - une plage horaire :
+
::::: - Start hour (HH/MM)
::::: - heure de début (HH/MM)
+
::::: - End hour (HH/MM)
::::: - heure de fin (HH/MM)
+
:::: - Date of event (HH/MM/DD/MM/YYYY)
:::: - la date (Heure / Minute / Jour / Mois / Année)
+
:::: - State of the sensor (connected / disconnected)
  +
: - The user can disconnect
:::: - l’état (connecté, déconnecté)
 
: - L’utilisateur peut se déconnecter
 
   
 
== Interaction du technicien avec le capteur ==
 
== Interaction du technicien avec le capteur ==
Line 137: Line 131:
 
: - Le technicien démarre le capteur
 
: - Le technicien démarre le capteur
   
== Interaction du technicien avec l’interface d’administration du capteur ==
+
== Interaction between the technician and the sensor ==
  +
: - The technician connects the sensor to the client’s internet network
: - Le technicien ouvre la page d’administration du capteur
 
  +
: - The technician fill a form on the Raspberry :
: - Le technicien remplit un formulaire :
 
:: - L’identifiant du capteur
+
:: - Identifier of the sensor
:: - Coordonnées GPS du capteur (longitude latitude, altitude (décimales))
+
:: - GPS coordinates of the sensor (latitude, longitude, altitude)
   
 
= Appendicies =
 
= Appendicies =

Latest revision as of 14:53, 30 March 2016

Document History
Version Date Authors Description Validator Validation Date
0.0.1 18/01/2016 MACE Quentin, NOUGUIER Thibaut, RAMEL Régis Développement d'une application de détection de passages devant un capteur de présence Oliver Gattaz 06/04/2016


Introduction

Goal of the project

The aim of the project is to learn how to use the Cohorte platform to develop a web application which displays an historic of measures made by a sensor and stored on a remote server.
The main point of the project is to be able to transmit and process the information from the measures given by the sensor to the processed data on the user interface. Moreover, there is a more mathematical step, that consist in calculating the speed with the frequency, and filtering the signal to eliminate noise.

Scope of the product

The implementation of the sensor on the Raspberry and the process of measures can be added on any other application that needs movement detection in front of the sensor. The steps of calculation and storage on the server have to be autonomous so that any number of sensors are connected to the application.
The storage on the server and the interface have to be scalable. During the project, we only have one sensor, but the application we want to develop should be able to displays data form several sensors, which are characterised by a unique identifier, a name, an owner, GPS coordinates, … Besides, an interface has to be implemented on the Raspberry so that the owner can define all these attributes on the sensor in a way that it can be clearly identified by the Cohorte application.

Definitions, acronyms and abbreviations

  • Raspberry Pi : Reduced size computer (ARM processor), compatible with devices like keyboards, mouses, … The Raspberry Pi can host a program, providing many opportunities of use. In our project, the Raspberry is linked to the Arduino, and host the python modules that process the data and send it to the server.
  • Arduino : Programmable microcontroller able to generate and analyse electric signals. For our project, the Arduino get the measures from the HB100 sensor. Once the voltage and frequency values are available, they are transformed into distance and speed values, and send to the Raspberry by serial link.
  • ARM processor : Low consumption processor, equipped with a simpler architecture than other families of processors. ARM processors are mainly used on embedded computing like smartphones.
  • HB100 : Proximity sensor that provide a voltage and frequency measure. The voltage gives an information about the distance between the sensor and the object, whereas the frequency allows to calculate the speed of the object thanks to the Doppler effect (see below). The distance variation corresponds to the direction of movement.
  • Cohorte : Development platform created by Isandlatech that provides tools to program distributed applications on different independent devices, including the programming languages. Cohorte allows to do component oriented programming, which means that the application is flexible, and the different components are autonomous.
  • SQLite : Database engine in a C library that allows table interrogation with SQL requests. In our server, the database contains only one table, so SQLite is quite enough for the management of the server.
  • Doppler effect : Physical phenomenon that consist in a frequency shift between the transmitter and the receiver when the distance between them is changing. With this phenomenon, we can calculate the speed of an object thanks to the relation between the measured frequency and the speed of the object.
  • Raw data : Data returned by the sensor and send to the Arduino (voltage, frequency, timestamp).
  • Processed data : Data returned by the process of raw data on the Raspberry (average speed, maximum speed, direction, date).
  • Synthetic data : Analysis of processed data. For example, it could be a distribution of the flow during a month, or at a precise moment of the day, or also an historic of speed.
  • Timestamp : date, hour, minute and second when the measure is done.

Description of the project

Product perspective

The product is meant to be a presence detector whose measurements are saved to interrogate them in the user interface. We could imagine many use like domestic surveillance (a detector with a bell), or also a road traffic detector.
In a fuller version of the product, we should integrate an authentication system that allows groups of users with different access permissions.

Product functions

The sensor is able to measure speed and distance. Therefore, the aim is to detect the speed of objects in front of the sensor (pedestrians, cyclists, cars, …) and date this detection. The web interface gets the data from the server and displays it with the possibility to restrict to a certain time of day, or a date range, or to make graphs.

General constraints

The constraints of the project are the use of Cohorte and the Raspberry Pi with the sensor.
There is no constraint about the programming language, because thanks to Cohorte, the different components can be developed in different languages : Python or Java for the Raspberry, Java and SQLite for the server, and HTML/CSS/Javascript for the web interface.

Specific requirements, covering functional, non-functional and interface requirements

Functional requirements

Data acquisition function

Getting of physical values : speed and distance
Sending of processed data by consuming a service provided by a remote component.

Aggregation function

Storage of the data in a server.

User interface function

Data presentation components.

Non-functional requirements

Quality of the network

Store the data on the device allows to avoid losing data in the event of link loss.

Sensor environment

The measurements have to be filtred to eliminate the noise generate by the environment (street, wind, …).

Interface requirements

Compatibility multi-platform (different browser, mobile version of the software).
Interactivity (date range selection, creation of graphs, …).

Use case

Interaction between user and web interface

- The user connects to the website and authenticate with his loin and password
- The user can choose to click on “all” to display all the data from every sensors (sorted in descending order of date)
Data displayed : date, average speed, maximum speed, direction, sensor
- The user choose a sensor in the sensor list (green : connected, red : disconnected)
- Processed data tab :
- The system displays the processed data in a table (sorted in descending order of date)
Data displayed : date, average speed, maximum speed, direction, sensor
- The user can click on pagination links to browse the data.
- The user can filtrate the data with two types of parameters :
- Between two dates
- A minimum / maximum speed value
- Synthetic data tab :
- The user can make parameterized analyses choosing the option “historic”, or a distribution choosing the option “distribution. The parameters are :
- Selection of the type of data :
- Number of moves
- Average speed
- Maximum speed
- Selection of a date range :
- Start date (DD/MM/YYYY)
- End date (DD/MM/YYYY)
- Selection of time slot :
- Start hour (HH/MM)
- End hour (HH/MM)
- Administration tab :
- The system displays events related to the selected sensor in a table (sorted in descending order of date) :
- Selection of a date range :
- Start date (DD/MM/YYYY)
- End date (DD/MM/YYYY)
- Selection of time slot :
- Start hour (HH/MM)
- End hour (HH/MM)
- Date of event (HH/MM/DD/MM/YYYY)
- State of the sensor (connected / disconnected)
- The user can disconnect

Interaction du technicien avec le capteur

- Le technicien branche le capteur au réseau internet du client
- Le technicien démarre le capteur

Interaction between the technician and the sensor

- The technician connects the sensor to the client’s internet network
- The technician fill a form on the Raspberry :
- Identifier of the sensor
- GPS coordinates of the sensor (latitude, longitude, altitude)

Appendicies

Read first:

Cohorte

  • cohorte.github.io

Microwave Motion Sensor

Making the electronics for $7 USD doppler motion sensor

Raspberry Frequency measurment