Author Topic: Long wires to transistor base a problem?  (Read 6324 times)

0 Members and 1 Guest are viewing this topic.

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Long wires to transistor base a problem?
« on: April 22, 2021, 02:49:39 pm »
I have breadboard a simple IR obstacle detector circuit using photodiode to NPN transistor base. Collector has 22k to pos rail and drives Schmitt CMOS inverter low which in turn drives second inverter with RC net as pulse stretcher. The 24AWG unshielded wire length between photodiode and transistor is 3 meters. Operating voltage is 5v. It seems to work very well. I need 60 such detectors. Before replicating 60 times is there any reason I should be concerned about the diode to base wire length?

Thank you in advance.
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #1 on: April 22, 2021, 04:22:52 pm »
I have breadboard a simple IR obstacle detector circuit using photodiode to NPN transistor base. Collector has 22k to pos rail and drives Schmitt CMOS inverter low which in turn drives second inverter with RC net as pulse stretcher. The 24AWG unshielded wire length between photodiode and transistor is 3 meters. Operating voltage is 5v. It seems to work very well. I need 60 such detectors. Before replicating 60 times is there any reason I should be concerned about the diode to base wire length?

Thank you in advance.

Yes, you need to be concerned with RF interference and transient spikes.  These can cause false detection and damage to your transistor.

Use bypass capacitors at the photodiode and transistor base (sized to not reduce the response time below your application's requirements).  Add a series resistor between the transistor base and the external wire, and some sort of diode clamping to protect the transistor base junctions.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #2 on: April 22, 2021, 05:39:35 pm »

Is it possible to design it so the transistor sits out by the photodiode, so you aren't running low level signals over a long distance?
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #3 on: April 22, 2021, 09:01:21 pm »
I have breadboard a simple IR obstacle detector circuit using photodiode to NPN transistor base. Collector has 22k to pos rail and drives Schmitt CMOS inverter low which in turn drives second inverter with RC net as pulse stretcher. The 24AWG unshielded wire length between photodiode and transistor is 3 meters. Operating voltage is 5v. It seems to work very well. I need 60 such detectors. Before replicating 60 times is there any reason I should be concerned about the diode to base wire length?

Thank you in advance.

Yes, you need to be concerned with RF interference and transient spikes.  These can cause false detection and damage to your transistor.

Use bypass capacitors at the photodiode and transistor base (sized to not reduce the response time below your application's requirements).  Add a series resistor between the transistor base and the external wire, and some sort of diode clamping to protect the transistor base junctions.

  • I added 100nF at photodiode and at Q base. No detrimental effect on response time.
  • 2.2K was max I could add at Q base before response to low reflectivity object dropped too much. Is 2.2K sufficient?
  • The only zeners I have on hand are 15v. Is it correct to assume I need 5v or 6v zener for the clamp?
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #4 on: April 22, 2021, 09:05:15 pm »

Is it possible to design it so the transistor sits out by the photodiode, so you aren't running low level signals over a long distance?

Yes, however I would then have a long wire input to a CMOS input. Isn't that worse? Projects I have made in the past that had long wires on CMOS inputs always seemed problematic. Although with my limited electronics understanding there are any number of reasons my projects are problematic.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #5 on: April 22, 2021, 10:52:11 pm »

How small stuff are you comfortable working with?  You can probably get the whole circuit into the sensor end, on a tiny board, and let it pass back the output as a current pulse of a few mA instead of as a voltage pulse.  The difference between the two approaches is essentially that the receiver has a suitably low input resistance, while the transmitter is "beefy" enough to drive that resistance to e.g. 5V at 2mA when the pulse is "ON".  That kind of approach would make the setup pretty much immune to almost any interference.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3392
  • Country: ua
Re: Long wires to transistor base a problem?
« Reply #6 on: April 22, 2021, 10:58:53 pm »
Yes, however I would then have a long wire input to a CMOS input. Isn't that worse? Projects I have made in the past that had long wires on CMOS inputs always seemed problematic.

Weak analog signal (like photodiode) through long wire is much more worse than CMOS.

For comparison. If we imagine long wire for CMOS as a tea in the cup which stays in a moving train, then photodiode through a long wire will be like attempt to keep your tea in the cup at the tip of a working jackhammer.  :)
« Last Edit: April 22, 2021, 11:06:40 pm by radiolistener »
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #7 on: April 22, 2021, 11:59:59 pm »

Weak analog signal (like photodiode) through long wire is much more worse than CMOS.

For comparison. If we imagine long wire for CMOS as a tea in the cup which stays in a moving train, then photodiode through a long wire will be like attempt to keep your tea in the cup at the tip of a working jackhammer.  :)

Excellent analogy. I understand.


How small stuff are you comfortable working with?  You can probably get the whole circuit into the sensor end, on a tiny board, and let it pass back the output as a current pulse of a few mA instead of as a voltage pulse.  The difference between the two approaches is essentially that the receiver has a suitably low input resistance, while the transmitter is "beefy" enough to drive that resistance to e.g. 5V at 2mA when the pulse is "ON".  That kind of approach would make the setup pretty much immune to almost any interference.


The off board diode was an attempt to keep all the electronics in one central place. Sounds like not such a good idea now. I have area for larger sensor circuit. I think I should go that direction.

I am also attempting to work from my parts bins. I have a bunch of CD4584 and hundreds of IR pairs. If I put everything at the sensor end then I can tie the four extra gates on the signal out for the beef.
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #8 on: April 23, 2021, 12:25:47 am »
  • I added 100nF at photodiode and at Q base. No detrimental effect on response time.
  • 2.2K was max I could add at Q base before response to low reflectivity object dropped too much. Is 2.2K sufficient?
  • The only zeners I have on hand are 15v. Is it correct to assume I need 5v or 6v zener for the clamp?
Can you post a schematic?  This will make it easier for us to recommend any modifications and show you where to place any protection components.

As far as sending a small analog signal over a few meters of wire, and high vs low impedance circuits, your application probably doesn't require anything fancy.  If you can rearrange things so you have a logic-level signal to send, that's probably the better option.  Protecting digital CMOS inputs is actually pretty simple.  Otherwise, your analog signal can probably be filtered and protected easily enough.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #9 on: April 23, 2021, 12:38:42 pm »
[ Specified attachment is not available ]
« Last Edit: April 23, 2021, 12:59:48 pm by LKO Railroad »
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #10 on: April 23, 2021, 02:37:26 pm »
What is the part number (or specs) for the photodiodes?  We need to know how much current they will pass when illuminated.  And how are they illuminated?
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #11 on: April 23, 2021, 04:02:58 pm »
I don't have part numbers for the photodiodes or the IR emitters. Both are unlabeled and have been in my parts bin for decades.

They are illuminated by the reflection off an object from the emitters shown in the schematic. Previous measurement shows the voltage at Q collector is ~4V when dark (ambient) and ~100-300mV when illuminated although varies depending upon object color, shape, and surface area. The least reflective object (very thin cross section, satin black color) shows 1.9V at Q collector.

I'll attempt to measure the photodiode current.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #12 on: April 23, 2021, 04:32:04 pm »
The photodiode current is below my meter's range. With the most reflective object I measure 0.003mA. Typical reflective object measures 0.001mA. The sensor works correctly on low reflectivity objects even though 0.000mA shown on meter.

Is that close enough to help you?
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #13 on: April 23, 2021, 05:09:01 pm »
The photodiode current is below my meter's range. With the most reflective object I measure 0.003mA. Typical reflective object measures 0.001mA. The sensor works correctly on low reflectivity objects even though 0.000mA shown on meter.

Now I REALLY understand tea in a cup.
 
The following users thanked this post: SilverSolder

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #14 on: April 23, 2021, 05:16:03 pm »

I'd try the 3m cable on the output side of that circuit, feeding as low an impedance as you can to keep the noise down.

 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #15 on: April 23, 2021, 06:53:32 pm »
Some observations- you don't want a long run of wire between the phototransistor and the amplifier transistor. Field wiring acts as an antenna and will pick up AM radio, cell phone, cordless phone, DCC or brushes arcing on track over top, a non-grounded 5V PSU etc. The current is so low.

Your detect delay circuit acts only on one edge, 3 seconds once blocked but almost nothing once cleared. So any noise picked up that turns on the amplifier transistor will not be filtered out. I would move the 1MEG to where the diode is. Remove the diode and 1MEG to GND. This gives a delay (noise filtering) both ways. If the phototransistor can pick up room lighting there will be flicker there.

Better to have the transistor nearby the phototransistor, and add a resistor to lower sensitivity a bit as leakage currents from three photodiodes might make the circuit moody.
I'd use a 47k E-B with 10nF in case the photodiode wiring picks up RF noise (brushes arcing).

But that moves a problem to the Schmitt trigger, that gate now has a long wire coming into it and will certainly get ESD hits during installation. CMOS gates don't last with long wires connecting directly to their inputs. Some parts at the gates' input would be needed, but I'm not sure if you are moving the IC near the amplifier transistor.
You are making a small PCB? I would for so many being built.
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #16 on: April 23, 2021, 08:06:38 pm »
First, as has been suggested, you might want to use a phototransistor instead of the photodiode.  The phototransistor will conduct more current for a given light intensity, reducing system noise sensitivity.

Since you are directly driving the base of your 2N3904 transistor with the photodiode anode, the cathode connected to +5V, we need to look at the current gain of the transistor.  When the transistor is saturated, the collector pulls about 0.22 mA through that 22K resistor.  The current gain of that transistor is about 70 (minimum), so the required base current is about 3 uA.  This is less than your typical reflective object current, so the transistor's gain is apparently around 200 -- slightly better than the typical value (which is pretty variable).  To allow for transistor gain variation, we would like to see a safety factor of ten, and this is obviously not the case here.  You need a higher-gain circuit, either a phototransistor detector, or perhaps a two-transistor circuit.  A Darlington pair could work, or better yet a "Sziklai Pair" which would give you more voltage across your photodiode (a good thing).  Either of these configurations will have a higher "on" voltage (saturation voltage) but with your 5V CMOS stage this shouldn't be a problem.

You will also want to have a high-value resistor from base to ground to keep any base leakage current or detector dark current from turning the transistor on.  Obviously this also reduces the circuit's sensitivity.  In the absense of any specs I would try 1 Megohm, but I see that floobydust suggests 47k and he may be right.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #17 on: April 23, 2021, 08:14:39 pm »
Your detect delay circuit acts only on one edge, 3 seconds once blocked but almost nothing once cleared. So any noise picked up that turns on the amplifier transistor will not be filtered out. I would move the 1MEG to where the diode is. Remove the diode and 1MEG to GND. This gives a delay (noise filtering) both ways. If the phototransistor can pick up room lighting there will be flicker there.

The breadboard circuit goes low as soon as reflection occurs. It holds low for 3 seconds when cleared. This is the desired operation. The confusion may lie in that the system receives IR to detect, no IR means cleared. Although I do understand about noise being picked up by the transistor and how replacing the diode with a resistor would minimize that but wouldn't it also introduce delay on the trigger as well as the clear? I don't need, or necessarily want, delay on the trigger edge.

Fortunately the sensors cannot pickup room lighting due to their location.

Better to have the transistor nearby the phototransistor, and add a resistor to lower sensitivity a bit as leakage currents from three photodiodes might make the circuit moody.
I'd use a 47k E-B with 10nF in case the photodiode wiring picks up RF noise (brushes arcing).

But that moves a problem to the Schmitt trigger, that gate now has a long wire coming into it and will certainly get ESD hits during installation. CMOS gates don't last with long wires connecting directly to their inputs. Some parts at the gates' input would be needed, but I'm not sure if you are moving the IC near the amplifier transistor.
You are making a small PCB? I would for so many being built.

The discussion here has convinced me I should put the entire circuit at the sensing location with the 3m wire run being the output. Yes, I will make PCB.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #18 on: April 23, 2021, 08:28:03 pm »
First, as has been suggested, you might want to use a phototransistor instead of the photodiode.  The phototransistor will conduct more current for a given light intensity, reducing system noise sensitivity.

Since you are directly driving the base of your 2N3904 transistor with the photodiode anode, the cathode connected to +5V, we need to look at the current gain of the transistor.  When the transistor is saturated, the collector pulls about 0.22 mA through that 22K resistor.  The current gain of that transistor is about 70 (minimum), so the required base current is about 3 uA.  This is less than your typical reflective object current, so the transistor's gain is apparently around 200 -- slightly better than the typical value (which is pretty variable).  To allow for transistor gain variation, we would like to see a safety factor of ten, and this is obviously not the case here.  You need a higher-gain circuit, either a phototransistor detector, or perhaps a two-transistor circuit.  A Darlington pair could work, or better yet a "Sziklai Pair" which would give you more voltage across your photodiode (a good thing).  Either of these configurations will have a higher "on" voltage (saturation voltage) but with your 5V CMOS stage this shouldn't be a problem.

You will also want to have a high-value resistor from base to ground to keep any base leakage current or detector dark current from turning the transistor on.  Obviously this also reduces the circuit's sensitivity.  In the absense of any specs I would try 1 Megohm, but I see that floobydust suggests 47k and he may be right.

Understood. I will breadboard a two transistor solution. Only have a couple phototransistors and I am trying to get this entire project built from parts on hand. I have plenty 2n3904. Will also experiment with different base resistors and cap as you and floobydust mention.

I'll let you know my results.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #19 on: April 25, 2021, 12:44:43 am »
Placement has reduced the lead length between diode and Q to 20cm.

Before I breadboard I wanted to check with you that I have the suggestions incorporated correctly.

 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #20 on: April 25, 2021, 01:37:34 am »

Will the 20cm run inside a shielded cable or something like that?
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #21 on: April 25, 2021, 01:44:27 am »

Will the 20cm run inside a shielded cable or something like that?

Yes, it could. I have a roll of 18/2C riser security cable around here somewhere.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #22 on: April 25, 2021, 01:48:57 am »

I don't see any reason not to breadboard your idea,  but that is purely a hobbyist perspective...  it seems pretty good use of standard components.  You are unlikely to be hit by chip shortages, LOL!  :D
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #23 on: April 25, 2021, 10:08:59 pm »
The circuit looks much better. I would move the 47k to the other side of the 1k for a bit less loss, and the 47k might be the wrong value. I'm not sure when it was changed to a Darlington?
This might give you less sensitivity actually, because a Darlington needs around 1.4V input to begin conducting.
So the photo-current needs to be 1.4V/47k = 30uA and you measured at most 3uA so sensitivity will drop a lot.
I would experiment comparing just one transistor (vs two) and going to 1MEG.

The CMOS gate input I usually put a pullup or pulldown there (if a long wire run) so an open wire/connection does not cause problems.

Your three IR LED's might be running at low intensity because they are all in series and some IR leds are 1.5V each. I would measure the voltage drop across the 220R resistor to see what current they are getting. I would go with 5mA minimum (~100R) but I have no idea of their part # or configuration. Current drain can get big with 60 units.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #24 on: April 26, 2021, 12:47:53 am »
The circuit looks much better. I would move the 47k to the other side of the 1k for a bit less loss, and the 47k might be the wrong value. I'm not sure when it was changed to a Darlington?
This might give you less sensitivity actually, because a Darlington needs around 1.4V input to begin conducting.
So the photo-current needs to be 1.4V/47k = 30uA and you measured at most 3uA so sensitivity will drop a lot.
I would experiment comparing just one transistor (vs two) and going to 1MEG.

I'll move and vary the resistor. The darlington was added per the suggestion of fourfathom.

The CMOS gate input I usually put a pullup or pulldown there (if a long wire run) so an open wire/connection does not cause problems.

Does the 22K not already act as a pull up? The transistor and CMOS are on the same side of the wire run presently. If the transistor is moved to the E/D board then I understand.

Your three IR LED's might be running at low intensity because they are all in series and some IR leds are 1.5V each. I would measure the voltage drop across the 220R resistor to see what current they are getting. I would go with 5mA minimum (~100R) but I have no idea of their part # or configuration.

Referring back to the original circuit, there is a matte black sheet of poster board 80mm across from the emitter detector pairs. It seems to adsorb IR reasonably well. The sensing range is 10 to 30mm. By trial and err I adjusted the LED current and the Q collector resistor such that there was >4v at the CMOS with no object and <2v with the least reflective object at 30mm. Most objects are well below 1v. Manually adjusted bias I guess you would call it. The measured LED current is 6mA. They must be 1.2v forward?

Current drain can get big with 60 units.

Agreed. Dedicated 7805.

Haven't yet been back to the bench to board any of these ideas. Grand kids this weekend. Way more fun than chips and wires.
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #25 on: April 26, 2021, 12:59:42 am »
I'll move and vary the resistor. The darlington was added per the suggestion of fourfathom.

Well, I *did* recommend the Szilaki pair over the Darlington to get the advantage of a single base-emitter junction.  But, not having the photodiode specs, I suspect that the extra gain of the Darlington will still provide a big boost.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #26 on: April 26, 2021, 01:15:48 am »
I'll move and vary the resistor. The darlington was added per the suggestion of fourfathom.

Well, I *did* recommend the Szilaki pair over the Darlington to get the advantage of a single base-emitter junction.  But, not having the photodiode specs, I suspect that the extra gain of the Darlington will still provide a big boost.

I have never built anything with a Szilaki pair. Had to Google it. I have made things with Darlington pair so was more comfortable with that option.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #27 on: April 26, 2021, 01:19:53 am »
I'll move and vary the resistor. The darlington was added per the suggestion of fourfathom.

Well, I *did* recommend the Szilaki pair over the Darlington to get the advantage of a single base-emitter junction.  But, not having the photodiode specs, I suspect that the extra gain of the Darlington will still provide a big boost.

I have never built anything with a Szilaki pair. Had to Google it. I have made things with Darlington pair so was more comfortable with that option.

They really work the same as a Darlington, just with opposite polarity transistors.

The cool thing about a breadboard is that you can try all the crazy ideas and see which works the best!

The bad thing about a breadboard is that you can try all the crazy ideas and see which works the best...   (you end up playing a lot! - but it's kinda fun)

 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #28 on: April 26, 2021, 12:50:24 pm »
Can you share the circuit of yours, I am in sort of designing the similar circuit  ;D

It is on page 1 of this thread.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #29 on: May 04, 2021, 12:11:09 am »
Thanks for being patient.

Tried both the Darlington pair and, after rearranging the circuit a little bit, the Szilaki pair. Essentially same result with both. The circuit becomes far too sensitive to even trivial amounts of ambient light. The installation area is generally dark but not pitch black. The ambient light level varies somewhat.

Tried series R up to 10M between diode and base. No joy. I then tried a divider network on the base. This worked but by the time I biased it down enough to solve the room light problem with sufficient margin, my object / no object voltage swing was quite narrow, less than 1v. No good.

All this lead me to ask why boost the signal if I just turn around and clamp it down? Must be the tea cup thing. That made me wonder just how much of a jackhammer my tea cut is resting on. I rebuilt the original single transistor circuit and incorporated your suggestions except the clamping diodes. I ordered some 1N5817. I used 30cm of shielded cable between diode and Q base. I tried every device I could find - cell phone, cordless phone, CFL, electric drill, cordless drill, AC grinder, even an old B&D router that throws so many sparks from its brushes it should be in a 4th of July parade. Nothing. No false triggers. The circuit carried on working seemingly unfazed by any of the devices operating within inches of the cable.

Is it possible the shielded cable is sufficient? It sure seems to be. Should I throw a couple clamping diodes on it when they arrive and call it done?


 
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #30 on: May 04, 2021, 12:21:41 am »
Go with what works on your breadboard- but leave provisions on the PCB for drama.
A 10-47nF cap at the receiving end of the long cable run, maybe an LED indicator for troubleshooting, extra ground pad for cable shield if you use it. I don't know where the diode is you are mentioning or what it's for.
You can improve immunity to ambient light with additional IR filters (I'm assuming the photo-diodes are not clear lens) or using a tube, and make sure the reflective angle is optimal. I doubt all the cars are the same size on a layout.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #31 on: May 04, 2021, 01:16:06 am »
Here is the circuit I described in the previous post.

The clamping diodes are a result of @fourfathom comment and the subsequent search that led me here: https://www.digikey.com/en/articles/protecting-inputs-in-digital-electronics. They would go between the 1M and 1K resistors on Q base.

The emitter LEDs and detector diodes are already in tubes (uncollapsed heat shrink). Have been from the get go. Needed so they could sit side-by-side.

The three E/D pairs are in a stack perpendicular to the cars. Lowest one for depressed center flatcars, middle one for standard flatcars and couplers, top one for tank cars. These turned out to be the picky cars. Boxcars, hoppers, etc. hit more than one E/D.

 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #32 on: May 04, 2021, 03:27:55 am »

If the circuit works in the environment it will operate in - you are on to a winner!
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #33 on: May 04, 2021, 05:56:19 am »
I would not use a Schottky diodes there because they have high leakage current relative to the small photo-current, so I imagine the circuit losing sensitivity.
A 1N4148 across E-B will protect the transistor from -ve spikes, and the E-B junction will take the +ve spikes. I would ensure the photo-diodes would not see any transients or overload, if ESD hits happen on that node as you are connecting the cable. That is the usual damage, happening during installation.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #34 on: May 04, 2021, 11:35:30 am »
I would not use a Schottky diodes there because they have high leakage current relative to the small photo-current, so I imagine the circuit losing sensitivity.
A 1N4148 across E-B will protect the transistor from -ve spikes, and the E-B junction will take the +ve spikes. I would ensure the photo-diodes would not see any transients or overload, if ESD hits happen on that node as you are connecting the cable. That is the usual damage, happening during installation.

Got it. Will take the necessary precautions during installation.

« Last Edit: May 04, 2021, 11:55:54 am by LKO Railroad »
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: br
    • CADT Homepage
Re: Long wires to transistor base a problem?
« Reply #35 on: May 04, 2021, 02:48:09 pm »
Nobody suggested a shielded cable for signal transfer from photo diode to amplifier/controller?

Regards, Dieter
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #36 on: May 04, 2021, 03:16:17 pm »
Nobody suggested a shielded cable for signal transfer from photo diode to amplifier/controller?

Regards, Dieter

Yes. SilverSolder did. The reason I tried it. Appears to have been a magic bullet.


Will the 20cm run inside a shielded cable or something like that?
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: br
    • CADT Homepage
Re: Long wires to transistor base a problem?
« Reply #37 on: May 04, 2021, 04:41:52 pm »
No, you still did not understand. I mean the signal should be inside a shielded cable all the way (3 m). You could try an audio cable.

Regards, Dieter
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #38 on: May 04, 2021, 05:14:32 pm »
No, you still did not understand. I mean the signal should be inside a shielded cable all the way (3 m). You could try an audio cable.

Regards, Dieter

I'm confused. The signal is inside shielded cable all the way from photo diodes to the breadboard. Alternate placement allowed original wire run of 3m to be reduced to 20cm. My test setup uses a 30cm cable for margin.

Perhaps I drew the schematic incorrectly. This better illustrates the shielded cable connections.

 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: br
    • CADT Homepage
Re: Long wires to transistor base a problem?
« Reply #39 on: May 04, 2021, 06:17:04 pm »
My fault, did not get all details of this thread. Anyway, once you use a shielded cable, a length of some meters doesn't matter. Your signal receiver is low impedance.
For pulse oximeters people use some meters of double shielded cable that have the LED signals between inner and outer shield. Inside the inner shield there are two wires for the photo diode to keep noise as small as possible.Those photometers use modulation at a bandwidth of about 100 KHz.

Regards, Dieter
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1109
  • Country: lt
Re: Long wires to transistor base a problem?
« Reply #40 on: May 04, 2021, 06:57:03 pm »
I read through this thread and I do not understand, why complicate so much. This system has serious drawbacks, high sensitivity to ambient light, sensitivity to EMI. Presense / obstacle detector should have a carrier. Common ones are 38 and 56 kHz. Then you can take a ready made CW IR receiver which outputs nice low impedance digital signal. Solves most problems about ambient, noise and general reliability. For example, if I remember correctly, TSSP4038 works with CW.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #41 on: May 04, 2021, 07:21:40 pm »
If you can get away with shielding ambient light using filters or tubes, shutters etc. then it's good enough.

OP could use consumer IR remote receiver modules with say 38kHz LED drivers. That gives high immunity to ambient light. But it costs a lot with 60 nodes unless you go offshore. The IR modules are wide-angle and optimized for serial data - not for object detection. You have to buy special IR rx modules with the correct AGC timing for object detection, for light curtains or garage door use . Or get around it making a more complex IR emitter pulse train but with detection delays.

Vishay TSSP4056 Sensor for Fast Proximity Sensing Arduino example
Vishay App Notes on IR receivers
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #42 on: May 04, 2021, 08:29:25 pm »
The ambient light problem is specific to the two transistor circuit. The single transistor circuit does not have an ambient light problem. At least not in the intended location.

Undoubtedly there are any number of clean slate ways of going about this most of which I am sure would be much better than my solution. Earlier in the thread I mentioned completing this project with parts I have on hand if at all possible. The IR pairs I have many. Same for the CD4584. That is how they became the basis of the design. I'm an old man that already has way too many bins of electronic junk that my kids will just throw away when I'm gone. If I can build a working system while bleeding down the parts cabinets then that is a double win. My total investment so far is $0 and 0 parts added to the bins. (I cancelled the Schottky diodes order. Thanks @floobydust)

At this point the circuit appears to be working great even if of an inferior design. This is not a production item, merely a one-off detection system for a model train. The consequence of failure is limited to nothing more than a sigh and "Aww, that's a shame."

 
 
The following users thanked this post: Manul

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1109
  • Country: lt
Re: Long wires to transistor base a problem?
« Reply #43 on: May 04, 2021, 09:01:20 pm »
I'm an old man that already has way too many bins of electronic junk that my kids will just throw away when I'm gone.

I'm sorry for off topic, but this sentence was sadly touching. All the best to you. And keep the thread updated :-+
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #44 on: May 04, 2021, 11:50:48 pm »
[...]  I'm an old man that already has way too many bins of electronic junk[...]

Is there such a thing???  :D

I'm with you on "use what you have", it is very modern to be conscious of avoiding the build-up of junk.  For many (most) hobbyists, a scope and a Digilent Analog Discovery would be worth as much as an entire rack full of period test equipment...  just too easy to pile it on...  ask me how I know!

 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #45 on: May 10, 2021, 01:49:51 pm »
At what point did it go from solving a problem to simply having fun?

The original spacing between sensors was 17". I tried doubling up IR diodes on each sensor. Dark signal stays well below the threshold. Actually, very little difference at Q collector. This means I can reduce the sensor to sensor distance to a little over 8" which solves yet another issue - lone car sitting between sensors.

I used the remaining gates to alternate the IR LEDs so doubling of sensors didn't double the load on my 7805.

Also made the display panel LEDs all on at low brightness. Object detect makes them bright. That will make the panel more aesthetically pleasing when no objects are detected.

Building a prototype now. Will let you know how it goes.

« Last Edit: May 10, 2021, 01:56:03 pm by LKO Railroad »
 
The following users thanked this post: SilverSolder

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #46 on: June 04, 2021, 08:53:24 pm »
Started building out. LED pair mounting first order of business.



120 of them plus a few extras.



Mounting points for them are installed.


 
The following users thanked this post: SilverSolder, floobydust

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #47 on: June 05, 2021, 01:48:05 am »

Interesting - What's the purpose of the 5 stacked tracks?  - and where do the sensors you're making fit in the picture?
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #48 on: June 05, 2021, 03:57:14 am »
LED's emit some light out their side, so I'm hoping you have something between the emitter and detector rows to prevent this. Like a small opaque piece of thin plastic. Or maybe do a quick test to see if LED on/off with no reflection makes too large a difference.
Are the track runs in a tunnel or something, where's the re-railers lol.
 

Offline gcewing

  • Regular Contributor
  • *
  • Posts: 197
  • Country: nz
Re: Long wires to transistor base a problem?
« Reply #49 on: June 05, 2021, 07:05:11 am »
Are you making a railway version of the Large Hadron Collider?
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #50 on: June 05, 2021, 11:44:14 am »

Interesting - What's the purpose of the 5 stacked tracks?  - and where do the sensors you're making fit in the picture?

The 5 stacked tracks form a helix which serves as a train elevator to move trains from one level to another on a multiple level train layout.

The sensors mount on the wood blocks (red arrow) pointing outwards.

 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #51 on: June 05, 2021, 11:58:12 am »
LED's emit some light out their side, so I'm hoping you have something between the emitter and detector rows to prevent this. Like a small opaque piece of thin plastic. Or maybe do a quick test to see if LED on/off with no reflection makes too large a difference.
Are the track runs in a tunnel or something, where's the re-railers lol.

Completed units will have black heat shrink on the emitter. I haven't made it that far yet on the production pieces. Here are pics of the prototype unit with heat shrink installed and wire separators on the backside.





No re-railers needed. Track is properly laid.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #52 on: June 05, 2021, 12:10:15 pm »
Are you making a railway version of the Large Hadron Collider?

Sort of. A head-on collision in the helix would produce a lot of train particles!  :-DD
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Long wires to transistor base a problem?
« Reply #53 on: June 05, 2021, 07:47:32 pm »

Interesting - What's the purpose of the 5 stacked tracks?  - and where do the sensors you're making fit in the picture?

The 5 stacked tracks form a helix which serves as a train elevator to move trains from one level to another on a multiple level train layout.

The sensors mount on the wood blocks (red arrow) pointing outwards.

(Attachment Link)


Why so many sensors -  are they used to detect the length of the train or something?

 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #54 on: June 05, 2021, 08:14:43 pm »
Why so many sensors -  are they used to detect the length of the train or something?

There are so many sensors because they are spaced 1-1/2 car lengths apart. An average car is 200mm long. The helix track length is 22 meters. The pulse stretcher is long enough to allow a car to make it to the next sensor before the first sensor times out even at slow train speeds. This keeps the panel display a single contiguous line of lit LEDs showing the location, length, and movement of the train as it climbs or descends the helix without any of the panel LEDs blinking.
 
The following users thanked this post: SilverSolder

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: br
    • CADT Homepage
Re: Long wires to transistor base a problem?
« Reply #55 on: June 05, 2021, 11:00:26 pm »
It's something like a camera, isn't it? This reminds me of a project i was involved about 30 years ago, about reading the level of blood probes. There was a robot to handle the tubes and it could pass the tube through a ring with 5 LEDs and 5 photo diodes to find out the level of the liquid inside. Nowadays one would do it with a video camera and a smart AI system. How times have changed.

Regards, Dieter

Edit: Just found the first prototype. Actually it had 12 LEDs and 12 photo diodes, with modulation and demodulation. The black ring is an optical mask with 24 1mm holes and served to sharpen the image. At the time it was used with an 8 bit micro to digitize the data and perform some pattern recognition.
« Last Edit: June 06, 2021, 08:04:19 pm by dietert1 »
 

Offline harerod

  • Frequent Contributor
  • **
  • Posts: 449
  • Country: de
  • ee - digital & analog
    • My services:
Re: Long wires to transistor base a problem?
« Reply #56 on: June 06, 2021, 05:19:43 pm »
Dieter, there is hope! A while long ago a design left my lab, which is not too different from what you described, albeit bound for space. Of course one could call that a niche application.
With Chipageddon upon us, we will have to remember how to solve problems with basic general purpose components. Maybe this whole debacle presents a chance to transfer know-how to a younger generation of engineers.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7014
  • Country: ca
Re: Long wires to transistor base a problem?
« Reply #57 on: June 06, 2021, 08:33:59 pm »
I thought a re-railer is mandatory in tunnels, of course the track is flawless but any bump or jar can knock a truck off the track. If you can reach in the backside to fix, I guess it's OK.
What gauge is this? Curious what 22m works out in scale length.
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #58 on: June 07, 2021, 01:04:41 am »
I thought a re-railer is mandatory in tunnels, of course the track is flawless but any bump or jar can knock a truck off the track. If you can reach in the backside to fix, I guess it's OK.
What gauge is this? Curious what 22m works out in scale length.

Re-railers are common on toy train layouts, less so on scale model layouts. There is low probability of derailment on helix track. The overwhelming majority of derailments occur on switches, diamonds, slips, and other similar more complex trackwork of which the helix has none. There is however, a possibility of string-lining a train if the consist makeup is wrong (empties up front, loads in the back). That's operator error.

The entire inside of the helix will be accessible. Only certain portions of the outside are difficult to access. Round helix sitting in square corner.

This is HO scale - 1:87
22m = just shy of 2km
 

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #59 on: January 09, 2022, 09:14:30 pm »
Promised to keep you abreast of the progress. Completed six of these boards. Each board contains ten detector circuits. Each detector circuit has two inputs. Each input has three IR pairs.



 
The following users thanked this post: floobydust

Offline LKO RailroadTopic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: Long wires to transistor base a problem?
« Reply #60 on: January 23, 2023, 12:10:24 am »
Aborted the central board idea and went with individual sensors. Works great! Thanks for your help.

 
The following users thanked this post: ledtester, floobydust


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf