คำอธิบาย
มอเตอร์เกียร์ดีซี เอ็นโค้ดเดอร์ 37mm DC Gear Motor Hall Encoder
- Hall Type Encoder
- มอเตอร์เกียร์ เส้นผ่าศูนย์กลาง 37mm
- แรงดันไฟฟ้า Motor DC12V
- Rated Current 1A
- Rotation CW/CCW
- เส้นผ่าศูนย์กลางเพลา 6mm
- ความยาวเพลา 12mm
Gear Specification
- Gear Ratio 1/30
- No Load Speed 330rpm +/-10%
- แรงบิด Rated Torque 3.5Kgf.cm
Encoder Specification
- แรงดันไฟฟ้า Encoder DC3.3-5V
- 12-line double magnetic Hall Encoder disc AB-phase common output
- 30 pulses per turn (Gear Ratio 1/30)
- Total pulses single phase is 30×12 = 360
- AB Phase Incremental
Wiring Connector
- M+ ต่อมอเตอร์ Motor
- VCC Encoder
- A Encoder
- GND Encoder
- B Encoder
- M- ต่อมอเตอร์ Motor

Dimension (Unit mm.)
Gear Box lenght L 23mm

ในชุดประกอบด้วย
- 1pcs x 37mm DC Gear Motor Encoder Hall
- 1pcs x PH2.0 6 Pin x2 Cable Connector – 30cm
- 1pcs x L Motor Bracket + M3 Screw Set
คำแนะนำเกี่ยวกับมอเตอร์
- คุณสมบัติมอเตอร์ 110RPM ความเร็วต่ำ ง่ายต่อการควบคุม แรงบิดสูง เหมาะสำหรับ balance trolley, heavy trolley.
- คุณสมบัติมอเตอร์ 330RPM ความเร็วปานกลาง แรงบิดเพียงปานกลาง เหมาะสำหรับหุ่นยนต์เดิน walking robots, fire fighting robots, climbing robots.
ตัวอย่างโครงสร้างโค้ดเบื้องต้น (สำหรับ Encoder แบบ Incremental)
หากคุณต้องการนับพัลส์จาก Encoder แบบ Incremental เพื่อคำนวณความเร็วของมอเตอร์ อาจใช้โค้ดโครงสร้างดังนี้:
const int encoderPinA = 2; // Pin ที่เชื่อมต่อกับช่อง A ของ Encoder
const int encoderPinB = 3; // Pin ที่เชื่อมต่อกับช่อง B ของ Encoder
volatile long encoderValue = 0; // ตัวแปรเก็บจำนวนพัลส์ที่นับได้
volatile long previousMillis = 0; // เวลาที่นับพัลส์ครั้งล่าสุด
void setup() {
pinMode(encoderPinA, INPUT_PULLUP);
pinMode(encoderPinB, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(encoderPinA), ISR, RISING);
Serial.begin(9600);
}
void loop() {
long currentMillis = millis();
if (currentMillis - previousMillis >= 1000) { // คำนวณความเร็วทุก 1 วินาที
float rpm = (float)encoderValue * 60 / (currentMillis - previousMillis);
Serial.print("RPM: ");
Serial.println(rpm);
encoderValue = 0;
previousMillis = currentMillis;
}
}
void ISR() {
// ฟังก์ชัน ISR สำหรับนับพัลส์
// ตรรกะการนับพัลส์ขึ้นอยู่กับชนิดของ Encoder และการเชื่อมต่อ
encoderValue++;
}





รีวิว
ยังไม่มีบทวิจารณ์