Proper impeadance to add to a pnp transistor

Hi all.

I've been using a pnp swith with my arduino. The idea is that it should hold it's input voltage above a certain threshold. When the sensor is tripped it drops it's voltage and triggers a sequence in the arduino. What has been happening is that it will only operate close to correctly if my threshold is set between 750 and 755, which make no sense since my threshold should be able to be almost arbitrary. Also, when the sensor trips, it takes almost a second to trigger the board. The really weird thing is when I put my fluke multi-meter into the circuit to measure the voltage being sent to the board all of a sudden it works perfectly, and the threshold can again be arbitrary. I am no electrician, so any assistance is greatly appreciated.

Thanks

A PNP is turned on by current flowing from E>B. It is normally driven via a resistor to the Base and using the vontage difference combined with the resistance you can calculate the current. The transistor has a parameter called the gain (hfe) which you can multiply the E>B current by in order to find out what current it will allow to flow from E>C.

So you need to find out how it is being driven and the voltages applied and then choose a suitable resistor so that the output of the transistor is fully turned on to provide the current you require.

That makes some sense. Could you define E>B and E>C? Also, if the resistance is supposed to be between the board and the transistor then how come the multi-meter fixed it when it was hooked up between the board and ground?

You are needed a comparator like an LM339, not a transistor. Or use an analog pin directly and implement
the threshold in software, which is more flexible.

E - Emitter
B - Base
C - Collector

So E>B is current flowing into the emitter and out through the base etc...

The multimeter will have a impedance which is normally quite high but it might be enough to allow a bit higher current to flow and enable the circuit to work.

Actually re-reading the original posting, the behaviour changing when the multimeter is
added either suggests the circuit is oscillating at high frequency, or is very high impedance
and sensitive to very small currents.

Is there any hope of seeing the actual circuit (handdrawn diagram is fine) and getting details of
this sensor? We are lacking crucial details.

I will draw it out but I'm no EE so it might not be perfect. Here is everything you need to know about the transistor http://www.automationdirect.com/static/specs/ip69kpe18mmff.pdf I'm using the FFIZ-BP-1E through beam sensor. I'm also powering it with the 5v from the arduino because I can't send to much power to the board, but it seems to function the same when I hook it up to higher voltages. I'll post a drawing in a sec.

here is a circuit diagram Imgur: The magic of the Internet

The sensor connects +ve to its output when triggered. You will need a couple of resistors :-

  1. A resistor between the arduino input and ground. The sensor output is floating when not triggered so the arduino input voltage would otherwise float to random values.

  2. A resistor in series with the sensor output and arduino input. This protects against damage in the even the arduino gets configured for the pin to be an output and tries driving it low at the same time the sensor is active (while booting for example).

Something like 1K for the series resistor and 100K for the resistor to ground should be fine.

I tried that and there is still a delay between when i trip the sensor and when the board reacts to it. This delay is still fixed when I put my fluk 115 meter between the sensor output and ground.

Also, when I measure the current going into the board without the resistor I get 1.955 as a vaue.

Some other interesting behaviors. When I fire another pnp into a different arduino input, if this particular pnp is on it gets stuck on, and if it's off it gets stuck off. Not sure what that means.

Usually would mean... broken

What voltage are you supplying to the sensor?
The datasheet sais a supply voltage of at least 10V. You can't send that to the Arduino as you could end up damaging it.

Can you post a diagram showing the supply voltage you are using and where you currently have the resistors and what values they are.

Ihttp://imgur.com/CzSDoh3 here is a better diagram. I know it says 10v. It has been functioning on it's own well with the 5v though and, as I've said, It does still work perfectly with the meter between the sensor output(blue) and ground(black).

Do you have the resistor between the arduino input and ground?
Without it the input will be floating when the sensor is off and could be any value. In this case when you connect a meter across it you are effectively connecting a 1Mohm resistor between the input and ground. So if the circuit works with the meter there then thats additional proof that you really do need a resistor.

post your code.

What pin is the sensor connected to ?

Where is the link to the vendor for the sensor ?
Where is the sensor datasheet ?

Draw your circuit using the pnp diagram 2 from the datasheet so we can see the power connections.

Include wire colors for all wires. Show all connections, includiing arduino connection.

It sounds to me like you are just missing a pullup /pulldown resistor and also you may be treating a digital sensor like an analog one.
I'm at work so I don't have time the read the datasheet right now.

SOLVED! I put a 10 mega ohm resistor between ground and the sensor output on all of the pnp switches and a 10 pico-farad capacitor across the power source and she works like a charm. I'm also going to power the sensor with the appropriate 10V and add a voltage drop to 5V for posterity's sake.

After looking at the datasheet it's clearly digital but comes in N.O. or N.C. versions as well as Light ON and Light OFF versions.

This explains why it wouldn't work without a pullup resistor.