NPN to PNP high speed signal conversion

Thread Starter

diesel

Joined Jan 8, 2007
4
Hi

I have a problem with marrying up a high speed counter positive input on a PLC, where I have a hall effect NPN pulse on a flow meter. Is there an easy circuit to convert the NPN signal to PNP?

Kind regards diesel
 

Thread Starter

diesel

Joined Jan 8, 2007
4
Hi

It is hard to see what to put on a wiring diagram as the sensor will not work at present, I will try to explain

The PLC is a Siemens Logo - voltage range 12 to 24vDC I am using 12vdc for testing, but would want to use either 12 or 24vdc as the application is automotive. Inputs 1 to 8 are positive (high switching) inputs I5 and I6 can be used for high speed counting up to 2Khz, I tried to connect my flow meter - voltage range 10 to 28vdc like this: 12vdc+ve and 12vdc-ve to sensor (from the same connections that power the Logo controller) and an output from sensor to I5 is pulsed, the higher the flow the higher the frequency of the pulse from min 36hz to max 917hz but as it is NPN it pulses a negative pulse (test lamp between 12vdc-ve and I5 shows pulse), I require a circuit to invert this negative pulse to a positive pulse so it will interface to I5. Does this help?

Kind regards Diesel.
 

thingmaker3

Joined May 16, 2005
5,083
Couldn't you just invert the pulse with any old transistor? PNP and NPN are transistor types. Pulses come in negative-going or positive-going. One does not mandate the other.
 

KrisKizlyk

Joined Jan 6, 2007
8
Simple, you need a pull up resistor if your using a NPN configuration. We do that for converting a NPN posi-flo sensor (1k should be sufficien). It will be high all the time, but when you pulse whatever it is that your pulsing it should be enough to give you a pulse train.
 

Thread Starter

diesel

Joined Jan 8, 2007
4
Hi

You say to use a pull up resistor, forgive my ignorance but where and how would I connect it?

Kind regards diesel
 

mcj74

Joined Jan 10, 2007
8
Hi Diesel. Let me see if I understand this correctly. You have a flow sensor, powered from +12v and ground. Its output is a signal wire which is either OPEN or LOW (what is called an open-collector output.) You're trying to connect this to a PLC, assumedly running internally at 5V, which requires an input voltage of at least 2.5V to register as a logical "high" or 1. But nothing is happening, because the wire is never going "high", correct?

If the PLC input has a limit of 0-5v, simply applying a pull-up resistor may damage the PLC! What is the input specifications for the PLC?

A pull-up resistor is nothing more than a resistor connected from the signal lead to +12v. It "pulls it up" to 12v when it is NOT being driven low (by the flow sensor.) When the flow sensor activates the signal line, it is forcibly pulled down to 0v, effectively overriding the pull-up resistor. This way, the PLC should see +12v when the flow sensor is NOT active and 0v when it IS active.

The problem with this is, that if the PLC is a 5V device and you pull an input pin up to 12V, it will likely damage the PLC. In that case, you will have to supply a +5v supply and pull that line up to +5v instead.

The resistance value of the pull-up resistor itself mainly depends on the speed at which the data is streaming. Faster speeds need faster pull-up times so less resistance is required to pull it up in time. 1k is a very small value for most typical pull-up applications, even up to the GHz range and will waste significant energy as heat, especially if you could run it at 24v: (24V*1k=24mA=0.576w.) This means you'd want to use a 2W resistor for this and plan on a way to keep it cool so it doesn't start a fire. Try a 50k (0.25w) or 10k (0.5w) first, then a 4.7k (1W) if neither of those work. Chances are, the signal line will work just fine with a 220k or 100k pull-up resistor. However, this also makes the line more prone to picking up stray interference, which can be a consideration in an automotive environment. Have fun. :)
 

Thread Starter

diesel

Joined Jan 8, 2007
4
Toe everyone who has contributed to my problem:

Thanks very much for your input and help, it has been most useful.

I have tried a pull up resistor, starting with a 20k then a 10k which did not produce a high input, I gradually went lower and found that although a 1k resistor worked the counter was a little inaccurate, so I tried a 0.5k and this works very effectively, I have just got to monitor it now to see if it gets hot, if it does would just replacing the resistor with a higher wattage suffice?

Thanks Diesel
 
Yeh just bump up the wattage rating of the resistor if you want to not damage the resistor. You can figure out the wattage that your using by using the formula that is just as easy as P = IE. And your can figure out I by using ohms law. I = E/R where R is the resistor your using and E is your control voltage.

But be careful, as I just figured this out this week, do not use too low of a Resistance because it will not pulse.
 
Top