Skip to main content

Replies sorted oldest to newest

Not familiar with SCB so I'll take your question at face value and assume the issue is simply to size the FET. Presumably you have a meter.

Measure the DC voltage between DIN and "-" with SCB powered but nothing else going into DIN. The FET's Vds (drain-source voltage) spec must exceed this - triple it for good measure.

Use DC-current mode between DIN and "-" and measure the current. The FET must carry this level of current to simulate a closure. The Id (continuous drain current) spec must exceed this - triple it for good measure.

The FET needs some minimum gate-to-source voltage to turn on. This might require reading a parametric curve but usually a datasheet will list a typical Vgs threshold. Your 555 must supply at least this much voltage - shouldn't be a problem with 12V power. Then confirm the Vgs max spec is higher (say, 2x) what the 555 will put on its gate.

Should be no problem finding dozens of suitable parts - maybe 25 cents each?

As for the protection resistor, not clear what you're protecting. I'd think if DIN is normally "exposed" directly to track rails it would already be well-protected.

The relay advocates make their own case. What I'd find amusing is if you could toss the lot (photocell, 555, and FET) and just put a phototransistor between DIN and "-".
quote:
Originally posted by DaveJfr0:
I am unfamiliar with phototransistors. Does this mean I no longer need a 12VDC supply? I assume I would use an NPN BJT with the collector connected to DIN and the emitter connected to ground. What would I connect the base to? Can you explain the logic with this piece.
...
Btw, I found out that the DIN driver will never exceed 25mA, but can work with as little as 1mA.


Hmm, I'm reading the words but not sure what your last sentence means. Anyone?

Many phototransistors are just 2-pin devices (collector and emitter) connected as you say. The base current comes from light hitting the lens - sort of an LED in reverse (light generating current instead of current generating light). Some have a 3rd "base" pin to allow fiddling with bias currents but forget about that for now. Just don't get a 2-pin photodiode thinking you'll save money.

Anyway, selecting the Vce (collector-to-emitter) voltage rating is equivalent to the FET Vds rating, as is the collector current of the phototransistor vs. the FET drain current spec. If you're talking a few mA of phototransistor current, you'll find dozens of devices for 25 cents or whatever. Unless you have some experience with photo devices it's hard to say if you'll have enough light to provide enough base current without some experimentation. If you need more collector current for dim light, there are overpriced photodarlington transistors but it's cheaper to amplify the basic phototransistor which might require that external 12V supply...though (again not familiar with SCB) I'd think you'd be able to tap a few milliamps from the SCB.
quote:
Originally posted by DaveJfr0:
quote:
Btw, I found out that the DIN driver will never exceed 25mA, but can work with as little as 1mA.


Hmm, I'm reading the words but not sure what your last sentence means. Anyone?

I don't fully understand it myself, but thats what Terry of Custom Signals said. That line off the SCB will never exceed 25mA, so that is the max I'd have to pull down to ground.


What this means is the SCB Din input has a pullup resistor. If you directly shorted (a hard ground such as relay contacts closing for instance) this line to ground, you would be current limited to 25mA and the Din logic device pin would see this as a logic low. If you applied a resistor between the input and ground of a value such that only 1mA current could flow, the Din logic device pin would also read this as a logic low and respond accordingly. So basically having a FET, NPN transistor or relay pull Din down to ground would make the SCB board do whatever it was programmed to do.
If operation is one direction,why not use 2 reed switches spaced at the opposite ends of the block powering the coils of 2 relays? First relay, DPDT latches through one of its own set of contacts and through the NC contacts of a second relay. The second relay unlatches the first. The second set of contacts of the first relay works the block signal. This way timer function is not needed and relay operation is based solely on train position. Could also maybe be done with a short insulated rail at each end but this may mess up the DCC signal.

Dale H
quote:
Originally posted by DaveJfr0:
Are infrared detectors essentially a phototransistor?

Here are some I found on ebay I that I wanted to test out, but I am not sure if these are what you were referring to….

http://www.ebay.com/itm/5-x-Ph...a29ff0#ht_1635wt_907

and

http://www.ebay.com/itm/10-ea-...858f457#ht_500wt_922

Any ideas if these would do? I know that most regular lightbulbs also give off infrared in addition to visible light. I am not quite sure if bright-white or warm-white LED lights would also give off infrared though in case a layout was ever lit with those.


Hmm, where to start?

I'm not sure if there's an official definition of "infrared detector" but phototransistors can be used detect infrared. Your ebay devices are a bit skimpy on specs. The problem is it's hard to know what parameter(s) to look for in other devices if it doesn't work in your application, or if you want to reduce cost, etc.. But they're probably suitable to start experimentation with though I'd start with a few devices from a broader selection of 25-50 cent devices from Digikey, Mouser, etc.

The inexpensive bright white/warm-white LEDs talked about in OGR are narrow spectrum devices and give off little IR compared to, say, ambient room sunlight or an incandescent lamp. For the same LED power you'll get much more infrared energy from, say, a Red LED which is closer to Infrared than a white LED.

Well, your comment about layout lighting means it's time to peel another layer of the onion. So in your original 555 circuit, if your photocell resistance drops with light, you trigger the SCB when light is detected? Does this mean you have a focused light source (and detector) aimed at the side/bottom of a passing train? Or are you assuming a nominal level of ambient light and the passing train blocks the source to trigger? If you have a source, what is it. That is, typical photocells vs. phototransistors have materially different spectral responses where photocells detect more in the visible range and phototransistors including one of your ebay examples are often filtered (the dark lens) to block visible light. Since you had a photocell in your original plan I want to clarify the design concept (e.g., visible vs. infrared) before nit-picking about particular components.

At first I was wondering why you were using a 555 when there is no timing involved but confirm you were using its trigger hysteresis? I don't know how the SCB responds to multiple/intermittent triggers but clearly the detected light from a passing train will wander all over the place. That is, a phototransistor by itself has no hysteresis to speak of. Dale's latching relay method has bullet-proof hysteresis.

In the meantime, it should take just a few seconds to confirm rrman's clarification about DIN. So with the SCB powered up and nothing connected to DIN, measure the voltage between DIN and "-". Then use the DC-current mode between DIN and "-" which should be 25mA or so.
Yes just put a magnet on the underside of the locomotive where it will cross over the reed switch.. When it passes the first relay it latches,when it passes the second relay reed switch it unlatches the first. The lead locomotive determines position regardless of how long the train is. On a loop divided 8 blocks for example, 8, 3pdt relays would make a complete block system for the loop if that was desired. Each relay would detect block occupancy when the loco crosses it and cancel when it crosses into the next block. When power is shut off the train would have to be run around the loop once to reset everything. Reed switch spacing would have to be longer apart than the longest train run and signals placed appropriately.

If you wanted to really get fancy you could off center the reed relays between the rails and off center magnets on the engine and caboose to correspond. Then make the loco magnet turn on the latch relay and the magnet on the caboose or last car cancel it. This can also be used to activate an accessory such as a crossing gate or stop a specific train, a passenger train for example while a freight train with no magnet is ignored.. A lot of ways to do it depending on what you want to accomplish. 3pdt relays can be had for $8 each. Timer modules can be used with them for timed stops for example and a second set could turn on passenger station announcements or move the arrival board ..

Here are some multiple uses of a commonly available timer module used with 24 volt relays

http://www.jcstudiosinc.com/Bl...d=481&categoryId=426

Dale H
Here is what I use on my layout.



The link for more information about the track IR detector is at:
http://www.tuveson.com/Detector/Detector.htm

Here is the sensor and a LEMAX flasher board combined. Power and IR sensors are on the left connector. Out to the flasher LEDs are on the right connector. These use the IR circuit with the Lemax flasher board added to it with no relay.
The 556 powers the flasher directly.




Here is the Lemax signal.



Here is the bank of 21 IR block detectors and 44 signal drivers for the layout.



Carl
Last edited by Carl Tuveson
A 5 cent NPN switching transistor (e.g., 2N3904) can invert the polarity though this requires an external V+.

So when the train blocks the phototransistor, V+ (thru R) forward biases the NPN Q and pulls down the resistor at DIN to trip the SCB. When the train leaves, ambient light turns on the phototransistor which steals all the bias current and turns off Q.

The choice of V+ depends on what you have (+12V or whatever)...though I still think the SCB ought to have something you can take. rrman and Gary E have differing definitions of what DIN looks like but in either case it appears the current to pull down DIN is small (1/10 to 1 mA). This means the bias current through R is very small (microamps) so R will be, say, >10k. The Jameco devices you show have light currents in the 1 mA range for what I'll call easily achievable ambient light so it can easily cut-off Q when the train leaves.

After you do some experimentation, take another look at Carl's excellent project writeup and read between the lines on what he is saying about transmissive vs. reflective detection methods. I'll leave it at that.

As for dark operation, search ebay for "infrared illuminator" and get hundreds of hits for 12V Infrared sources for security cameras.

For example, several sellers have assembled boards with 36 IR LEDs like this for $3 w/free shipping. I wonder if a few of these strategically positioned on your ceiling might spray enough "ambient" IR to allow low light operation.
quote:
The choice of V+ depends on what you have (+12V or whatever)...though I still think the SCB ought to have something you can take. rrman and Gary E have differing definitions of what DIN looks like but in either case it appears the current to pull down DIN is small (1/10 to 1 mA).

As the designer of the Atlas SCB my definition should hold more weight. Also FYI the DIN input can withstand well over 500 volts.
quote:
Originally posted by DaveJfr0:
How do you gauge what resistor you need for this? I will be using the same 12VDC I am powering the SCB to power this. Should be enough current produced to power this.

How do I decide between 10k, 15k, or 20k?


The resistor sets the ambient (no train) vs. blocked (train present) threshold. Its value primarily depends on the level of ambient light and your phototransistor sensitivity. For the Jameco parts a range of 10k to 1 Meg should work. So start with, say, 100k and go from there. For experimentation, consider a 1 Meg trimpot. Since your source is ambient light which presumably varies around your layout, this might be a good idea even in the final. As you know commercial ITAD-type widgets have a sensitivity adjustment.

The amount of current needed from the 12V external source is small - a few mA for the Jameco parts.
quote:
Originally posted by gunrunnerjohn:
Well, we could use the concept if we knew something about your design. Smile

Now its been a long time since I have done analog design, but my concept idea would be using a capacitor integrator that would adjust a differentator trigger level bias over a period of time. When the light changed quickly (light beam cut off or restored) a differentator would create a pulse spike that is polarity corrected (there are positive and negative pulses depending if light or no light) would trigger a 555 timer to make a nice square wave pulse of some defined duration. As the ambient light shifts slowly however the bias would shift but not trigger the timer. So people walking by casting shadows etc would not trigger but passing train would.

Remember, just a concept idea here.
Another concept would be a 2nd phototransistor placed track-side to adapt to the ambient light by setting a reference level. The 2 phototransistor outputs feed a 25 cent comparator chip.

Separately, I was thinking how the isolated rail or pressure switch methods are fool-proof as they can be triggered by a truck anywhere on the section. With a single phototransistor between the rails, is there a problem if the train stops with a coupler - particularly a scale coupler - over the sensor? Do ITADs have this problem?

So to solve a problem that may not even exist, I'd suggest adding a 2nd phototransistor in series with the first. It would be placed, say, half a car length away from the first. In this way, if either (or both) sensor is blocked, then the output is triggered. That is, if one sensor sees the ambient light from the boiler-tender or inter-car gap, the other sensor should be blocked and all is well. And still well under $1...

Sorry fellas, all my designs use PICs. For those not familiar with it a PIC is a complete computer on a chip, ie; processor, memory, I/O. For this circuit I used a Microchip 12F508. It's an 8 pin DIP that costs 50 cents. Microchip now has a cheaper one the 10F200 for 30 cents. So basically you write some software to do what you want. In this case read the ambient level and use that as normal level. Adding some filtering and some hold delay is just a few more lines of code.
Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×