Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes | ||
materiels:capteurs:angle:angle [2021/06/18 07:57] – [2.1 Potentiomètre] phil | materiels:capteurs:angle:angle [2022/07/07 09:29] – [2.1 Potentiomètre] phil | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | [[materiels: | ||
+ | ===== Capteurs - Angle ===== | ||
+ | |||
+ | [Mise à jour le 30/6/2022] | ||
+ | |||
+ | ==== 1. Généralités ==== | ||
+ | {{ : | ||
+ | En géométrie, | ||
+ | Dans son sens ancien, l' | ||
+ | |||
+ | Un capteur angulaire est un capteur servant à recueillir une image de l' | ||
+ | |||
+ | {{ : | ||
+ | * // Ressource à consulter sur **Wikiversité** // : < | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== 2. Capteurs analogiques ==== | ||
+ | === 2.1 Potentiomètre === | ||
+ | {{ : | ||
+ | |||
+ | * //Source// : < | ||
+ | |||
+ | <callout type=" | ||
+ | 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. | ||
+ | </ | ||
+ | |||
+ | * // | ||
+ | |||
+ | {{ : | ||
+ | * // | ||
+ | * Alimentation: | ||
+ | * Rotation: 300° | ||
+ | * Dimensions: 28 x 22 x 23 mm | ||
+ | |||
+ | * //Modèle// | ||
+ | * U' = x * U si (Rc >> R) | ||
+ | |||
+ | {{ : | ||
+ | * // **Aide** pour la **simulation de la chaîne** de mesure // | ||
+ | * Les équations de la chaîne de mesure sont téléchargeables [[|A venir]] {{ : | ||
+ | * Le modèle à simuler est téléchargeable [[|A venir]] | ||
+ | |||
+ | {{ : | ||
+ | * // | ||
+ | * //Connexion à un shield// < | ||
+ | * //Un premier exemple pour tester le capteur// | ||
+ | {{ : | ||
+ | <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); | ||
+ | } | ||
+ | |||
+ | void loop() | ||
+ | { | ||
+ | uint16_t N; | ||
+ | double angle; | ||
+ | // Lecture | ||
+ | N=analogRead(A0);// | ||
+ | // Traitement | ||
+ | // Sensibilité du capteur S = 5/300 | ||
+ | angle = (double) N * (3/ | ||
+ | // Ecriture | ||
+ | Serial.print(" | ||
+ | Serial.print(angle); | ||
+ | Serial.println(" | ||
+ | delay(1000); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | <callout type=" | ||
+ | |||
+ | === 2.2 Flex sensor === | ||
+ | * Voir [[materiels: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== 3. Capteurs numériques (Gyroscope) ==== | ||
+ | |||
+ | {{ : | ||
+ | === 3.1 CMPS12 === | ||
+ | * //Source// : < | ||
+ | |||
+ | < | ||
+ | |||
+ | \\ 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°){{ : | ||
+ | * **Pitch** : +/- 0 à 90° ou +/- 0 à 180° | ||
+ | * **Roll** : +/- 0 à 90° | ||
+ | {{ : | ||
+ | |||
+ | * // | ||
+ | |||
+ | * // Caractéristiques// | ||
+ | * Alimentation: | ||
+ | * Consommation: | ||
+ | * Résolution: | ||
+ | * Précision: 1 % | ||
+ | * Interface | ||
+ | * I²C (jusqu' | ||
+ | * série (9600, 19200 et 38400 bps) | ||
+ | * Dimensions: 25 x 18 x 3 mm | ||
+ | |||
+ | * // | ||
+ | |||
+ | * // | ||
+ | * // Bibliothèques à installer dans l'IDE // : aucune | ||
+ | * // Connexion à un shield // < | ||
+ | * // Un premier exemple pour tester le capteur // | ||
+ | {{ : | ||
+ | <code cpp *.cpp> | ||
+ | / | ||
+ | * | ||
+ | * By James Henderson, 2014 * | ||
+ | *****************************************/ | ||
+ | |||
+ | #include < | ||
+ | |||
+ | #define CMPS12_ADDRESS 0x60 // Addresse du CMPS12 sur 7 bits | ||
+ | #define ANGLE_8 | ||
+ | // 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); | ||
+ | Wire.begin(); | ||
+ | } | ||
+ | |||
+ | void loop() | ||
+ | { | ||
+ | |||
+ | Wire.beginTransmission(CMPS12_ADDRESS); | ||
+ | Wire.write(ANGLE_8); | ||
+ | // table à partir duquel on souhaite lire | ||
+ | Wire.endTransmission(); | ||
+ | |||
+ | // On demande la lecture de 5 octet à partir du registre 0x01 | ||
+ | // afin d' | ||
+ | // l' | ||
+ | Wire.requestFrom(CMPS12_ADDRESS, | ||
+ | | ||
+ | while(Wire.available() < 5); // On attend la fin de la transmission des 5 octets | ||
+ | | ||
+ | angle8 = Wire.read(); | ||
+ | high_byte = Wire.read(); | ||
+ | low_byte = Wire.read(); | ||
+ | pitch = Wire.read(); | ||
+ | roll = Wire.read(); | ||
+ | | ||
+ | angle16 = high_byte; | ||
+ | angle16 <<= 8; | ||
+ | angle16 += low_byte; | ||
+ | | ||
+ | Serial.print(" | ||
+ | Serial.print(roll, | ||
+ | | ||
+ | Serial.print(" | ||
+ | Serial.print(pitch, | ||
+ | | ||
+ | Serial.print(" | ||
+ | Serial.print(angle16 / 10, DEC); | ||
+ | Serial.print(" | ||
+ | Serial.print(angle16 % 10, DEC); | ||
+ | | ||
+ | Serial.print(" | ||
+ | Serial.println(angle8, | ||
+ | | ||
+ | delay(1000); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | <note tip>< | ||
+ | === 3.2 Module L3GD20H === | ||
+ | {{ : | ||
+ | |||
+ | * // | ||
+ | |||
+ | > Ce module gyroscope 3 axes de Pololu est basé sur le circuit L3GD20H et communique avec un microcontrôleur via un port I2C. | ||
+ | |||
+ | * // | ||
+ | |||
+ | * // | ||
+ | * Alimentation: | ||
+ | * Consommation: | ||
+ | * 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 | ||
+ | |||
+ | {{ : | ||
+ | * // | ||
+ | * Fichier Acrobat Reader à télécharger < | ||
+ | |||
+ | * // | ||
+ | * // | ||
+ | * // Connexion à un shield // < | ||
+ | * // Un premier exemple | ||
+ | |||
+ | > Arduino Examples -> Examples from Custom Libraries -> L3G -> **Serial.ino** | ||
+ | |||
+ | __Exemple de résultat attendu__ | ||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | * < | ||
+ | A venir | ||
+ | |||
+ | ---- | ||
+ | |||
+ | tester=== 3.3 Module BNO055 === | ||
+ | {{ : | ||
+ | * //Source// : < | ||
+ | |||
+ | < | ||
+ | |||
+ | * // | ||
+ | |||
+ | * // | ||
+ | * Alimentation: | ||
+ | * 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: | ||
+ | * boussole: ±1300 µT (axes x-,y-), ±2500 µT ( axe z-) | ||
+ | * Dimensions: 20 x 20 x 3 mm | ||
+ | |||
+ | {{ : | ||
+ | * // | ||
+ | * PDF à télécharger < | ||
+ | * Schéma du module Robot Electronics (Devantech) à télécharger < | ||
+ | |||
+ | * // | ||
+ | * // | ||
+ | * Connexion à un shield Tinkerkit v2. {{ : | ||
+ | * // Un premier exemple pour tester le capteur(I2C) | ||
+ | * Fichier -> Exemples -> Adafruit_BNO055 -> **sensorapi.ino** | ||
+ | |||
+ | __Exemple de résultat attendu__ | ||
+ | | ||
+ | {{ : |