Help needed adapting a circuit to take new sensor - Page 1
Forum section: electronics / repair

author: The_blue
author_rank: Newbie
timestamp: February 28, 2019, 07:20:12 am
content: Hi all, this site was kindly recommend by the guys at overclockers. I'm part of a dog flyball team. To help us a built a set of arduino timing lights using instructions i found online. I'm no electronics expert but eventually i followed the recipe and got them working...Fast forward 2 years and a bunch of the infra red sensors had died so i decided to replace the whole lot but i've ordered the wrong ones! We can't afford to just waste them so i'm helping you guys can help..This is the timing lights, the infra red sensors are along the middle in 2 rows and turn on and off when the dog breaks the beams (reflectors on another stand)These are the old sensors, the old are PNP NO the new NPN and have NO and NC options. I hadn't seen the NPN issueThis is the input circuit, when the sensor is triggered it outputs 5v (i think)What i want to do is use the NPN NO sensors to do the same. Any ideas how i can do this?

author: LateLesley
author_rank: Frequent Contributor
timestamp: February 28, 2019, 02:13:53 pm
content: ok, first off, I think you got the NPN and PNP mixed up. I take it NPN is the old and PNP is the new?If so, this should be relatively easy to change about with a couple of resistors.You can see, the old one had the contact on the powerline, the new one is to ground.So what you can do, is if you tie a 1K resistor between 5V and the sensor input, this will pull it high, then if you connect the new sensor, using the NC connection (WH - I assume white) What that will do is pull the input low. Then if the sensor is triggered, it opens the contact, and the 1K resistor should pull the input high. This should mimic the operation of the old sensor. You may need to play with the resistor values a bit to get it to work, but the higher you can get away with, the better. it'll reduce power consumption, as the resistors are across the powerlines essentially when the sensor isn't triggered.

author: The_blue
author_rank: Newbie
timestamp: March 04, 2019, 12:54:27 pm
content: Firstly thanks for the reply. I think on initial reading I understand it. I'll knock it up on the breadboard first just to make sure.Yes, PNP is new. Good job I took a photo!Am I working with the NO or NC line on the sensor? They do both on the new.

author: LateLesley
author_rank: Frequent Contributor
timestamp: March 04, 2019, 05:34:17 pm
content: I think you want to use the NC line on the new sensor. The reasoning is this.The old sensor used NO (Normally open), and would close if it detected something, pulling the line high.To replicate that with the new sensor, we use a resistor to artificially pull the line high, then use the NC (Normally closed) line, to pull the line low. when the sensor detects something, it opens the contact, and the resistor pulls the line high, replicating the operation of the old sensor.I would first test what value resistor will pull the line high, because if you can get away with a high value, it'll lessen your power consumption.

author: The_blue
author_rank: Newbie
timestamp: March 10, 2019, 04:58:21 pm
content: Hi again, I've tried this and I'm getting no luck..I noticed I never mentioned the sensor is 12v does this matter?I've tried the old sensor on the 5v and they work fineand the circuit works fineFrom reading above, I'm replacing the old sensor with the 1k resistor? This doesn't work (for me)The sensor black lead gives out 5v when broken, why didn't connecting direct to 5v do the same job as the sensor?

author: LateLesley
author_rank: Frequent Contributor
timestamp: March 10, 2019, 09:24:26 pm
content: Hmm. I'm wondering if the circuit, looking at it, needs the sensor line pulling low.Can you try jumpering the sensor input to ground instead, and see if you get an output? If so, it may work with the NO line without the resistor. Though I'd think it would have worked even with the resistor there if that is the case.You say the new sensor is 12V, and the old one 5V - is that the supply voltage to them? does the new one have the 12V Gnd connected to the 5V Gnd? You'd need a common Gnd for it to work I think.

author: SilverSolder
author_rank: Super Contributor
timestamp: March 11, 2019, 05:04:10 pm
content: In the picture, the label says "6-36V DC" for both units. So, they are not specced for 5V and there is a chance that 5V is not enough!Have you tried hooking these things up to a power supply on your bench and just looking at the outputs when you put a mirror in front of the sensor? You could try 6V and 5V and see whether the sensor works or not.Even if they work fine, it is going to be more reliable to operate the sensors within their rated voltage.... they might not work on a cold day, or a hot day, or may not have the specced range, that kind of thing, when operated below rated voltage.