Nano Flow Sensor adapter

so i have a nano and a hall flow sensor from amazon

i paid someone online write this code to convert the signal from the sensor to just an on or off state for a 3d printer endstop input. so ive uploaded the sketch and it seems to be working somewhat because the serial monitor says 0.0 flow and the output pin is high, but it doesn't see the flow sensor. does anything jump out to anyone here as to maybe why? the sensor output is connected to pin 2 and nano output is pin 3.

ARDUINO_CODE.ino (1.26 KB)

What does "doesn't see the flow sensor" mean? What is flowing through the sensor? Wiring diagram is necessary, besides correctly posting the code.

Paul

my 3d printer is water cooled, i need to add a water flow sensor too make sure the hotend stays cooled. so with it powered on and water flowing, the serial monitor outputs 0.0 and with water not flowing also 0.0 and pin 3 is at 5v. which is correct but its not reading the pwm input on pin 2. i assume.

nicklindenmuth:
my 3d printer is water cooled, i need to add a water flow sensor too make sure the hotend stays cooled. so with it powered on and water flowing, the serial monitor outputs 0.0 and with water not flowing also 0.0 and pin 3 is at 5v. which is correct but its not reading the pwm input on pin 2. i assume.

Got it!

The signal is not PWM it is an off/on signal whenever the magnet on the impeller passes the sensor.

Check the output with your DVM. one pin on the sensor wire ,other on ground. Set the meter so you can easily see 5 volts. One pin on the sensor output and one pin on ground. With water flowing you will see meter fluctuations. If not, something is not working.

Does the sensor impeller turn? Can you see it turn?

Paul

now that im looking harder it does not seem to be spinning...hmm, maybe i need a smaller one. when i tap on it it spins a bit and ia get a 0.1 so it seems to actually be working fine, its just not enough flow to spin it.