Notifications
Clear all

Proximity Sensor Problem

9 Posts
6 Users
0 Likes
1,939 Views
(@keith)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

As part of an Arduino project for a model railway, I wanted some proximity sensors but didn't want to use the generic FC-51. I wanted to build something myself as simply and cheaply as possible. Finally, I found the following schematic on YouTube and after building it on a breadboard found it worked perfectly.

Untitled

So, what's the problem?

Well, after being very pleased with my breadboard test I decided to move the project to Perfboard. Great! Still no problems, so I motored-on and built 12. Now here's my dilemma, 4 of the 12 worked perfectly while the other eight didn't work. I am an extreme novice when it comes to electronics, but I took one of the none working boards and started to troubleshoot it best I could. I checked the wiring, the voltage, the resistors. Luckily I have a tester I got from eBay that will test transistors, so I used that to test the NPN and the PNP, but they came back okay. I made sure the IR transmitters were working by viewing them with my phone. Although, the IR transmitters were not really necessary as the photodiode should have activated just with daylight (as they did on the 4 working boards). The photodiodes are working if I use my TV remote pointed directly at them, but they are not picking up the IR from daylight or the reflection from the IR transmitters in the circuit. Anyway, long story short, after 2 days of troubleshooting and head-scratching I have come to the following conclusions:

1. There is a problem with the transistors that has not been detected (I think this is very unlikely).

2. The photodiodes are way out of "tolerance". The one I am using purchased off eBay from China came from the same batch of 100.

3. None of the above.

So, does anyone know why I would have the problem I am having and what the solutions might be? Thank you.


   
Quote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 
Posted by: @keith

know why I would have the problem

Hi Keith, i don't know but did you try "rotating" IR LEDs and photodiodes so that you test all IRs against a photodiode for example ?

Eric


   
ReplyQuote
(@keith)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@zeferby

Thank you for your suggestion. I didn't try that because, as I said, the photodiodes should trigger just with enough ambient light.

I did, however, find a solution that works but I am not totally happy with it.

I swapped the 4.7k resistor with a trim pot. I was going to use a 10k but settled on a 100k (104) after test results were better with the 100k.

I don't like this approach because it adds cost and space to the circuit, plus the added time of having to mess around setting the pot for each unit. I don't know if it is the emitters or the receivers, or both, but something isn't identical even though they are all from the same batches.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

I’ve been quite surprised just how much seemingly identical electronic components can differ, especially temperature sensors.  My last beef was two identical gps receivers from adafruit, one would constantly find more satellites to link to.   


   
ReplyQuote
(@jbeazy)
Member
Joined: 5 years ago
Posts: 18
 

Did they give you a part number for the photodiode and are you sure it is not a transistor? Also some of these are designed with a coating that filters certain light wavelengths. If you are using an IR led you want a receiver with peak sensitivity in IR range.  But perhaps they supplied you with parts optimized for daylight. The part number datasheet should have a graph of sensitivity vs wavelength.  

I believe most of your problem is the receiver. Like you said there is wide variation in tolerances and even the manufacturers like Vishay admit it in there documentation. If a company is buying thousands of parts and doesn't want to add and adjust trim pots they can sometimes get sorted parts. Where the supplier will measure and put "low" parts in bin A, average parts in bin B, high parts in bin C.  So the company gets parts from one bin at a cost but you probably have parts from all.


   
ReplyQuote
(@keith)
Member
Joined: 4 years ago
Posts: 10
Topic starter  

@jbeazy

Good question. The eBay add said "diode". They are 5mm LEDs 940nm with a black coating. No datasheet. These are cheap and cheerful unbranded Chinese pieces. I'm sure they must have a part number when they are produced in the factory, but I don't know what it is.

I think the lesson here is to buy better quality components.


   
ReplyQuote
(@jbeazy)
Member
Joined: 5 years ago
Posts: 18
 

You can probably still get these to work the way you want. What you might want to try is on a breadboard take a led-receiver pair and put a trim pot where your 33k is and adjust until you get the response you want.  Then measure the resistance on the pot and make an equivalent resistance out of a few series/ parallel resistors and put that on your finished board.  A few resistors should be much cheaper than a trim pot.  It will be a little time consuming but not too bad for a dozen boards.


   
ReplyQuote
 BLM
(@the-code-cobbler)
Member
Joined: 4 years ago
Posts: 14
 

Hi,

I was looking through this thread and I thought maybe I could add something...

 1. I understand you tested your active components, transistor hfe (beta) values can differ quite a bit and still operate ok if the circuit is designed properly.. If the hfe difference in value is more than 20%-30% then you may have an issue. If more than this >50% then you definitely have an issue..

2. If transistor and diodes that initially test 'good' are installed in the circuit incorrectly, they most like are not good anymore (been there, done that...)

3. Check all passive components too. Make sure resister values match where they are placed in the circuit..

4. Last but not least, triple check wiring.. As I get older, my eyesight isn't as sharp (not like when I was in my 20's and 30's). Magnified reader glasses are my friend now 😉

5. Be patient...If four out of 12 were functional, with some troubleshooting all of them will work!!

 

Regards

--->The BLM<---


   
ReplyQuote
BunnyKiller
(@bunnykiller)
Member
Joined: 4 years ago
Posts: 31
 

looks like your ballast resistor for the IR transmitter is too high, try dropping it down to 100 ohms.

what kind of voltage supply are you using? and, what are the specs on the IR transmitter?  Ive seen the threshold voltage vary between 2.2 - 3.1 VDC on the "same batch" of IR leds... with a .9V variance between leds at such a low supply voltage, the ballast resistor being off by 50 ohms will be a yes/no on operation.


   
ReplyQuote