Help in using IR receiver as a proximity sensor.

HI all
Can somebody help me with a problem i am facing ?

I am using a 56khz IR receiver and an standard through hole IR led as a proximity sensor.

Datasheets :
IR receiver

not exactly my led but very similar to this.

IR LED

the vf on led is 1.2 v and my vcc is 3.3 v . i am pumping 30 mA of current to LED.

The position of the receiver is on the top of pcb and position of my IR led is exactly below the emitter on the bottom side of pcb. the height of the receiver from the ground is 23 mm. the emitter and receiver is exactly at the near to the edge of pcb so the receiver is not sticking out.

I am modulating the data at 56 Khz carrier frequency that I need to send and sending it through the IR led.
Now the problem is my Receiver is picking up my sent signal.
the only time it should do is when the something is in front of the board and ir light bounces of the the object and signal picks it.

i am testing in a dark room with no direct sunlight . only tube light is present.

I have tried following things but none of them have worked till now.

I have tried using a right angled led. as its light emitting direction is forward instead of a all around of a normal led.

I have tried wrapping the normal and right angled led the black paper.

I have tried shifting the led backward.

I have tried covering the floor with black paper.

I have also tried the board upside down so the RX in on the bottom side and led is on the top side.
i even tried covering the led and RX with my hand to but still it is receiving

How have you wired up the power to the IR receiver?
Those sensors need to be supplied with a seriese resistor of 100R in the 5V supply line and at least a 4u7F capacitor across the power pins. What you see might very well be the amplifier picking up the modulated signal through the power supply noise. This decoupling arrangement is designed to reduce this.

Grumpy_Mike:
How have you wired up the power to the IR receiver?

I have consulted the datasheet to the receiver while wiring the circuit . As they have not included any passive components. thus I have also NOT used any series resistance and I have NOT used any Decoupling Caps. I have literally connected Vcc pin to 3.3v , GND pin to gnd , and OUT pin to my microcontroller.

I am also using a mosfet arrangement to drive the IR led . and using a microcontroller to control the gate.

Now they thing is While breadboard testing with exact same components the circuit everything was working fine.

Enough though i did not use any Series R and decoupling Cap , everything worked just fine.
there i was NOT picking up any stray IR.

If you are interested here is an application note

I dont have a 5v supply line . only a 3.3v one.

Grumpy_Mike:
What you see might very well be the amplifier picking up the modulated signal through the power supply noise.

As for this I have included 2 4.7 uF ceramic caps just next to my V regulator (as regulator’s datasheet recommended) . and my board has lots of decoupling capacitors of various uFs. There is a Decoupling Cap (Tantalum) of 10 uF near the RX. but that is for another IC.

Grumpy_Mike:
What you see might very well be the amplifier picking up the modulated signal through the power supply noise.

Can you explain this to me ?

Thank you for your time

I don't care what that application note says all the other Vishy sensors recommend this sort of decoupling on the receiver's power lines. In fact when I was working we once had to recall 10,000 set top boxes because of trouble because it was not fitted.

What you see might very well be the amplifier picking up the modulated signal through the power supply noise.

Can you explain this to me ?

What is their to explain? power supply noise affects chips, especially analogue ones like this.

I am also using a mosfet arrangement to drive the IR led

What FET, few of them work correctly on 3V3?

Now they thing is While breadboard testing with exact same components the circuit everything was working fine.

Yes but it was not the same layout was it. These things matter more with analog components than digital ones.

Try to replace the IR LED with some other load (a small resistor which will 30mA). If the problem persists you know it is power supply noise. Breadboards are full of parasitic resistances and capacitances. It may explain why it worked on breadboard but not in "better" setup.

Smajdalf:
Try to replace the IR LED with some other load (a small resistor which will 30mA).

my reciever has a built in UV filter and a demodulator so that it only works with the signals of 56Khz frequency . it generally ignores the ir un modulated IR light.

When i fully cover my IR led with a piece of black paper. my RX stops receiving the signal. so I am thinking the noisy power supply might not be an issue. but i will look into that .

Smajdalf:
Breadboards are full of parasitic resistances and capacitances. It may explain why it worked on breadboard but not in "better" setup.

Can you explain is there any way of knowing the parasitic resistances and capacitances of BB ?i think it will be very very less but just out of curiosity ? i dont have an LCR meter or i could have measured.

In my pcb we can calculate the track resistance of Data_OUT pin. But there might be very less series resistance to the VCC pin as the pin is directly connected to the VCC plane.

Thank you for you time

Grumpy_Mike:
In fact when I was working we once had to recall 10,000 set top boxes because of trouble because it was not fitted.

Damn !!!

Grumpy_Mike:
What is their to explain? power supply noise affects chips, especially analogue ones like this.

How is this device an analogue device ? I agree the internal component and system and setup (input , filtering, demod) is analogue but the output of the receiver is digital HIGH or LOW . This should make it a digital device as the whole system as we are only dealing with the high or low pulses .

(Although i do agree the digital devices also need decoupling caps and current limiting resistances. so i will try that).

But i dont think noise is issue here as. because i am getting the exactly same data i am transmitting . if a noise was an issue, then i would get some garbage (or something other data than i am sending.)

logic i am following

step one : modulate 0xAA to 56 khz
step two: send the modulated data thorugh IR led.
step three: if a receiver receives some value . check what has it received.
step four : if received value is 0xaa then i have received what i have sent. so obstacle is detected.

Grumpy_Mike:
What FET, few of them work correctly on 3V3?

It is a n channel mosfet . it is rated for 3v3 and it works fine without any problem. i have used it my other project and it has not failed me once.

One more thing i have noticed is my RX receives signal when it is on the floor. but when it is 30 cm above the floor this problem vanishes away.

Is there any way i can physically remove this problem? like in my pcb design ?i do have lots of board space around.

(although shifting the ir led doesnt work)

Parasitic capacitance of adjanced rows of a BB is said to be in order of pF. 5-10pF IIRC. You can try to guessimate it for example from frequency of a Schmidtt triggrer oscillator with large resistor. Resistance of my BB is not so high (<0.1 Ohm for the short row). But resistance of BB-jumper wire varies wildy, typical values are 1-10 Ohm, any touch of the wire changes it unpredictably.

It is a n channel mosfet . it is rated for 3v3 and it works fine without any problem. i have used it my other project and it has not failed me once.

I thought you wanted help, why will you not cooperate?

How is this device an analogue device ?

Because it is a tuned amplifier so that it can reject other frequencies of IR.

If the problem goes away when the LED is hidden behind a black paper it is hardly a power supply noise. You may try to use a visible LED and hopefully see where the light go and why it triggers the sensor.
Also it may be worth to post a photo of the circuit.

I had a similar experience to yours (as detailed in your first post) a few months ago. I had a bunch of hair in my hands to prove it.
I put a 27ohm resistor in series with the emitter, I also used a 5k (or 10k I can't remember) pot in series with the emitter. I adjusted the resistance, and the receiver then stopped continuously receiving, and things started to behave as intended. How or why, I don't know

Steve

Grumpy_Mike:
I thought you wanted help, why will you not cooperate?

I have agreed to all of your points . And i will do what you have said as soon as i reach my office.

manveen_singh:
It is a n channel mosfet . it is rated for 3v3 and it works fine without any problem. i have used it my other project and it has not failed me once.

Here i have only stated that that my mosfet arrangement works fine. i am not disagreeing to you in any way.

If you think my mosfet can be a problem then sure i can replace it by something else. or drive led directly by my Microcontoller directly. (for now only.)

Grumpy_Mike:
Because it is a tuned amplifier so that it can reject other frequencies of IR.

i do agree but this is the internal design of the component . the output is still Digital HIGH or LOW . So any noise present can give me wrong pulse. which can cause my received data not match my sent data . am i correct here ?

steve1001:
I had a similar experience to yours (as detailed in your first post) a few months ago. I had a bunch of hair in my hands to prove it.
I put a 27ohm resistor in series with the emitter, I also used a 5k (or 10k I can't remember) pot in series with the emitter. I adjusted the resistance, and the receiver then stopped continuously receiving, and things started to behave as intended. How or why, I don't know

Steve

OK i will try that. can you tell me you connected the resistance in series with the vcc pin right ? and what vcc were you using 5v? 3.3v? and where was your ir led and rx physically located ? like were they right next to each other or far apart or above and in bottom ?

manveen_singh:
Here i have only stated that that my mosfet arrangement works fine. i am not disagreeing to you in any way.

but you are not replying specifically.

manveen_singh:
If you think my mosfet can be a problem then sure i can replace it by something else. or drive led directly by my Microcontoller directly. (for now only.)

and there's the issue, without replying what type (specifically), he can't say.

a lot of problems comes from the details, it's fine if they are left out when first raising the issue, but when someone tries to help and you reply with just a generic answer "it works with 3.3V (and how do you know that ??)" - then you should give the part no. and even link to datasheet because the senior members here will know what to look for that may be causing the problem.

if you want help, you DO WHAT the helper ASKS FROM you - otherwise you're wasting the helper's time.

Smajdalf:
Also it may be worth to post a photo of the circuit.

BabyGeezer:
but you are not replying specifically.
and there's the issue, without replying what type (specifically), he can't say.

a lot of problems comes from the details, it's fine if they are left out when first raising the issue, but when someone tries to help and you reply with just a generic answer "it works with 3.3V (and how do you know that ??)" - then you should give the part no. and even link to datasheet because the senior members here will know what to look for that may be causing the problem.

if you want help, you DO WHAT the helper ASKS FROM you - otherwise you're wasting the helper's time.

Thank you for your clarification. i will be more carefull next time.

Now the problem is sometimes i cant specifically say which specific component i am using. because i have to get clearance from my boss even for telling which component number.

i will now leave a link to the datasheet here :

Bss138 n channel mosfet

it works with 3.3V (and how do you know that ??)

I do know that this is working fine as i have used it many times before in same scenarios. (3.3 v) every time switching circuit is same . only the component that needs to be switched is changed.

And as always thank you for your time.

manveen_singh:
OK i will try that. can you tell me you connected the resistance in series with the vcc pin right ? and what vcc were you using 5v? 3.3v? and where was your ir led and rx physically located ? like were they right next to each other or far apart or above and in bottom ?

The emitter was connected directly to a pin. Pin-27ohm-pot-led-ground. 5v Mega2560.
The emitter and receiver were side by side on a copper strip board, 5mm apart.
I'm away at the moment, and will check all details when I get in later.
Steve

i will now leave a link to the datasheet here :

Thank you.
Now what makes you think that this device is suitable for switching with 3V3?
It is clearly not. The gate threshold value is the point where the FET turns off. The Ron value is only quoted at 4.5V, and it is 6 ohms at that value!

But given your past responses I don’t think you can be persuaded of this, so I will leave it to others to try and help you.

Now the problem is sometimes i cant specifically say which specific component i am using. because i have to get clearance from my boss

Quite clearly your boss is a nob head with no idea how electronics works in general. This is an open source leaning forum and operating under minimum information is not a practical way of going about things. I would only suggest to your boss that he employees an engineere who is better at fault finding and at taking advice.

Good luck both to you and to others trying to help you.

Grumpy_Mike:
Quite clearly your boss is a nob head with no idea how electronics works in general.

My boss is not a nob head . He is a genuine guy who is just trying to follow the company policy. (As we are not allowed to disclose any important part number.) He knows how these forums work.
I would also like to say that he does not choose the component, I Choose the components.
So i have designed all these circuit and all the board.

Grumpy_Mike:
This is an open source leaning forum and operating under minimum information is not a practical way of going about things.

I do agree But i have given the required information. and if anyone needs more i will happily give them more info.

Grumpy_Mike:
But given your past responses I don’t think you can be persuaded of this, so I will leave it to others to try and help you.

Come on, when when i have said i wont listen to you or i wont do what you have said ?
I am literally doing everything you say. i have also apologized for my past responses. and as i state above i will give more information if anyone need it.

Please dont get angry if i ask why ? as i am trying to understand the logic behind the solution.

Grumpy_Mike:
I would only suggest to your boss that he employees an engineer who is better at fault finding and at taking advice.

Thank you for your advice , i will convey this to my boss.

NOW coming back to problem in hand

Grumpy_Mike:
The gate threshold value is the point where the FET turns off. The Ron value is only quoted at 4.5V, and it is 6 ohms at that value!

According to the datasheet the VGS(th) Gate Threshold Voltage VDS = VGS, ID = 1 mA is 1.3 V

lets say our D is connected to vcc of 3.3 v
And S is connected to GND 0v.

So if i give 0v to the gate Vgs is 0 v and mosfet when remain off

If i give HIGH pulse to gate so that Vgs becomes 3.3 v,
which is greater than Gate Threshold Voltage is 1.3 V ,

Am i correct in assuming the mosfet turns on ?

And also according to datasheet the On-Resistance Variation with
Gate-to-Source Voltage. graph that at Vgs = 3.3 v the Ron is 1.2 ohm

steve1001:
The emitter was connected directly to a pin.

Do you mean The IR led or is it the receiver?

steve1001:
Pin-27ohm-pot-led-ground.

you mean IR LED here right?

Thank you . but here also you have not connected anything between receiver's Vcc pin and have you used a decoupling capacitor For the receiver ?

I can see that you have controlled the current passing through the IR led. thus you might have changed the intensity of the IR light. which would have removed this problem.