Beginner, infrared proximity detector working wrong way around

BobTPH

Joined Jun 5, 2013
8,816
If the emitter is not emitting, then it would work as you describe. It is reacting to ambient light and the hand is blocking it.

To test this theory, try it in a dark place.
If it is as I think, the it should not beep and light at all.

Bob
 

Audioguru again

Joined Oct 21, 2019
6,674
The parts descrition has a few important translation errors:
1) D1 is not an IR receiver, instead it is an IR LED with a missing part number.
2) D2 is not an IR transmitter, instead it is an IR diode also with a missing part number. Maybe it is a receiver that works the opposite to a diode.
3) Hee, hee. The transistors are obviously not diodes.
Buy cheeep ebay, get Chinglish.

EDIT: I am also watching my TV about the virus. If you replace the PNP transistors with NPN transistors then you must also swap the emitter and collector pins by turning around the transistors.
 

Thread Starter

notquitethere

Joined Mar 23, 2020
14
If you replace the PNP transistors with NPN transistors then you must also swap the emitter and collector pins by turning around the transistors.
Noted, thank you. I might end up trying all this on my own. It might be too much of a TODO list for my six year old to sit through with me: "Yes we're doing it again but THIS time it's slightly different... here, I think" :D
 

jpanhalt

Joined Jan 18, 2008
11,087
When you get it "sort of" working, consider making a light guide to improve the detection cone. I used a small piece of aluminum tubing from a hobby shop. Aluminum foil spindled around a pencil works well too.

Be sure the tube covers the detector diode and extends a little above it so no direct light from the IR emitter can get to it. Your hand or any object will reflect enough light into the tube to register. A paper tube may not work, as it can admit too much light from the sides. Covering it with black electrical tape will fix that.
 

Thread Starter

notquitethere

Joined Mar 23, 2020
14
Probably didn't need to use 5 amp wire.


But this doesn't work.

I made another with D2 and R2 swapped and that didn't work either. (Wasn't sure which was around the receiver was supposed to go in R2's position so I tried both.)

I must be doing something wrong, but for it to behave the same way with the pins and components swapped (on different boards; I didn't swap pins AND components on the same board) is mysterious.

Maybe I'll try breadboarding it out next.

:confused:
 

djsfantasi

Joined Apr 11, 2010
9,156
Probably didn't need to use 5 amp wire.


But this doesn't work.

I made another with D2 and R2 swapped and that didn't work either. (Wasn't sure which was around the receiver was supposed to go in R2's position so I tried both.)

I must be doing something wrong, but for it to behave the same way with the pins and components swapped (on different boards; I didn't swap pins AND components on the same board) is mysterious.

Maybe I'll try breadboarding it out next.

:confused:
Please stop posting on IMGUR or at least upload the file to AAC. I can’t see the IMGUR post reliably and the forum discourages off site image posting. If I want to look closely at your picture, IMGUR often screws up and instead of your picture, it displays someone else’.
 

Thread Starter

notquitethere

Joined Mar 23, 2020
14
Please stop posting on IMGUR or at least upload the file to AAC. I can’t see the IMGUR post reliably and the forum discourages off site image posting. If I want to look closely at your picture, IMGUR often screws up and instead of your picture, it displays someone else’.
Oh, sorry.

FWIW I don't think this particular one shows much, only the inappropriate wire I was using.
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,087
When I have tried "everything" and nothing works, I take a nap and go back to the start.

First, I don't see anything wrong in theory (see below about PNP transistors) with your original schematic. In the absence of IR, D2 should be off. That makes the non-inverting input (+) higher (in theory) than the inverting (-) input, so output should be high, which should turn off both V1 and V2.

1) Go back to the original and remove D2 temporarily. Are the signals off? If not, what is the voltage on pins 3, 2, and 1. Pin 3 needs to be higher than Pin 2. When that's the case, Pin 1 should be the same or very close to J1. If not adjust R3 until it is. If you can't, go to step 2. Are the signals still on? If so, doubletriple check the transistors. Check the numbers on them and lookup the data sheets. They must be PNP and the emitters need to be connected high (as shown). PNP transistors often are viewed to "source" current and NPN "sink" current (others have said the same). In the design you have, the PNP transistors are sinking current. This is a typical circuit of a PNP transistor "sourcing" current:

1584999296502.png

But, let's work with the design you have first. Oh, toss the 5-amp wire. See if you have any 6 awg (kidding). Use whatever gauge you have. A 22 awg to 26 awg is just fine.

2) Let us know what you find.
 

Audioguru again

Joined Oct 21, 2019
6,674
I do not know why he calls this circuit a Proximity Detector and is waving his hands at it. Bad ebay Chinglish?
Originally it detects when the IR Diode has the IR LED shining on it. The warning turns off when something blocks the beam.
Swapping around D2 and R2 will cause the warning that something is blocking the IR beam.

Here is a circuit to detect that something blocks the IR beam and two other technical problems:
 

Attachments

Thread Starter

notquitethere

Joined Mar 23, 2020
14
When I have tried "everything" and nothing works, I take a nap and go back to the start.

First, I don't see anything wrong in theory (see below about PNP transistors) with your original schematic. In the absence of IR, D2 should be off. That makes the non-inverting input (+) higher (in theory) than the inverting (-) input, so output should be high, which should turn off both V1 and V2.

1) Go back to the original and remove D2 temporarily. Are the signals off? If not, what is the voltage on pins 3, 2, and 1. Pin 3 needs to be higher than Pin 2. When that's the case, Pin 1 should be the same or very close to J1. If not adjust R3 until it is. If you can't, go to step 2. Are the signals still on?
I'll have to remake one tomorrow because I butchered the original trying to swap components.

To measure the voltage "on" a pin, I measure it between the pin and ground? Ground of the circuit or the ground pin of the chip?
 

Audioguru again

Joined Oct 21, 2019
6,674
Like most ebay Chinglish, the ad says the project is for welding training then maybe should not be soldered together.
It also says that the transmitter LED and detector diode should have tubes on them (pointing upwards?) then the original circuit will detect when your hand reflects the IR beam into the IR receiver diode.
 

jpanhalt

Joined Jan 18, 2008
11,087
Yes, measure between the pin and ground. Set you meter to whatever the supply voltage is or greater.

As AG again says, if D1 is on, you may not be able to get a real "off" signal. That is why I suggest removing D2. IR will go through plain white paper. You need cardboard, aluminum foil, or black vinyl tape to block it.
 

MisterBill2

Joined Jan 23, 2018
18,179
Hi,

I'm very new to electronics stuff, trying to learn it with my young son. We've been soldering together some basic kits from ebay which has gone well so far.

We've just put together an IR proximity detector, though, and it appears to work backwards to the description. It says it should light up and sound the buzzer when waving a hand near it, but it seems to light up and sound all the time but STOP when I put my hand near it.

The schematic:

Partslist:

Circuit board:

Any suggestions for how I try debugging this?

Ebay posting in case it can help; not trying to advertise it:
https://www.ebay.co.uk/itm/10pcs-DI...m-Electronic-Circuit-Suite-DC-5V/352963796317

(Hope this is the right subforum for it. Wasn't sure if here or 'homework' was better.)
The circuit does not show a IR proximity sensor, it shows a reflective "beam break" sensor. So when you put a hand in front you are reflecting the beam and providing a return signal. So the device is working well, but it was misrepresented. It would be called a "retro-reflective beam break sensor.

An IR motion detector does not include an illumination source, and it does include a lot more amplification.
 

Thread Starter

notquitethere

Joined Mar 23, 2020
14
When I have tried "everything" and nothing works, I take a nap and go back to the start.

First, I don't see anything wrong in theory (see below about PNP transistors) with your original schematic. In the absence of IR, D2 should be off. That makes the non-inverting input (+) higher (in theory) than the inverting (-) input, so output should be high, which should turn off both V1 and V2.

1) Go back to the original and remove D2 temporarily. Are the signals off? If not, what is the voltage on pins 3, 2, and 1. Pin 3 needs to be higher than Pin 2. When that's the case, Pin 1 should be the same or very close to J1. If not adjust R3 until it is. If you can't, go to step 2. Are the signals still on? If so, doubletriple check the transistors. Check the numbers on them and lookup the data sheets. They must be PNP and the emitters need to be connected high (as shown). PNP transistors often are viewed to "source" current and NPN "sink" current (others have said the same). In the design you have, the PNP transistors are sinking current.
I made a little black hood for the receiver using insulating tape, and when I cover it up the signals (peeper + light) are off. When I take it off, the signals are on again.

With the hood on I measure the pins as:

P1: 3.87
P2: 3.09
P3: 4.88

When I twiddle R3 it seems to have no effect on the voltage at P1, only on the voltage at P2.

The transistors are S9012
 

jpanhalt

Joined Jan 18, 2008
11,087
I made a little black hood for the receiver using insulating tape, and when I cover it up the signals (peeper + light) are off. When I take it off, the signals are on again.
That is how it is supposed to work. No IR on receiver, signals off. Your main problem seems to be scattered light getting to the receiver from either the emitter and/or from other sources in the room. Try a light tube over the receiver. A plastic straw covered with black tape will work (assuming you can get the straws legally). Leave the end open. Then as you put your hand over it, the reflections should set off the signal.

When I twiddle R3 it seems to have no effect on the voltage at P1, only on the voltage at P2.
Correct. As a comparator, the voltage at pin1 (output) should be either high or low. The higher the voltage at pin 2, the more sensitive the detector will be. Adjust it so the voltage at pin 2 is lower and see the effects. The real test is with the light tube as described. The first time I made an IR proximity sensor, I was amazed at how sensitive it was, because of course, you don't see anything.

A digital camera view finder (electronic version) can see the IR light. Try it.

The transistors are S9012
1585051404607.png
You probably have it connected correctly. This is just to double check.
 

LesJones

Joined Jan 8, 2017
4,174
This design is based on reflective sensing. When the photo diode does not see any light the LED and bleeper are off. It is being turned on by ambient light. You need to do what has been suggested putting a piece of metal tubing round both the emitter and detector so that there is no direct path for the IR between them. The one round the detector will also reduce it's field of view so it will be less sensitive to ambient light. When you have done this verify that the shielding is working by switching of the lights in the room and verifying that the bleeper is not sounding. (Make sure that there is nothing close to the device which will reflect the IR.)
Still with the room dark place something close to the device so that some of the IR beam is reflected back to the detector. The bleeper should bleep and the LED come on. You will probably have to adjust the potentiometer to get it to work. Better proximity detectors modulate the IR and have a filter after the detector so they are much less sensitive to ambient light.

Les.
 

MisterBill2

Joined Jan 23, 2018
18,179
Less has it half right. The system is intended to operate as a "Beam Break" sensor. That is the operation described in post #1, with the reflection coming from the hand.
Once again, it IS NOT one of the passive IR motion sensors. Try it with ha sheet of white paper a few inches away and observe that it works as a beam break sensor. Then try it with one of those retro-reflectors like are used on bikes. or better yet, a piece of that reflective tape. The range will be even farther.
The real fault is that it was mis-represented as a proximity sensor instead of a retro-reflective beam breaking sensor.
 

jpanhalt

Joined Jan 18, 2008
11,087
Less has it half right. The system is intended to operate as a "Beam Break" sensor. That is the operation described in post #1, with the reflection coming from the hand.
Once again, it IS NOT one of the passive IR motion sensors. Try it with ha sheet of white paper a few inches away and observe that it works as a beam break sensor. Then try it with one of those retro-reflectors like are used on bikes. or better yet, a piece of that reflective tape. The range will be even farther.
The real fault is that it was mis-represented as a proximity sensor instead of a retro-reflective beam breaking sensor.
I disagree. When configured as discussed in post #36 and elsewhere, it will act as a proximity sensor. That is, unless something reflects the beam into the sensor, its output is low. Putting the IR emitter in close proximity to the detector was a design error, but that is easily fixed. In my application years ago, I put the emitter in front of the detector. In this snippet, the location of the detector behind the filter plastic is circled.
1585057616059.png

A signal is produced when the device is in the position shown. When the device (bale+cam+ pulley) is in the open position (folded back) there is no reflection and signal is low.
 

Audioguru again

Joined Oct 21, 2019
6,674
The sales sheet for the kit says that the transmitter LED and detector diode should have tubes on them (pointing upwards?).
Didn't the instructions say that?

The opamp works like this: If the voltage on pin 3 is higher than the voltage on pin2 (but never higher than about 1.5V less than the supply voltage) then the output pin1 goes as high as it can and turns off the alarms. When the voltage on pin3 is less than the voltage on pin 2 then the output pin 1 goes as low as it can which turns on the alarms.
 
Top