20076浏览
查看: 20076|回复: 70

[项目] 【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘

[复制链接]
本帖最后由 驴友花雕 于 2021-9-29 15:45 编辑

37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止37种的。鉴于本人手头积累了一些传感器和执行器模块,依照实践出真知(一定要动手做)的理念,以学习和交流为目的,这里准备逐一动手试试做实验,不管成功与否,都会记录下来---小小的进步或是搞不定的问题,希望能够抛砖引玉。

【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271


【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1


【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图2


驴友花雕  中级技神
 楼主|

发表于 2021-9-30 07:10:03

   【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
   实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
   项目十一:使用Adafruit库的HMC5883 磁力计测试

  实验开源代码

  1. /*
  2.    【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
  3.    实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
  4.    项目十一:使用Adafruit库的HMC5883 磁力计测试
  5.    实验接线:
  6.    5883L-------------- UNO
  7.    VCC------------------- 5V
  8.    GND------------------- GND
  9.    SCL ------------------- A5
  10.    SDA------------------- A4
  11.    DRDY------------------ N/C
  12. */
  13. #include <Wire.h>
  14. #include <Adafruit_Sensor.h>
  15. #include <Adafruit_HMC5883_U.h>
  16. /* Assign a unique ID to this sensor at the same time */
  17. Adafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(666666);
  18. void displaySensorDetails(void)
  19. {
  20.   sensor_t sensor;
  21.   mag.getSensor(&sensor);
  22.   Serial.println("------------------------------------");
  23.   Serial.print  ("Sensor:       "); Serial.println(sensor.name);
  24.   Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
  25.   Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
  26.   Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" uT");
  27.   Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" uT");
  28.   Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" uT");
  29.   Serial.println("------------------------------------");
  30.   Serial.println("");
  31.   delay(500);
  32. }
  33. void setup(void)
  34. {
  35.   Serial.begin(9600);
  36.   Serial.println("HMC5883 Magnetometer Test"); Serial.println("");
  37.   /* Initialise the sensor */
  38.   if (!mag.begin())
  39.   {
  40.     /* There was a problem detecting the HMC5883 ... check your connections */
  41.     Serial.println("Ooops, no HMC5883 detected ... Check your wiring!");
  42.     while (1);
  43.   }
  44.   /* Display some basic information on this sensor */
  45.   displaySensorDetails();
  46. }
  47. void loop(void)
  48. {
  49.   /* Get a new sensor event */
  50.   sensors_event_t event;
  51.   mag.getEvent(&event);
  52.   /* Display the results (magnetic vector values are in micro-Tesla (uT)) */
  53.   Serial.print("X: "); Serial.print(event.magnetic.x); Serial.print("  ");
  54.   Serial.print("Y: "); Serial.print(event.magnetic.y); Serial.print("  ");
  55.   Serial.print("Z: "); Serial.print(event.magnetic.z); Serial.print("  "); Serial.println("uT");
  56.   // Hold the module so that Z is pointing 'up' and you can measure the heading with x&y
  57.   // Calculate heading when the magnetometer is level, then correct for signs of axis.
  58.   float heading = atan2(event.magnetic.y, event.magnetic.x);
  59.   // Once you have your heading, you must then add your 'Declination Angle', which is the 'Error' of the magnetic field in your location.
  60.   // Find yours here: http://www.magnetic-declination.com/
  61.   // Mine is: -13* 2' W, which is ~13 Degrees, or (which we need) 0.22 radians
  62.   // If you cannot find your Declination, comment out these two lines, your compass will be slightly off.
  63.   float declinationAngle = 0.1;
  64.   heading += declinationAngle;
  65.   // Correct for when signs are reversed.
  66.   if (heading < 0)
  67.     heading += 2 * PI;
  68.   // Check for wrap due to addition of declination.
  69.   if (heading > 2 * PI)
  70.     heading -= 2 * PI;
  71.   // Convert radians to degrees for readability.
  72.   float headingDegrees = heading * 180 / M_PI;
  73.   Serial.print("Heading (degrees): "); Serial.println(headingDegrees);
  74.   delay(500);
  75. }
复制代码


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-30 06:39:35

   【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
   实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
   项目之十:根据当前位置来校正磁偏角

  实验开源代码

  1. /*
  2.    【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
  3.    实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
  4.    项目之十:根据当前位置来校正磁偏角
  5.    实验接线:
  6.    5883L-------------- UNO
  7.    VCC------------------- 5V
  8.    GND------------------- GND
  9.    SCL ------------------- A5
  10.    SDA------------------- A4
  11.    DRDY------------------ N/C
  12. */
  13. #include <Arduino.h>
  14. #include <Wire.h>
  15. #include <HMC5883L_Simple.h>
  16. // Create a compass
  17. HMC5883L_Simple Compass;
  18. void setup() {
  19.   Serial.begin(9600);
  20.   Wire.begin();
  21.   // Magnetic Declination is the correction applied according to your present location
  22.   // in order to get True North from Magnetic North, it varies from place to place.
  23.   //
  24.   // The declination for your area can be obtained from http://www.magnetic-declination.com/
  25.   // Take the "Magnetic Declination" line that it gives you in the information,
  26.   //
  27.   // Examples:
  28.   //   Christchurch, 23° 35' EAST
  29.   //   Wellington  , 22° 14' EAST
  30.   //   Dunedin     , 25° 8'  EAST
  31.   //   Auckland    , 19° 30' EAST
  32.   //
  33.   Compass.SetDeclination(-0, 23, 'W');
  34.   //   The device can operate in SINGLE (default) or CONTINUOUS mode
  35.   //   SINGLE simply means that it takes a reading when you request one
  36.   //   CONTINUOUS means that it is always taking readings
  37.   //   for most purposes, SINGLE is what you want.
  38.   Compass.SetSamplingMode(COMPASS_CONTINUOUS);
  39.   //   The scale can be adjusted to one of several levels, you can probably leave it at the default.
  40.   //   Essentially this controls how sensitive the device is.
  41.   //   Options are 088, 130 (default), 190, 250, 400, 470, 560, 810
  42.   //   Specify the option as COMPASS_SCALE_xxx
  43.   //   Lower values are more sensitive, higher values are less sensitive.
  44.   //   The default is probably just fine, it works for me.  If it seems very noisy
  45.   //  (jumping around), incrase the scale to a higher one.
  46.   Compass.SetScale(COMPASS_SCALE_250);
  47.   //   The compass has 3 axes, but two of them must be close to parallel to the earth's surface to read it,
  48.   //   (we do not compensate for tilt, that's a complicated thing) - just like a real compass has a floating
  49.   //   needle you can imagine the digital compass does too.
  50.   //
  51.   //   To allow you to mount the compass in different ways you can specify the orientation:
  52.   //   COMPASS_HORIZONTAL_X_NORTH (default), the compass is oriented horizontally, top - side up. when pointing North the X silkscreen arrow will point North
  53.   //   COMPASS_HORIZONTAL_Y_NORTH, top-side up, Y is the needle,when pointing North the Y silkscreen arrow will point North
  54.   //   COMPASS_VERTICAL_X_EAST,    vertically mounted (tall) looking at the top side, when facing North the X silkscreen arrow will point East
  55.   //   COMPASS_VERTICAL_Y_WEST,    vertically mounted (wide) looking at the top side, when facing North the Y silkscreen arrow will point West
  56.   Compass.SetOrientation(COMPASS_HORIZONTAL_X_NORTH);
  57. }
  58. // Our main program loop.
  59. void loop() {
  60.   float heading = Compass.GetHeadingDegrees();
  61.   Serial.print("Heading: \t");
  62.   Serial.println( heading );
  63.   delay(500);
  64. }
复制代码


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-30 08:10:46

   【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
   实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
   项目十三:尝试不使用驱动库来读取XYZ

  实验开源代码

  1. /*
  2.    【Arduino】168种传感器模块系列实验(资料代码+图形编程+仿真编程)
  3.    实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
  4.    项目十三:尝试不使用驱动库来读取XYZ
  5.    实验接线:
  6.    5883L-------------- UNO
  7.    VCC------------------- 5V
  8.    GND------------------- GND
  9.    SCL ------------------- A5
  10.    SDA------------------- A4
  11.    DRDY------------------ N/C
  12. */
  13. #include <Wire.h> //I2C Arduino Library
  14. #define HMC5883L_ADDR 0x0D //0011110b, I2C 7bit address of HMC5883
  15. bool haveHMC5883L = false;
  16. bool detectHMC5883L ()
  17. {
  18.   // read identification registers
  19.   Wire.beginTransmission(HMC5883L_ADDR); //open communication with HMC5883
  20.   Wire.write(10); //select Identification register A
  21.   Wire.endTransmission();
  22.   Wire.requestFrom(HMC5883L_ADDR, 3);
  23.   if(3 == Wire.available()) {
  24.     char a = Wire.read();
  25.     char b = Wire.read();
  26.     char c = Wire.read();
  27.     if(a == 'H' && b == '4' && c == '3')
  28.       return true;
  29.   }
  30.   return false;
  31. }
  32. void setup()
  33. {
  34.   //Initialize Serial and I2C communications
  35.   Serial.begin(9600);
  36.   Serial.println("GY271 TEST");
  37.   Wire.begin();
  38.   // lower I2C clock http://www.gammon.com.au/forum/?id=10896
  39.   TWBR = 78;  // 25 kHz
  40.   TWSR |= _BV (TWPS0);  // change prescaler  
  41. }
  42. void loop()
  43. {
  44.   bool detect = detectHMC5883L();
  45.   if(!haveHMC5883L)
  46.   {
  47.     if(detect)
  48.     {
  49.       haveHMC5883L = true;
  50.       Serial.println("We have HMC5883L, moving on");
  51.       // Put the HMC5883 IC into the correct operating mode
  52.       Wire.beginTransmission(HMC5883L_ADDR); //open communication with HMC5883
  53.       Wire.write(0x02); //select mode register
  54.       Wire.write(0x00); //continuous measurement mode
  55.       Wire.endTransmission();
  56.     }
  57.     else
  58.     {  
  59.       Serial.println("No HMC5883L detected!");
  60.       delay(2000);
  61.       return;
  62.     }
  63.   }
  64.   else
  65.   {
  66.     if(!detect) {
  67.       haveHMC5883L = false;
  68.       Serial.println("Lost connection to HMC5883L!");
  69.       delay(2000);
  70.       return;
  71.     }
  72.   }
  73.   
  74.   int x,y,z; //triple axis data
  75.   //Tell the HMC5883 where to begin reading data
  76.   Wire.beginTransmission(HMC5883L_ADDR);
  77.   Wire.write(0x0D); //select register 3, X MSB register
  78.   Wire.endTransmission();
  79. //Read data from each axis, 2 registers per axis
  80.   Wire.requestFrom(HMC5883L_ADDR, 6);
  81.   if(6<=Wire.available()){
  82.     x = Wire.read()<<8; //X msb
  83.     x |= Wire.read(); //X lsb
  84.     z = Wire.read()<<8; //Z msb
  85.     z |= Wire.read(); //Z lsb
  86.     y = Wire.read()<<8; //Y msb
  87.     y |= Wire.read(); //Y lsb
  88.   }
  89.   
  90.   //Print out values of each axis
  91.   Serial.print("x: ");
  92.   Serial.print(x);
  93.   Serial.print("  y: ");
  94.   Serial.print(y);
  95.   Serial.print("  z: ");
  96.   Serial.println(z);
  97.   
  98.   delay(250);
  99. }
复制代码


回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-8 07:59:11

本帖最后由 驴友花雕 于 2021-9-29 11:00 编辑

Arduino 系列传感器和执行器模块实验目录清单:

一块扩展板完成Arduino的10类37项实验(代码+图形+仿真)
https://mc.dfrobot.com.cn/thread-280845-1-1.html
连杆形式的腿机构十一种:盘点机器人行走背后的机械原理
https://mc.dfrobot.com.cn/thread-308097-1-1.html
【花雕动手做】超低成本,尝试五十元的麦克纳姆轮小车!
https://mc.dfrobot.com.cn/thread-307863-1-1.html
【花雕动手做】超迷你哦,用徽商香烟盒做个智能小车!
https://mc.dfrobot.com.cn/thread-307907-1-1.html
【花雕动手做】太搞笑啦,一支胶管制成二只蠕动机器人
https://mc.dfrobot.com.cn/thread-308046-1-1.html
【花雕动手做】快餐盒盖,极低成本搭建机器人实验平台
https://mc.dfrobot.com.cn/thread-308063-1-1.html
【花雕动手做】特别苗条,使用微波传感器控制的纤细小车
https://mc.dfrobot.com.cn/thread-308866-1-1.html
【花雕动手做】脑洞大开、五花八门的简易机器人66种
https://mc.dfrobot.com.cn/thread-307900-1-1.html

实验一百五十八:QMC5883L电子指南针罗盘模块 三轴磁场传感器GY-271
https://mc.dfrobot.com.cn/thread-308195-1-1.html
实验一百六十三:BMI160 6轴惯性运动传感器 16位3轴加速度+超低功耗3轴陀螺仪  I2C/SPI 14LGA
https://mc.dfrobot.com.cn/thread-310371-1-1.html
实验一百六十五:2.4 英寸 TFT LCD 触摸屏模块 XPT2046 PCB ILI9341 240x320 像素 8 位 SPI 串口显示器 300mA
https://mc.dfrobot.com.cn/thread-309803-1-1.html
实验一百七十六:6mm大尺寸8x8LED方块方格点阵模块 可级联 红绿蓝白色 可选8级亮度
https://mc.dfrobot.com.cn/thread-309845-1-1.html
实验一百八十一:1.3寸OLED液晶屏  I2C IIC通信 4针模块 1106/1306驱动 128*64像素
https://mc.dfrobot.com.cn/thread-311123-1-1.html
实验一百八十三:GY-530 VL53L0X 激光测距 ToF测距 飞行时间测距传感器模块 IIC通信协议
https://mc.dfrobot.com.cn/thread-310273-1-1.html
实验一百八十五:MAX4466声音传感器 驻极体话筒放大器 麦克风可调功放模块 microphone
https://mc.dfrobot.com.cn/thread-310193-1-1.html
实验一百八十九:TDA1308 硅麦克风 数字咪头放大模块 拾音器放大板 楼氏SUNLEPHANT
https://mc.dfrobot.com.cn/thread-310246-1-1.html
实验一百九十三:TCS34725颜色识别传感器 RGB IIC明光感应模块 ColorSensor
https://mc.dfrobot.com.cn/thread-310209-1-1.html
实验二百:RCWL-0515微波雷达感应开关 人体感应 智能感应探测传感器 12-15米远距离2.7G微波检测模块
https://mc.dfrobot.com.cn/thread-310313-1-1.html
实验二百零三:Air724UG合宙 Cat14G模块 DTU物联网UART串口通信数据TCP透传 核心板组合套餐
https://mc.dfrobot.com.cn/thread-310342-1-1.html
实验二百零七:I2C红色8*8LED点阵模块ht16k33驱动1088BS树莓派物联网可扩展编程
https://mc.dfrobot.com.cn/thread-310951-1-1.html
实验二百零九:Gravity: I2C & UART BC20 NB-IoT & GNSS通信模块 NB-IoT广域低功耗无线通信 GPS/北斗精准定位
https://mc.dfrobot.com.cn/thread-310433-1-1.html
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:03:22

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

QMC5883L
源于Honeywell的HMC5883L,是一款表面贴装的集成了信号处理电路的三轴磁性传感器,应用场景主要包括罗盘、导航、无人机、机器人和手持设备等一些高精度的场合。HMC5883是霍尼韦尔公司生产的一款地磁场检测芯片,其国产替代产品为QMC5883。这两种芯片基本相似,QMC 5883也是号称得到了霍尼韦尔公司的授权。 霍尼韦尔的磁传感器在低磁场传感器行业中是灵敏度最高和可靠性最好的传感器
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:03:57

QMC5883L特征
(1)霍尼韦尔(中国)QMC5883L是一款表面贴装多芯片模块,设计用于具有数字接口的低场磁感应,适用于低成本指南针和磁力计等应用
(2)结合低噪声AMR传感器的12位ADC在±8高斯场中实现5毫高斯场分辨率
(3)低电压运行,低功耗; 支持内置的自检
(4)内置式皮带驱动电路,I2C数字接口,宽磁场范围(+/- 8 oe)
(5)工作电压:3.3v-5v; PCB尺寸:1.3 x 2.3厘米(QMC5883L尺寸:3.0 x 3.0 x 0.9毫米),带有16引脚无铅芯片载体(LCC)

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:06:00

QMC5883L内部原理图

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:36:18

QMC5883L是一款多芯片三轴磁传感器。 这个表面贴装的小尺寸芯片集成了磁传感器信号条件ASIC,面向高精度应用,例如无人机,机器人,移动设备中的指南针,导航和游戏个人手持设备。

QMC5883L基于最新的高分辨率,霍尼韦尔AMR技术授权的磁阻技术。结合定制设计的16位ADC ASIC,它具有以下优势:低噪声,高精度,低功耗,偏移消除和温度补偿。 QMC5883L启用1°至2°指南针航向精度。 I2C串行总线可简化接口。QMC5883L位于3x3x0.9mm3中表面贴装16针焊盘栅格阵列(LGA)封装。

功能
1、3x3x0.9 mm3中的3轴磁阻传感器陆地栅格阵列封装(LGA),保证在扩展的温度范围内工作-40°C至+85°C。
2、具有低噪声AMR传感器的16位ADC实现2毫高斯场分辨率。
3、宽磁场范围(±8高斯)。
4、温度补偿数据输出和温度输出。
5、具有标准模式和快速模式的I2C接口。
6、宽范围工作电压(2.16V至3.6V)和低功耗(75uA)。
7、无铅封装构造。
8、提供软件和算法支持。

优点
1、体积小,适用于高度集成的产品。 信号有已数字化和校准。
2、启用1°至2°度的罗盘航向精度,允许导航和LBS应用。
3、最大化传感器的完整动态范围和分辨率。
4、在宽广的范围内自动保持传感器的灵敏度工作温度范围。
5、用于快速数据通信的高速接口,最大200Hz数据输出速率。
6、兼容电池供电的应用。
7、符合RoHS标准。
8、可获得罗盘航向、硬磁、软磁以及自动校准库。

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:37:01


QMC5883L封装3-D视图
箭头指示在正常测量中产生正输出读数的磁场方向组态。

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:37:20

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:38:44

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图2

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:39:52

外部连接
双电源连接

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:40:23

单电源连接

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:41:09

QMC5883L性能

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:41:47

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:42:14

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:42:44

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:43:02

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:43:33

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1
【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图2
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:44:23

GY-271 QMC5883L模块 电子指南针罗盘模块 三轴磁场传感器

采用高品质沉金pcb,机器焊接工艺,保证品质
名称:QMC5883L模块(三轴磁场模块)
型号:GY-271使用芯片:QMC5883L
供电电源:3-5v
通信方式:IIC通信协议
测量范围:±1.3-8 高斯
【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:45:12

该模块包括一个最新的高分辨率QMC5883X系列磁阻传感器,一个包含放大功能的ASIC,自动消磁带驱动器,失调消除以及一个12位ADC,可实现1°至2°的罗盘 航向精度。 I2C串行总线可简化接口。电原理图如下。

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图2

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:45:58

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1


引脚功能
VCC + 5V-电源引脚,给它3.3v-5VDC。 对于Arduino,建议5v
GND-接地引脚
SDA和SCL-这些是I2C数据和时钟引脚,用于从模块向微控制器发送和接收数据。 这些引脚上有1万上拉至3.3v引脚。 您可以将这些引脚连接到5V I2C线路,板上有电平转换器,可将引脚安全降低到3V
DRDY-这是“数据就绪”引脚输出。 如果要高速流传输数据(每秒超过100次),则可以在准备好读取数据时收听此引脚。 有关使用DRDY引脚的更多详细信息,请参见数据表,我们不使用它,因为我们读得不快!

Build the circuit
QMC5883L--------------- Uno/Mega2560
VCC------------------- 5V
GND------------------- GND
SCL------------------- A5/ pin21 mega2560
SDA------------------- A4/pin20 mega2560
DRDY------------------ N/C

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2021-9-29 11:50:18

QMC5883L模块的几个定义:
AMR Bridge:三轴磁性传感器
MUX:多路复用通道
PGA:可编程控制的传感器信号增益放大器
Signal Conditioning:进行磁场信号校正及补偿的数字模块
ADC:16位的模数转换器
I2C:总线形式
NVM:用于校正的非易失性存储器
SET/RST Driver:用于初始化磁性传感器的内部驱动
Reference:用于内部偏移的电压/电流基准
Clock Gen.:内部振荡器,用于内部操作
POR:上电复位
Temperature Sensor:用于内部精度/偏移的温度传感器,也可以用于测量温度并输出
QMC5883L有两种工作模式:连续测量模式和待命模式。

【Arduino】168种传感器模块系列实验(158)---QMC5883L三轴罗盘图1

回复

使用道具 举报

1234下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail