PULSE_COUNTER and Hall Effect Flow Sensor

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.

My device code is:

=============================
`hardware.pin1.configure(PULSE_COUNTER, 0.5);

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.

Anything obvious that I’ve overlooked?

Thanks.

Edit: Wrapped code in < code > </ code > tags.

Doesn’t that sensor need at least 4.5V?

@philmy is correct! Seeed studio has a nice page about this sensor with more information:

http://www.seeedstudio.com/wiki/G3/4_Water_Flow_sensor

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!

Slight update in case anyone has a similar problem with the April Breakout, here is another post with a similar issue and a resolution:

Electric Imp Forums - Imp and a Thermistor is not reading ADC properly

Apparently you may need to push the SD card into the socket to engage the pin properly on some boards. May be fixed with newer ones…