materiels:capteurs:angle:angle

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
materiels:capteurs:angle:angle [2021/06/18 09:06] – [3.2 Module L3GD20H] philmateriels:capteurs:angle:angle [2022/07/07 09:33] (Version actuelle) – [3.3 Module BNO055] phil
Ligne 1: Ligne 1:
 +[[materiels:accueilmateriels|{{ :iconemaison.jpg?nolink&30|SommaireMateriels}}]]
  
 +===== Capteurs - Angle =====
 +
 +[Mise à jour le 30/6/2022]
 +
 +==== 1. Généralités ====
 +{{ :materiels:capteurs:angle.png?nolink|}}
 +En géométrie, la notion générale d'angle se décline en plusieurs concepts. \\
 +Dans son sens ancien, l'angle est une figure plane, portion de plan délimitée par deux demi-droites. C'est ainsi que l'on parle des angles d'un polygone. Cependant, l'usage est maintenant d'employer le terme « **secteur angulaire** » pour une telle figure. L'angle peut désigner également une portion de l'espace délimitée par deux plans (angle dièdre). La mesure de tels angles porte couramment, mais abusivement le nom d'angle, elle aussi. <html><a href="https://fr.wikipedia.org/wiki/Angle" target="_blank">Wikipédia</a></html>
 +
 +Un capteur angulaire est un capteur servant à recueillir une image de l'angle mesuré. L'information angulaire peut être sous forme numérique ou analogique. <html><a href="http://www.composelec.com/capteur_angulaire.php" target="_blank">Composant électronique</a></html>
 +
 +{{ :materiels:capteurs:wikiversite.jpg?nolink&50|}}
 +  * // Ressource // 
 +    * <html><a href="https://fr.wikiversity.org/wiki/Capteur/Capteur_de_position" target="_blank">Capteur de position</a></html>
 +
 +
 +----
 +
 +==== 2. Capteurs analogiques ====
 +=== 2.1 Potentiomètre ===
 +{{ :materiels:capteurs:potentiometre.png?nolink&120|}}
 +
 +  * //Source// : <html><a href="https://www.dfrobot.com/product-87.html" target="_blank">wiki</a></html> DFRobot
 +
 +<callout type="info" icon="true">Module capteur rotatif Gravity DFRobot délivrant une valeur analogique en fonction de la position du potentiomètre. Il est livré avec un cordon 3 contacts pour le raccordement.</callout>
 +
 +  * //Distributeur// : <html><a href="https://www.gotronic.fr/art-module-potentiometre-gravity-dfr0054-19304.htm" target="_blank">Gotronic</a></html>
 +
 +{{ :materiels:capteurs:potchema.gif?nolink&200|}}
 +  * //Caractéristiques//
 +    * Alimentation: 3,3 à 5 Vcc
 +    * Rotation: 300°
 +    * Dimensions: 28 x 22 x 23 mm
 +
 +  * //Modèle//
 +    * U' = x * U si (Rc >> R)
 +
 +{{ :materiels:capteurs:acrobate.gif?nolink&30|}}
 +  * // **Aide** pour la **simulation de la chaîne** de mesure //
 +    * Les équations de la chaîne de mesure sont téléchargeables [[|A venir]] {{ :materiels:capteurs:excel.png?nolink&30|}}
 +    * Le modèle à simuler est téléchargeable [[|A venir]]  
 +
 +{{ :materiels:capteurs:rapporteur.jpg?nolink&150|Rapporteur cercle entier}}
 +  * //**Programmation d'une carte Arduino Uno R3**//
 +    * //Connexion à un shield// <html><a href="https://webge.fr/doc/wikis/pdf/TinkerkitV2.pdf" target="_blank">Tinkerkit v2</a></html> {{ :materiels:capteurs:potentiometre.jpg?nolink&600 |}} \\
 +    * //Un premier exemple pour tester le capteur//
 +{{ :materiels:capteurs:distance:arduinoico.png?nolink&40|}}
 +<code cpp pot.cpp>
 +/*
 +Titre : Montage potentiométrique 
 +Date : 18/6/2021
 +Objectif : afficher la position angulaire d'un potentiomètre
 +Matériels : capteur rotatif Gravity DFRobot, carte Arduino Uno, etc.
 +PlatformIO
 +- Répertoire : potentiometre
 +- Fichier : main.cpp
 +*/
 +void setup()
 +{
 +    Serial.begin(9600); // Débit binaire : 9600 bps
 +}
 + 
 +void loop()
 +
 +    uint16_t N;
 +    double angle;
 +    // Lecture
 +    N=analogRead(A0);//LM35 connecté à Analog 0
 +    // Traitement
 +    // Sensibilité du capteur S = 5/300
 +    angle = (double) N * (3/(10.24)); 
 +    // Ecriture
 +    Serial.print("Angle:"); // Affiche l'angle sur le moniteur
 +    Serial.print(angle);
 +    Serial.println("°");
 +    delay(1000);
 +}
 +</code>
 +
 +{{ :arduino:uc:platformioico.png?nolink&50|}}
 +<callout type="tip" icon="true"><html><a href="https://webge.fr/doc/wikis/code/Arduino/ARD_PIO_UNO_Potentiometre.zip" target="_blank">Télécharger</a></html> le projet PlatformIO pour VSCode.</callout>
 +
 +=== 2.2 Flex sensor ===
 +  * Voir [[materiels:capteurs:flexion|Capteurs - Flexion et cisaillement]]
 +
 +----
 +
 +==== 3. Capteurs numériques (Gyroscope) ====
 +
 +{{ :materiels:capteurs:angle:cmps12.jpg?nolink&250|}}
 +=== 3.1 CMPS12 === 
 +  * //Source// : <html><a href="https://www.robot-electronics.co.uk/cmps12-tilt-compensated-magnetic-compass.html" target="_blank">Robot Electronics</a></html>
 +
 +<callout type="info" icon="true">Module CMPS12 de 4ème génération basé sur un circuit Bosch BNO055 intégrant une boussole 3 axes, un **gyroscope 3 axes** et un accéléromètre 3 axes. La direction par rapport au nord est représentée par un nombre unique, soit en I²C ou par port série.</callout> 
 +
 +\\ Le module délivre les informations suivantes : \\
 +  * **La direction par rapport au nord** : 
 +    * sur 8 bits :  0 à 255
 +    * sur 16bits : 0 à 3599 (représente 0 à 359,9°){{ :materiels:capteurs:angle:boussole.gif?nolink&300 |}}
 +  * **Pitch** : +/- 0 à 90° ou +/- 0 à 180°
 +  * **Roll** : +/- 0 à 90°
 +{{ :materiels:capteurs:angle:pitchroll.png?nolink |}}
 +
 +  * //Distributeur// : <html><a href="https://www.gotronic.fr/art-boussole-miniature-compensee-cmps12-27874.htm" target="_blank">Gotronic</a></html>
 +
 +  * // Caractéristiques//
 +    * Alimentation: 3,3 ou 5 Vcc
 +    * Consommation: 18 mA
 +    * Résolution: 0,1°
 +    * Précision: 1 %
 +    * Interface
 +      * I²C (jusqu'à 400 kHz)
 +      * série (9600, 19200 et 38400 bps)
 +    * Dimensions: 25 x 18 x 3 mm 
 +
 +  * //Documentation// : <html><a href="http://www.robot-electronics.co.uk/files/cmps12.pdf" target="_blank">pdf à télécharger</a></html> 
 +
 +  * //**Programmation d'une carte Arduino Uno R3**//
 +    * // Bibliothèques à installer dans l'IDE // : aucune
 +    * // Connexion à un shield // <html><a href="https://webge.fr/doc/wikis/pdf/TinkerkitV2.pdf" target="_blank">Tinkerkit v2</a></html> monté sur une Arduino Uno. {{ :materiels:capteurs:bno055.jpg?nolink&600 |}} 
 +    * // Un premier exemple pour tester le capteur // 
 +{{ :materiels:capteurs:distance:arduinoico.png?nolink&40|}}
 +<code cpp *.cpp>
 +/*****************************************
 +*     CMPS12 I2C example for Arduino     *
 +*        By James Henderson, 2014        * 
 +*****************************************/
 +
 +#include <Wire.h>
 +
 +#define CMPS12_ADDRESS 0x60  // Addresse du CMPS12 sur 7 bits
 +#define ANGLE_8  1           // Registre contenant la valeur de l'angle sur 8bits
 +                             // Sert de référence pour la lecture dans la table
 +                             
 +unsigned char high_byte, low_byte, angle8;
 +char pitch, roll;
 +unsigned int angle16;
 +
 +void setup()
 +{
 +  Serial.begin(9600);  // Port série
 +  Wire.begin();
 +}
 +
 +void loop()
 +{
 +
 +  Wire.beginTransmission(CMPS12_ADDRESS);  // Démarrage de la communication avec le CMPS12
 +  Wire.write(ANGLE_8);                     // Envoi du numéro du premier registre de la 
 +                                           // table à partir duquel on souhaite lire
 +  Wire.endTransmission();
 + 
 +  // On demande la lecture de 5 octet à partir du registre 0x01
 +  // afin d'obtenir l'angle sur 8bits, 
 +  // l'angle sur 16 bits, le pitch et le roll
 +  Wire.requestFrom(CMPS12_ADDRESS, 5);       
 +  
 +  while(Wire.available() < 5);        // On attend la fin de la transmission des 5 octets
 +  
 +  angle8 = Wire.read();               // Lecture des octets
 +  high_byte = Wire.read();
 +  low_byte = Wire.read();
 +  pitch = Wire.read();
 +  roll = Wire.read();
 +  
 +  angle16 = high_byte;                 // Calcul de l'angle sur 16bits
 +  angle16 <<= 8;
 +  angle16 += low_byte;
 +    
 +  Serial.print("roll: ");               // Affichage de roll
 +  Serial.print(roll, DEC);
 +  
 +  Serial.print("    pitch: ");          // Affichage de pitch
 +  Serial.print(pitch, DEC);
 +  
 +  Serial.print("    angle full: ");     // Affichage de l'angle codé sur 16 bits avec décimale
 +  Serial.print(angle16 / 10, DEC);
 +  Serial.print(".");
 +  Serial.print(angle16 % 10, DEC);
 +  
 +  Serial.print("    angle 8: ");        // Affichage de l'angle codé sur 8 bits
 +  Serial.println(angle8, DEC);
 +  
 +  delay(1000);                           // Attente entre deux mesures
 +}
 +</code>
 +
 +{{ :arduino:uc:platformioico.png?nolink&50|}}
 +<callout type="tip" icon="true"><html><a href="https://webge.fr/doc/wikis/code/Arduino/ARD_PIO_UNO_CMPS12.zip" target="_blank">Télécharger</a></html> le projet PlatformIO pour VSCode.</callout>
 +=== 3.2 Module L3GD20H === 
 +{{ :materiels:capteurs:l3gd20h.jpg?nolink&150|}}
 +
 +  * //**Source**// : <html><a href="https://www.pololu.com/product/2129" target="_blank">Wiki</a></html>
 +
 +> Ce module gyroscope 3 axes de Pololu est basé sur le circuit L3GD20H et communique avec un microcontrôleur via un port I2C.
 +
 +  * //**Distributeur**// : <html><a href="https://www.gotronic.fr/art-module-gyroscope-l3gd20h-2129-21729.htm" target="_blank">Gotronic</a></html>
 +
 +  * //**Caractéristiques**//
 +    * Alimentation: 2,5 à 5,5 Vcc
 +    * Consommation: environ 6 mA
 +    * Interface: I2C
 +    * Sortie I2C: lecture sur 16 bits par axe x, y, z
 +    * Plages de mesure: ±245, ±500 ou ±2000°/s
 +    * Dimensions: 23 x 13 x 11 mm
 +
 +{{ :materiels:capteurs:acrobate.gif?nolink&30|}}
 +  * //**Documentation**//
 +    * Fichier Acrobat Reader à télécharger <html><a href="https://www.pololu.com/file/download/L3GD20H.pdf?file_id=0J731" target="_blank">ici</a></html>
 +
 +  * //**Programmation d'une carte Arduino Uno R3**//
 +    * //Bibliothèque à installer dans l'IDE// {{ :materiels:capteurs:l3g.png?nolink&800 |}}
 +    * // Connexion à un shield // <html><a href="https://webge.fr/doc/wikis/pdf/TinkerkitV2.pdf" target="_blank">Tinkerkit v2</a></html>. {{ :materiels:capteurs:branchl3g.jpg?nolink&600 |}}
 +    * // Un premier exemple  // {{ :materiels:capteurs:distance:arduinoico.png?nolink&30|}}
 +
 +> Arduino Examples -> Examples from Custom Libraries -> L3G -> **Serial.ino**
 +
 +__Exemple de résultat attendu__
 +{{ :materiels:capteurs:exemplel3g.png?nolink&300 |}}  
 +
 +{{ :materiels:csharp.png?nolink|}}
 +  * <html><strong>Programmation d'une carte <a href="https://www.ghielectronics.com/sitcore/sbc/" target="_blank">FEZ Duino</a> sous <a href="https://docs.ghielectronics.com/software/tinyclr/intro.html" target="_blank">TinyCLR OS</a> avec l'IDE Visual Studio Community</strong></html> 
 +A venir
 +
 +----
 +
 +tester
 +=== 3.3 Module BNO055 ===
 +{{ :materiels:capteurs:bno055.png?nolink&150|Module Robot Electronics (Devantech)}}
 +  * //Source// : <html><a href="https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/arduino-code" target="_blank">Wiki</a></html>
 +
 +<callout type="info" icon="true">Ce module est basé sur un BNO055 **9 axes** de Bosch comportant un **accéléromètre**, une **boussole** et un **gyroscope**. Ce capteur communique avec un microcontrôleur via une liaison série UART ou I2C.</callout>
 +
 +  * //Distributeur// : <html><a href="https://www.gotronic.fr/art-module-boussole-bno055-27795.htm" target="_blank">Gotronic</a></html>
 +
 +  * //Caractéristiques//
 +    * Alimentation: 3,3 et 5 Vcc
 +    * Interface (sélectionnable via pontet à souder):
 +      *  UART, 115200 bps par défaut
 +      * I2C , adresse** 0x28** par défaut ou RS232
 +      * Plage de mesure:
 +        * gyroscope: ±125 °/s ou ±2000 °/s
 +        * accéléromètre: ±2, ±4, ±6, ±8 ou 16 g
 +        * boussole: ±1300 µT (axes x-,y-), ±2500 µT ( axe z-)
 +    * Dimensions: 20 x 20 x 3 mm
 +
 +{{ :materiels:capteurs:acrobate.gif?nolink&30|}} 
 +  * //Documentation//
 +    * PDF à télécharger <html><a href="http://www.robot-electronics.co.uk/files/BNO055.pdf" target="_blank">ici</a></html> 
 +    * Schéma du module Robot Electronics (Devantech) à télécharger <html><a href="http://www.robot-electronics.co.uk/files/BNO055-schematic.pdf" target="_blank">ici</a></html>
 +
 +  * //**Programmation d'une carte Arduino Uno R3**//
 +    * //Bibliothèques à installer dans l'IDE (I2C)// {{ :materiels:capteurs:adafruitunifiedsensor.png?nolink&500 |}} {{ :materiels:capteurs:adafruitbno055.png?nolink&500 |}}
 +    * Connexion à un shield Tinkerkit v2. {{ :materiels:capteurs:bno055.jpg?nolink&600 |}}
 +    * // Un premier exemple pour tester le capteur(I2C)  // {{ :materiels:capteurs:distance:arduinoico.png?nolink&30|}}
 +      * Fichier -> Exemples -> Adafruit_BNO055 -> **sensorapi.ino** 
 +
 +__Exemple de résultat attendu__
 +  
 +{{ :materiels:capteurs:bno055result.png?nolink&500 |}}