I am trying to test a very simple hall effect flow sensor by using PULSE_COUNTER but am having little success. I have checked the forums and it’s not clear if anyone has solved this. I tested the flow sensor - model FS400A - using an Arduino Uno and interrupts and it worked fine.
function poll() {
local numPulses = hardware.pin1.read();
server.log("Number of pulses counted = " + numPulses);
// wake up and do it again
imp.wakeup(1.0, poll);
}
poll(); `
The number of pulses counted is always zero.
I am using an April board and the hardware wiring is simply: sensor ground to April ground; sensor positive to April 3.3V; sensor pulse output to PIN 1 configured as PULSE_COUNTER.
Only difference in setup with Arduino is that I used 5V and interrupts.
Thanks @philmy for the hint and @beardedinventor for the link to the specs (I had not yet come across Seeed Studio).
I gave that a go - changing the voltage to 5v - but no luck.
I then hooked up the Imp to an Arduino outputting a regular pulse and could not get the Imp to count them.
Any ideas on what else I may be overlooking? Maybe the pulse counter is not working?
Thanks.
UPDATE: Solved!
Seems PIN1 did not work on the April Board that I was using. I changed the breakout board and all seems to work. Hooray!
Also, I found the specs for the FS400A Water Flow Sensor and it seems to work with a 3.3VDC power supply (even though operating voltage is 4.5VDC?)…but I guess I will know how well when I calibrate it!