霍尔传感器 WCS138

  • WCS138 VCC 接Arduino的5V供电,则WCS138的测量范围为$\pm 200Gs$
  • WCS138 AO 接Arduino的模拟输入,比如A0. Arduino的模拟测量范围为0-5V,10bit,所以$0Gs$对应的为2.5V
  • WCS138 DO 为数字电平口,其高低电平的变化临界点由板载的精密电阻器调节
  • WCS138 的精度为 $8.3 mV/Gs$
  • 结合上述信息,测量结果与Arduino的模拟读数的关系式为:
    • $$\frac{B}{Gs} = ( analogRead(A0) * 5.0 / 1024.0 - 2.5) * 1000 / 8.3 $$
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
}
 
void loop() {
  // put your main code here, to run repeatedly:
  Serial.println((analogRead(A0) * 5.0 / 1024.0 - 2.5) * 1000.0 / 8.3);
  delay(100);
}
  • innovation_lab/hardware/hall_sensor.txt
  • 最后更改: 2019/07/26 15:21
  • 由 daizhirui