Skip to main content

gunrunnerjohn posted:

Why not use a simple regulator circuit to power it?  

Well, if you're going to let the regulators in the front door, why not the similarly priced LM317 as current regulator rather than the 78L05 voltage regulator?  Same number of parts (diode, capacitor, regulator, resistor)...but in this case the resistor directly sets the regulated current level.  For example, a common 47 ohm resistor would set the current to ~25 mA; note the LTE-302 IR LED is rated for 50 mA continuous output so can be driven harder than the 20 mA usually associated with driving visible LEDs.

Then you don't have to fuss with resistor-calculators if driving an LED from a voltage source such as the 5V 78L05 voltage regulator.  It's the current you're trying to regulate/control when driving an LED.

In fact, there's a clever LED module from Henning's Trains that converts AC-to-DC and uses the LM317 to regulate the current into LEDs.  You may have heard of it (sorry, couldn't resist) ...

 

 

 


Well, took me longer than expected to get back to this project.  The idea to use an incandescent bulb under track solved the problem.  I have some small 12 volt bulbs  Put a 68 ohm resistor in series, and they trigger the 2 cars I've converted, perfectly.  I pulled out the UCS-activated system from the one car that had it.  Thanks for the incandescent idea.

Just fabricated a 3rd in-car unit.  Relay pulls right in when sensor comes an inch or so from the bulb, but when removed from proximity of bulb, won't drop out until power is cut, even with room lights off.  I replaced the transistor, thinking it may have been defective, but that didn't correct it.  R1 is 1k, just as in the 2 successful units.  Connections seem to be correct.  Any thoughts?

Note I said with room lights out.  I believe Stan had said lowering resistance would increase senaitivity, but I'll have to re-read the thread.

Does an IR sensor conduct or stop connecting when exposed to light?  Reason I ask is that with sensor out of the circuit, relay clicks in and out as power is applied.

Just to be clear, I assume we're talking about this circuit:

rjr%20ir%20coal%20car

Decreasing R1 will decrease sensitivity...meaning it will take more IR energy to trip the relay.

I looked at the datasheet and like virtually all DC relays of that ilk it has the characteristic of turning on at, say, 10V but once tripped does not turn off till the coil voltage drops to, say, 2V.  So as GRJ says there's some residual current "holding" the relay closed even in a dark room. 

As GRJ suggests, try lowering the value of R1.  With a bunch of measurements we could "engineer" a robust solution meaning one with margin on the "turn-on" energy and the "turn-off" energy...but I think some trial and error would yield a suitable result.

Separately, the relay turning on/off with power with PT1 disconnected does not make sense.  I realize you double checked but I'd ask you to triple-check the connections!  In particular confirm R1 is making a solid connection.  If R1 is broken, cracked, whatever it will become "infinite" ohms making this a very sensitive circuit (since increasing R1 increases sensitivity) and stray current might trip the relay.

Attachments

Images (1)
  • rjr%20ir%20coal%20car
Last edited by stan2004

Put a voltmeter on the relay, and found that, when "stuck" on, it was getting full voltage. Fabricated a 4th unit, and it seems to work ok.  Do you think that with sensor less than 1"from the incandescent bulb, I should drop R1 to 570 ohms, or 720 or 860, rather than 1k?

ANother alternative would be to use an adjustable pot, like Jameco 253982, 1k.

Last edited by RJR

Without a tedious engineering analysis, there's no way to definitively answer that question.  I think you "get" what's going on here.  You want to set the sensitivity such that it is guaranteed to trip when the lamp is on...and then is guaranteed to release when the lamp is off even in the presence of typical ambient light.  Without explaining myself, I'll just throw out the notion of building in a 50% (or more) margin.  In other words if a 10% or 20% change in any parameter makes it flakey or intermittent, then you don't have enough margin.  So if 1" works, but 1.2" doesn't work, then you don't have enough margin.

The other notion is to keep in mind that once you build 10 cars, if you need to add margin, you want to do this on the lamp side where there's only 1 circuit to modify (rather than on the sensor side where you'd have to modify 10 circuits).  Modifying the sensor doesn't necessarily mean changing a circuit component such as the resistor - you can put a lens or shroud/skirt or whatever on the sensor to reduce the light it receives (e.g., give it tunnel vision).  But again it's easier to modify the transmitter by using a brighter lamp (smaller resistor on the track side).  Presumably the bulb is on for a very short time in the big scheme of things so operating a 12V bulb at 14V, 16V, etc. for a few seconds at a time is not an issue.

Not sure I answered the question but as I said it's not a simple yes/no!

 

Edit:  While a 1k trimpot would allow you to adjust sensitivity, I think you can build a bullet-proof circuit with a fixed R1 value.   That is, do it right the first time ... even if it takes some messing around with components and asking a bunch of questions.  But if you really want to "tune" each car's sensitivity, go with, say, a 2k (rather than 1k) trimpot to give you more range of sensitivity.

Last edited by stan2004

Stan, need some advice.  I've now finished 5 units that operate, in addition to the one that I can't figure out.  The in-car units are fed 18 VAC from the track.  Fluke DC voltmeter (true RMS) on output usually reads about twice the input. On two of the units, once the relay pulls in, it stays in until I unclip the sensor (even in dim light), but work ok if I cut the track voltage to below 10.  I'm thinking solution might be to put a resistor in the feed line.  Also, R1 is a 1/4 watt.  In the circuit you designed, you you deem this adequate?

Thanks, rjr.

Hmm.  Well I cobbled to together the circuit again and even used an incandescent bulb to trigger it.  I don't actually have a LTR-301 or your exact Zettler relay but used what should be equivalents.  I used R1=1k Ohm.  16V AC accessory voltage. 

So you put in 18V AC and you're reading about 36V DC across the capacitor C1?  I'd expect something closer to 25V DC.

Can you post a few close-up photos of one of the mis-behaving circuits.  Top and bottom at a few angles and I'll figure out the connections.

Also, in the mean time, if convenient could you make the following simple mod to one of the mis-behaving circuits.  Move the collector pin of the IR photosensor to the positive of C1.  It should work the same (I did try it!) but is a slight variation that might reveal something.

rjr%20ir%20coal%20car

1/4W is fine for R1.  The power dissipated in R1 is tiny - around 1 mW (1/1000 W).

Attachments

Images (1)
  • rjr%20ir%20coal%20car

By Jove, so it be, prof.  Interesting that a half-wave rectifier and that cap could produce a roughly doubled voltage.  This could be the explanation for the behavior I noted above.  It appears that such a breakdown isn't destructive, since the collector works on a retry. 

I've been tied up with a client's business, so haven't had a chace to try Stan's suggestied circuit change.  I'll await his reaction to your point.

I just pulled the data sheet on the 2N3904, and find max emitter base voltage is 6.0.  Would the latest version of the schematic violate this?

John, I just went back to the workshop and fired up my new US-made Fluke and a Z500 with Z500 controller.  With 17VAC output (full) from the Z500 (measured with the Fluke), using the 1N400 diode and 47uf cap, I got a reading of 26.8 VDC.  With a 9 volt output from the controller (remember this is an altered waveform), I got 24.7 VDC downstream from the diode & cap.

The "twice input" statement came from a reading at a lower input voltage than 17.

Last edited by RJR

The question then comes down to why would the LTR-301 keep conducting, even in the dark?  Could the presence of the relay coil in the original circuit from D1 output to PT1 collector have an effect?  I haven't had a chance to try the revised circuit.

I should add that it seems to work better if I cut the input voltage.

Last edited by RJR

So there's no misunderstanding, I assume we are now in agreement with a Z-controller you get about 25V DC pretty much independent of AC input voltage with the diode-capacitor.  The double-voltage was probably around 12V AC or so.  And at "full" 18V AC, you only get a multiplier of 1.4x which is as expected.

Hence, the 30V Vce breakdown voltage should not be a factor.

The 6V Veb breakdown voltage is the reverse voltage limit.  So that would be with the emitter pin more positive than the base pin.  You do not have that situation in either circuit.  For an NPN transistor like the 2N3904, the base pin is more positive than the emitter pin (i.e., forward-biased) with a voltage of around +0.6V when ON and 0V when OFF.

Yes, I am baffled as to why the coil does not shut off.  Hard to quantify what you mean by "dark" but once ON, the relay will stay ON until its coil current drops to, say, 20% of the triggering current.  The phototransistor is relatively linear in current vs. sensitivity (light hitting it).  So if you drop the light brightness to 10% of the tripping brightness, it should turn off.  I know it's hard to "visualize" something that is 10% as bright but going from a nominal incandescent bulb to a "dark" room is dropping well below 10%.

Don't be bashful, let's see some photos of your circuit, I'm just wondering if there's some "ah ha".

 

 

I'll study your photographs but I too was busy playing with my camera.  So here's a short video showing what I'm seeing using the original circuit.  I adjusted the bulb so it trips the relay at about 1" as you mentioned.  Then you can see it reliably turns off as the lamp is backed off.  Then I crank up the "ambient" light with a desk lamp and repeat.  Now it triggers at a bit more than 1" and turns off at a larger distance than before.  All as expected.  Then I adjust the lamp voltage at 1". Reliable, repeatable, etc. 

I switched to the alternate configuration and it behaves similarly but there it is a different circuit which for some reason may work "better" with your particular component combinations.

I'm also using a Z-4000 so a "pure sine" AC rather than the "chopped-sine" Z-500 controller.

 

Last edited by stan2004

Well, since I don't think it's practical to debug your circuit by playing the "20 questions" game, if adding a 470 to the sensor makes it work I think that's reasonable.  It does make the circuit less sensitive which is of course what you want.  Lowering the value of R1 should do the same thing but if you found something that works then so be it.

Going to the alternate circuit kind-of sort-of makes the circuit simpler in that there is less component interaction to put it simply; this might be the smart way to go since I don't plan to buy the exact parts you have to try it myself.  That said, when moving the connection point of the sensor collector pin, here's the on-off performance with various values of R1:

470: on at 3/4", off at 1"

1k: on at 1", off at 1-1/2"

2k: on at 1-1/2", off at 2-1/4"

For whatever reason it seems your circuits just don't want to turn off!  That said, it seems the idea is to make the lamp as bright as possible/practical so that the change between light and dark (on and off) is as large as possible.  And at the same time making the sensor circuit less sensitive (e.g., lowering R1) so that more light is needed to trip it.

I don't see anything obvious in your photos - probably a shorted transistor in the one that just turns on when power is applied.  If you want to get to bottom of that one, I'd just clip off the transistor and tack in a new one just to see.  Of course I say that assuming you paid 5 cents each or so for the transistors so it's not breaking the bank to scrap a possibly good part...

 

Guys, this project has gone so well that I've upgraded 4 Lionel ore dump cars and one Lionel milk car and all work perfectly.  Starting on the Lionel log cars (one a pre-war car with little space), and an MTH ore dump car which presents special space issues and getting trucks with rollers (roller trucks don't come with ground wipers, which are needed).

I left the UCS track in place, for now (since I haven't converted everything yet), and slipped an incandescent bulb between center rail and an activation rail, connected right to the terminals on the UCS that feed the activation tracks.

I do intend to work on the infrared emitted in the future, but noit really necessary other than to solve a challenge.

I want to strongly thank Stan2004 for all the effort he put into circuit design, also Gunrunner John and John Galt Line and others for their ideas and comments, without which this project wpuld not have been a success.  Of course, with sliders removed, the cars glide smoothly over switches.

Thanks for the update!

That's smart to update the title to describe the problem rather than a solution looking for a problem.  I think there are others who will now see the title and realize they have a similar situation.

Not that you need this, but if one does not want to see the activation bulb light up it can be filtered with a black plastic sheet which passes IR energy but blocks visible light energy (that's why it looks "black"....duh!).  This would be like the dark plastic lenses on the front of an IR-controlled TV, cable box, etc.

Your 12V DC relay was a good find that I was not aware of.  It is spec'd to operate continuously up to 26.8V DC coil voltage which is a good fit for rectified O-gauge command voltage.  Many other 12V DC relays aren't spec'd that high.  And less than $1 each!

 

 

I have been following this thread with great interest. Not to appear demanding, but I would appreciate a summary of the "as-built" project, I know it went through a few iterations and it is definitely something I would like to try myself. Don't need gory details, just a final schematic and crude detail of the optical link. Are you still using the LTR-301? What is the light source, how big is the light aperture? Distance bulb to sensor?

Thanks in advance for all your help!

Prof, per your request, I'm attaching some photos.  Some show the inside of the ore car, before conversion, with a ground lug attached through an existing hole with a 2-56 machine screw.  The sensor attached to the bottom with double-sided tape, which I also use to hold internal components.  Both trucks are replaced, one having a center-rail roller.  Bottom of car is sanded where trucks ride to assure good ground. The board with a relay mounted is the first one, used for testing.  I decided installation was easier when relay separate, connected by wires.  Blue wires are for relay coil (26 gauge); yellow is ground (26 gauge); gray is hot, including solenoid power (22 gauge); red is sensor cathode (28 gauge); black is sensor anode (28 gauge).  The latest boards are smaller than the originals; haven't installed any yet.  Not pictured is a board that is much narrower and uses a submini relay; this is for an MTH ore car where space is limited and used a small motor rather than a solenoid.  I took the track bulbs from my stickpile, marked 12-volt.  I put a resistor in the leads.  Photos of bulb mounted in a UCS and in a Gargraves.DSC02087DSC02085DSC02086DSC02088DSC02089DSC02090DSC02092DSC02094DSC02095DSC02096DSC02072

 

Attachments

Images (11)
  • DSC02072
  • DSC02085
  • DSC02086
  • DSC02087
  • DSC02088
  • DSC02089
  • DSC02090
  • DSC02092
  • DSC02094
  • DSC02095
  • DSC02096

Thank you for taking the time to post these photos. Somehow, I had pictured a completely different arrangement with somewhat larger parts!

I want to do about the same thing with some 3461 (I think) log dump cars. Looks like almost a duplicate of your setup. Definitely a good solution, although I may use a Triac instead of a relay for the sheer sport of it.

Thanks again for all your help.

I am in the process of tackling the log cars.  (Picture attached)  They present different issues, for they don't have an enclosed caverns into which components can be stuffed, but the components have to be hung underneath.  I have a shorter pre-WWII log car, which has no space anywhere.  I have done one milk car, and have 2 more to go.  Spent some time this afternoon fabricating 3 more boards--the short ones depicted in the photos.  I've settled on a component layout, so these 3 are essentially the same in appearance.  I just had to order truck rollers (481-10) from The Train Tender to convert trucks to center rail pickup. One advantage of a relay is that the clicking facilitates testing and debugging.

Thee relays I got were dirt cheap (<$1). with high capacities, which I wanted due to inductive load of a solenoid.

DSC02093o

Attachments

Images (1)
  • DSC02093
Last edited by RJR

Add Reply

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