Hi everyone, I have a water pump in this picture and its data sheet, there is a yellow line (speed feedback) I try to connect it with the Arduino, but I don't know how to show the speed with any screen, could someone get me a solution please.
here is the code that I already run the pump with different PWM
const int pwmPin = 9; // connect to PWM pin
const unsigned int desiredFrequency = 30000; // PWM customize,Hz
void setup() {
pinMode(pwmPin, OUTPUT);
setupTimer2(); // set up timer2
}
void loop() {
analogWrite(pwmPin, 200); // duty cycle 0-255,50% is 128
delay(2000); // run 2s
analogWrite(pwmPin, 0);
delay(2000); // wait 2s
}
void setupTimer2() {
TCCR2A = _BV(COM2A1) | _BV(WGM20) | _BV(WGM21); // fast PWM mode
TCCR2B = TCCR2B & B11111000 | B00000010; // timer 2 prescaler is 8
OCR2A = (16000000 / 8 / desiredFrequency) - 1;
}
BY the manual you linked to, the yellow wire is used with the brushless motor for feedback for speed control. As the pictures show for PWM use the yellow wire is left "dangling"!
Do you have access to a scope? Check the yellow wire, if you get nothing try a pull up / pull down resistor one at a time and see what the yellow wire gives you. You may get a valid signal. The data sheet does not give much to go on. Contact your source for information, they may be able to help you.
The speed feedback of the yellow line is connected to the oscilloscope probe or the host
computer. 1 pulse/rotation speed (rev/min) = FG signal * 60
Hint; Google
arduino tachometer
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.