I am using a Netafim M-Series flow meter interfaced with a UC-32 Arduino. The goal of this is to create a pulse counter than in turn will allow us to determine flow rate in the meter. (1 US gallon per pulse for this model.)

I am using a relatively simple program to test my wiring and the flow meter's connection to the UC-32. I will include it here:

int pin = 30;
volatile unsigned int pulse;
const int pulses_per_litre = 450;

void setup()
{
  Serial.begin(9600);

  pinMode(pin, INPUT);
  attachInterrupt(0, count_pulse, RISING);
}

void loop()
{
  pulse = 0;
  interrupts();
  delay(1000);
  noInterrupts();

  Serial.print("Pulses per second: ");
  Serial.println(pulse);
}

void count_pulse()
{
  pulse++;
}

Code was obtained by a source online, since I will make my own to match my specific needs later on. The problem is, no matter how much I modify this code, I receive 0 pulses (even when blowing air into the meter). I have therefore narrowed down the problem to wiring.

I am using a small breadboard with a 1 kOhm Resistor. The flow meter requires 12v input that is supplied by a barrel jack power supply into the UC-32. I will show an image of my circuit. From what I can see, this should be working, but I feel like I'm sort of going insane looking over and over this circuit so I wanted to get an outside opinion.

Breadboard UC32

Sorry about the large sizes images, but to me, it is a simple circuit that should work. I could be very wrong. Does anyone with perhaps experience with this sort of flow meter see any problems with my code/circuit?

Fixed, wow. Sometimes typing out your problem helps answer the question. Resistor position was wrong, and adjusting the Vin wire.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.