Product Details
Items Discontinued
MPN :
SKU : E12V350R-G65
Brand :Brand
Stock : Out of Stock
Price:PKR 1400.00
High torque 12v 350RPM Motor with encoder and gearbox unit JLN4B02
Length: 70 + 5 +15 width: shaft = 5 , Motor = 38
Weight: 235g
Arduino Example codes:
Note:
Base resistor: 10-ohm to 220-ohm.
Transistor: any kind of NPN.
int rpm_pin=4, state, state2, read_time=1000;
double counter, rpm, last=0, rps;
void setup() {
Serial.begin(9600);
pinMode(rpm_pin, INPUT_PULLUP);
}
void loop() {
if(digitalRead(rpm_pin)==LOW){ state=LOW; }
else{ state=HIGH; }
if(state2!=state){ counter++; state2=state; }
if(millis()-last>=read_time){
rps = counter/2;
rpm = rps*60;
counter=0;
Serial.println(rpm);
Serial.println(rps);
last=millis();
}
}