1축 아날로그 자이로 모듈 -ENC03
(1-Axis Analog Gyro Module-ENC03)
개요
- 본 제품은 무라타사의 ENC-03 칩을 기반으로 디자인된 자이로 센서입니다.
- 위치 제어 등의 빠른 움직임 측정이 필요한 어플리케이션에 사용이 가능합니다.
- 한개의 ENC-03이 장착되어 있어 1축 각속도 출력(아날로그 전압 출력)을 제공합니다.
특징
- Supply Voltage: 2.7V~5.25V DC
- Resonance Frequency: 30.8 kHz
- Max Angular Velocity: +/-300 Degree
- Output (at Angular Velocity=0): 1.35 V DC
- Scale Factor: 0.67 mV/deg/sec.
- Linearity: +/-5%;
문서
- ENC-03 Datasheet
- ENC-03 Introduction on Bsiswoyo
- 아두이노와 아래와 같이 핀을 결선합니다.
- 5V-5V, Gnd-Gnd, OUT-A0
- 아두이노 예제코드
int sensorPin = A0; // select the input pin for the sensor
float reference_Value=0;
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
int i;
float sum=0;
pinMode(sensorPin, INPUT);
Serial.begin(9600);
Serial.println("Please do not rotate it before calibrate!");
Serial.println("Get the reference value:");
for(i=0;i<1000;i++)
{
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
sum += sensorValue;
delay(5);
}
reference_Value = sum/1000.0;
Serial.println(reference_Value);
Serial.println("Now you can begain your test!");
}
void loop()
{
double angularVelocity;
sensorValue = analogRead(sensorPin);
angularVelocity =((double)(sensorValue-reference_Value)*4930.0)/1023.0/0.67; //get the angular velocity
Serial.print(angularVelocity);
Serial.println("deg/s");
Serial.println(" ");
delay(500);
}- 위의 예제 코드를 아두이노에 올리고 나면 센서를 보정하여야 합니다.
- 코드를 올리고 센서를 수평방향으로 놓습니다.
- 그 후 아두이노의 리셋버튼을 누르고 시리얼 모니터 창을 엽니다.
- 위와 같이 테스트를 할 수 있다는 화면이 나오면 보정이 된 것입니다.
- 테스트 메세지 아래나오는 결과 값은 센서를 다음과 같이 돌려서 각속도를 측정된 결과값입니다.