Go Down

Topic: Need Help with Open Collector Output (Read 5574 times) previous topic - next topic

kevin567890

I have been working on attaching a fuel meter with an open collector output to my arduino uno to be able to electronically meter the amount of fuel I put through my gas pump. So far I am totally stumped as to how to get any type of signal on the arduino. I have tried to use a pull up resistor as was suggested to me, but this only causes the pin to remain in the "high" state no matter what flows through the meter. According to the guide, the output signal is an "Open Collector Output."

Here are the two options laid out in the meter guide to collect a signal: http://imgur.com/a/jQ1WR

Here is some further info about the meter I am trying to connect: http://catalog.gpi.net/item/g2-electronics/g2-meter-modules/conditioned-signal-output-module

Here is a diagram and pictures of what my current (failed) attempt looks like: http://imgur.com/a/ClMxq#5

Sorry to be such a noob, but I am very excited about the potential of this project and would appreciate any help anyone can give.

larryd

#1
Feb 09, 2014, 08:35 am Last Edit: Feb 09, 2014, 09:12 am by LarryD Reason: 1
Attach the Arduino sketch.
I assume the 9V battery can supply enough power to the module, (it may not).
If there is no fuel flow will there be any output, if no output, Arduino will see a HIGH.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

kevin567890

Right now I have not created any specific sketch other than a basic trouble shooting sketch to see if I am getting any change from high to low. In this case it is just a serial read of the state of the pin via the Red Bear Labs bluetooth application http://redbearlab.com/bleshield/

Once I know I am getting a good signal, I will create the sketch to convert the pulses into gallons.

Paul__B

Always a good idea to post the exact sketch you are using - in its entirety.

Grumpy_Mike

Quote
Here is a diagram and pictures of what my current (failed) attempt looks like:

No it is not a diagram it is a photograph. It is a photograph that shows very little.
Can you post a diagram.

All an open collector output needs is a pull up resistor between 1K and 10K to 5V and a common ground.

kevin567890

There are multiple photographs and a diagram in the album. If you click the images on the right you can see the diagram.

Thanks.

Grumpy_Mike


If you click the images on the right you can see the diagram.

Sorry no diagram. There is a Fritzing abortion that is totally wrong in so many ways it is hardly possible to tell you but this is not a diagram it is a physical layout.

What is the transistor? Type and number.
What are the connections, emitter base and collector?
What are you trying to do with it. It has little to do with your original question.

An open collector output needs to be connected to an arduino input pin. Then that pin also needs to be connected to +5V through a resistor. Then the ground of the open collector output needs to be connected to the ground of the output device.
No transistors need to be harmed in interfacing this.

lar3ry


Right now I have not created any specific sketch other than a basic trouble shooting sketch to see if I am getting any change from high to low. In this case it is just a serial read of the state of the pin via the Red Bear Labs bluetooth application http://redbearlab.com/bleshield/

Once I know I am getting a good signal, I will create the sketch to convert the pulses into gallons.


"a serial read of the state of the pin"  makes no sense. If you are interfacing this thing through a Bluetooth shield, and just want to do basic troubleshooting, get rid of the shield and connect directly to the Arduino. Then do digitalRead() to look at the pin.

Mike, that "transistor" is the way he is showing the fuel flow sensor, as there was no Fritzing part available for it. He should have explained that as he did in his other thread.

kevin567890

Sorry, for not clarifying that. Yes, the transistor takes the place of the meter outputs I am using. I don't mean to be so stupid about these things. I'm just doing my best to learn. thanks again for the help.

Grumpy_Mike

Quote
as he did in his other thread.

So is this a cross post?

Quote
the transistor takes the place of the meter outputs I am using.

Great still makes no sense as you have not labeled what signal is what.
I can't conceive if even if the transistor is supposed to be the transducer how it could possibly be right.
Are you reading what I tell you here about connecting up an open collector output or are you just ignoring it?

kevin567890

I am doing my best to understand and follow your advice, honestly not trying to ignore anything you say. Again, Thank for taking time to help.

To try and clarify, the transistor in the image is supposed to represent the meter I am using as there was no appropriate image I could find in the simulation software. The meter has three wires going out of it. The Open Collector Output (White), the +9v - 35v (red), and the Common Ground (Black).  (does that clarify what signal is what? If not, I think I must not be understanding exactly what you are asking about, my fault for being a noob)

http://i.imgur.com/eJih1vb.png

I have tried to follow your advice as best as I understand.

Quote
An open collector output needs to be connected to an arduino input pin. Then that pin also needs to be connected to +5V through a resistor. Then the ground of the open collector output needs to be connected to the ground of the output device.


In the image I have the Open Collector Output attached to the breadboard then to digital input 7. I then used a 10K resistor to create a pull up resistor to the +5V. The open collector ground is connected to the arduino ground also. Have I misunderstood something?

MarkT

The first thing to do is use a multimeter on this sensor, connect the 9V to
the appropriate pins, a 1k pullup from the open collector to the +9, and
also measure the voltage with a multimeter and play with the flow to see
what's happening.

Once that's working try moving the pull-up to +5V and check it still
works (the info for the sensor didn't recommend that, note, it
should work but be paranoid). 

Then connect everything to the Arduino having first tested a sketch can read a pin...

In other words to find a problem divide and conquer, don't keep bashing away
at the whole system, break it into parts and check each one independently.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

michinyon

The explanation of connecting that device is one of the worst I have ever seen.      It seems to generate some kind of output signal,   without any power input.    Maybe there is some plutonium in there.

kevin567890

I tried to follow Mark T's advice but was a bit concerned about getting the 9V too close to the board. So instead I broke out the multimeter and started testing continuity and voltage. It appears that while the meter is still the resting voltage is 0.6V when the meter begins to spin, the voltage drops. The faster it spins the closer to 0 it gets. I don't know if that is a helpful observation or not.

kevin567890

Also, here is the code I am using. I keep getting a return of "1" no matter how fast the meter runs.

Code: [Select]
int MeterRead = 7;


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

  pinMode(MeterRead, INPUT);
}


void loop() {

  int MeterState = digitalRead(MeterRead);

  Serial.println(MeterState);
  delay(1);        // delay in between reads for stability
}

Go Up