# Magnets vs optical?



## Ray Dunakin (Jan 6, 2008)

What are the advantages of using optical sensors to trigger chuffs? I know some systems use this but it seems like it adds an extra layer of complexity, and more potential failure modes. Am I missing something?


----------



## Del Tapparo (Jan 4, 2008)

Well, it should just make things easier for the end user, not having to physically find or rig-up a mounting location for a reed switch and magnets because it's all built into the electronics that came with the loco. However, the optical chuff that came with the K-27 apparently never got tested in the development lab ( do you think they even have one?), so it doesn't work without a bunch of rework that most folks aren't capable of doing.


----------



## Semper Vaporo (Jan 2, 2008)

Posted By Ray Dunakin on 11/14/2008 1:11 PM
What are the advantages of using optical sensors to trigger chuffs? I know some systems use this but it seems like it adds an extra layer of complexity, and more potential failure modes. Am I missing something? 








Magnetic reed switches have a hysteresis to opening and closing and thus do not react as quickly as an optical sensor. So at high speed the reed switch can miss closing (or opening) per revolution and the chuff could suddenly reduce in speed, become erratic or quit altogether.

The disadvantange of the optical sensor is the need for power to the light source as well as from the sensor... minimum of 3 wires (one shared between the lamp and sensor) instead of just 2 for a plain switch.

At high trigger rates (loco speed) the optical sensor may be able to keep up, but the sound card may not be able to produce the sounds at that rate so it becomes a moot point whether one uses magnetic/reed or optical sensing.

Both systems have failure modes. Dirt on/in the optical sensor can upset the trigger output, but spinning a magnet can produce unbalance and the magnet can pick up metal debris and cause problems that way. Both solve the wear problems associated with a wiper on a rotating contact, but magnetic is seldom vexed with dirt (on the contacts, anyway), whereas the optical can be.

To me it is all a toss up as to which is actually "better" when the many failure modes are taken into account. Some folk may do better wtih one than the other and others will be the opposite. Kinda like the battery/trackpower debate

And just like the battery/trackpower debate, it could all be solved by going Live Steam and you get real authentic sounds! Okay, okay, Live Steam has it vexations too, but given my online name I just had to point it out!


----------



## Ray Dunakin (Jan 6, 2008)

Ah, I see! Thanks, that makes sense.


----------



## Dan Pierce (Jan 2, 2008)

The real answer might be the hal effect transistor. 

This is a sensitive magnet sensor solid state device, no light. Best of both worlds. 

I believe this is what LGB uses as their sensors are in the gear box and grease would not be friendly to light sensors.


----------



## TonyWalsham (Jan 2, 2008)

Posted By Dan Pierce on 11/15/2008 6:03 AM
The real answer might be the hal effect transistor. 

This is a sensitive magnet sensor solid state device, no light. Best of both worlds. 

I believe this is what LGB uses as their sensors are in the gear box and grease would not be friendly to light sensors.


Hey Dan.
Would that be the same *hal* from "2001 A Space Odyssey"?


----------



## Curmudgeon (Jan 11, 2008)

Uh, 
If the reed and magnets were factory installed (like, oh, say mechanical chuff contacts), seems it would be just as easy as factory-installed opticals. 
Plus (big plus) you wouldn't need additional electronics to power the optical if using a reed or straight mechanical. 
Should you have a failure, reeds are easy to come by. 
Fry your electronics, you'll be paying some guru big bux to fix it. 
I don't think the official/unofficial spokesperson thought of that. 

I guess with all the folks who need molly-coddling with plug-and-play, the need to add electronics to invert the chuff signal back to something usable sort of obviated the giant step for ameskind. 

I don't care, as long as it works and parts are available. 

Now, I haven't gone looking, as I "fixed" all the optical units through here, but don't we need a part number, or all those optical units all exactly the same? 

Reason I ask, is the ones currently in-use have no part numbers on them to identify them. 

Maybe, in the entire world of electronic parts, there is one and only one, so no choices possible. 
Not likely, but possible.


----------



## dbodnar (Jan 2, 2008)

Ray - if you would like to see a bit more about Hall effect sensors you may want to look over this article:

http://www.trainelectronics.com/artcles/Sensors_Part_II/index.htm 


It is part II of a three part set of articles I wrote on Garden Railway Sensors

The others are indexed at: http://www.trainelectronics.com/articles.htm




dave


----------



## Greg Elmassian (Jan 3, 2008)

Hey Dave! Long time no talk! 

Can you get any "range" with hall effect sensors? Many people want to put magnets and reed switches on loco drivers. But, for example, on an Aristo steamer, where the axles slide side to side almost 3/4", you cannot get anything to work unless you "lock" the axle and then move the reed switch up close. 

Any "long range" hall effect sensors? Maybe the solution is an IR sensor beaming off a reflective stripe? 

What are your thoughts? 

Regards, Greg


----------



## dbodnar (Jan 2, 2008)

Hi, Greg - my experience with Hall Effect Sensors goes back 20 or more years and I don't think I ever got more than 1/2" from them reliably. They are much happier with close encounters with magnets.

It looks like the venerable old reed switch is still the distance king. I can detect a strong rare earth magnet the better part of an inch away from a good reed switch.

I am sure that you will recall that a magnetic field decreases dramatically with distance. Even a little increase in distance between the magnet and the sensor can make detection unlikely.


dave


----------



## Greg Elmassian (Jan 3, 2008)

Dave, if I could accomplish an inch, it would be great, any recommendations on a sensitive one? On the magnets, as strong and as large as will fit would probably be the rule if going for distance, I would assume. 

By the way, still loving my wireless speedometer car! works like a champ. 

Regards, Greg


----------



## Les (Feb 11, 2008)

Dbondar

I was *very* interested by your post.

I want to build some common circuits, such as an activator when a train goes by (or over) to trip start sequence in a trackside device or do other such things. Lowering a crossing gate, for example. Simple, straightforward stuff.

Do you know where I can find a book that contains common transistor/IC circuits for model RRing? About all that seems to be out there are things done in the 90's and that's ancient in terms of electronics. I know how to solder and follow a wiring diagram just fine. And board layout.

Thanks,

Les


----------



## Les (Feb 11, 2008)

Dave,

I forgot to ask if you knew how much current a smoke generator pulls? I assume all of 'em in LS rring are DC?

Thanks,

Les


----------



## Del Tapparo (Jan 4, 2008)

Posted By Les on 11/19/2008 3:46 PM
Dbondar

I was *very* interested by your post.

I want to build some common circuits, such as an activator when a train goes by (or over) to trip start sequence in a trackside device or do other such things. Lowering a crossing gate, for example. Simple, straightforward stuff.

Do you know where I can find a book that contains common transistor/IC circuits for model RRing? About all that seems to be out there are things done in the 90's and that's ancient in terms of electronics. I know how to solder and follow a wiring diagram just fine. And board layout.

Thanks,

Les

Google "Model Railroad electronics" and you will find sites like this one: http://www.mrollins.com/circuit.html


----------



## dbodnar (Jan 2, 2008)

Greg - I did some quick tests here with items that I had on hand. With a small reed switch from All Electronics:

http://www.allelectronics.com/index.php?page=search&search_query=rsw-27&x=0&y=0 

And a magnet from a discarded 3.5" computer hard drive I got over 1", close to 1.25" activation - The magnet is a fairly large and extremely powerful. 


Here is a photo of the reed switch and two of the magnets. 












The magnets shown here are atteched (usually glued) to a metal plate. You can remove them by putting the end of the plate in a vice and bending it - with any luck the magnets will pop off without breaking. Even if they break they will still work well.


----------



## dbodnar (Jan 2, 2008)

Les - In addition to the reference that Del gave you there are a number of articles on model railroad electronics on my web page at:

http://www.trainelectronics.com/ 


Just click on "Articles" at the top of the page - The articles are very detailed and cover a multitude of topics that are of interest to many garden railroaders.

You are sure to notice that I have a bias towards microcontroller based circuits, something that folks in this day and age are wise explore. 

Please let me know if you have any specific questions or projects in mind.

As to the smoke units, most draw quite a bit of current, often as much as the locomotive's motor. The best way to get a definitive answer to the question is to put your locomotive on rollers, put an amp meter in line with the power supply and take a reading with the smoke unit on and again with it off. 













dave


----------



## toddalin (Jan 4, 2008)

Posted By Les on 11/19/2008 3:46 PM
Dbondar

I was *very* interested by your post.

I want to build some common circuits, such as an activator when a train goes by (or over) to trip start sequence in a trackside device or do other such things. Lowering a crossing gate, for example. Simple, straightforward stuff.

Do you know where I can find a book that contains common transistor/IC circuits for model RRing? About all that seems to be out there are things done in the 90's and that's ancient in terms of electronics. I know how to solder and follow a wiring diagram just fine. And board layout.

Thanks,

Les




Les, follow the link for a wealth of model railroad electronic circuits.

http://www.discovercircuits.com/M/model-trains.htm


----------



## Les (Feb 11, 2008)

Thank all of you who replied!

I have an LGB (?) over-the-counter boughten smoke unit. Don't know what the voltage/current is supposed to be, but I'm guessing a max V of 18vdc. Yeah, I'll hook it up and measure the draw. I want to put it in one of my structures. When I get any built.

Les


----------



## Les (Feb 11, 2008)

Dave,

I'm a tad leery of microprocessors. First, I'm sort of stupid where computers are concerned. Not to be unkind to myself, you understand.









Years 'n years ago I did some machine-langauge programming, but that was it. (The Fortran I days). 

I agree that processors are the very berries--if you understand 'em. The cheapest I can find w. documentation are ~$100. I think that includes a USB cable, not sure. "PIC" is the name.

Basically all I need is a sensor circuit (IR, magnetic, optical, etc) a 'sort-it-out' circuit, and probably a power transistor on the output to run the gizmo. I want animation on my RR as I build it. Simple stuff, like a groundhog sticking its head up when a train goes by. Just simple stuff. Door opening, ball on signal rising/falling. No brass bands or anything.

Thanks again for the offer.

Les


----------



## Guest (Nov 19, 2008)

reed switches and high energy magents are much smaller than the typical optical devices. The kind that Dallee provides is especially huge. I had lots of problems getting the Dallee unit to work properly as it is a reflective type of device. The optical sensors that are the most reliable are transmission devices where some object is moved in and out of the optical path.

Hall devices have been used for chuff switches. You'll find them underneath the older Aristo Pacific and slopeback tenders.

As to the other question about smoke generator current draw, it varies a lot. 

see http://www.girr.org/girr/tips/tips3/smoke_tips.html#power


for some test data on several common units.


----------



## SteveC (Jan 2, 2008)

Les

Make sure that you check out George's web site, cause if I remember there were two or three different voltage levels for LGB smoke units.


----------



## Trains West (Oct 4, 2008)

yes you need to check as some lgb smoke units are 5 volt .... if you have a part number I can look it up ....


----------



## dbodnar (Jan 2, 2008)

Les - I think you will find the three articles on Garden Railway Sensors would be worth your time: 
[*]  Garden Railway Sensors Part I - Reed Switches & Relays [*]  Garden Railway Sensors Part 2 - Hall Effect Switches [*]  Pulsed IR Sensor Part 3 - 38 kHz Pulsed IR [/list] 
I also don't want you to think that all of my project are microprocessor based - in the three articles above they are only used in the last section. 

As to price you can get started with the PICAXE microprocessor for all of $10 or $15 - the PICAXE 08M processor is remarkably capable and costs under $4.00 - the programming cable can be made for a few dollars and plugs into a standard 9 pin serial port or a USB to serial adapter. Programming is done in BASIC and the software, documentation and programming examples are free. Have a look at: 



http://www.rev-ed.co.uk/picaxe/ for information / software and documentation


Peter Anderson also does quite a bit with them - see: 


http://www.phanderson.com/picaxe/ 

You may also want to look over the presentation notes from the workshop that I did at the ECLSTS & the national convention in Phoenix this year at:
http://www.trainelectronics.com/ECLSTS2008/ECLSTS-2008-rev5.htm

http://www.trainelectronics.com/ECLSTS2008/ECLSTS-2008-rev5.htm 




It explains how simple it is to set up the PICAXE and do productive things with it.

The cost of getting started with the PICAXE's big brother, the PIC microcontroller, is fairly high - the programmer can cost $100 or more and you can spend well over $250 on programming software. I do use the PIC for many projects but the PICAXE is a better alternative for those who want to give it a try - they are designed for use in schools and are extremely well supported. 




dave


----------



## Dan Pierce (Jan 2, 2008)

Les, be careful with LGB smoke units as there were 3different voltages used, 5, 18, 24 for the ones without the stack.

The way to tell the voltage is by the color of the wires on the LGB non stack smoke unit.

Black and white are 5 volt units, LGB runs these on 6 volts for more smoke.

Yellow/brown are 18 volt units as are the complete stack units.
white/white are 24 volt units.


PS, Seuthe makes the 16 volt unit and has 14 and 16 volt models. Be careful if using a Lionel Seuthe replacement for only one version has the 16 volt rating and it is the model 7. 



Here is a link with voltages and current ratings of the seuthe units that plug into Lioinel or LGB engines plus HO units.

If the LGB modular stack with smoke built in, then you would have to measure the current at 18 volts. 


http://www.mgsharp.com/Seuthe.htm


For battery operation, the model 6 could be better for 12 to 14 volts if smoke is wanted/used.


----------



## Les (Feb 11, 2008)

Steve,

Thanks for the hedzup. I'll set up to monitor the current as I crank up the voltage.

Les


----------



## Les (Feb 11, 2008)

Dan,

Thanks for the info. I bought mine OTC from the closest hobby shop (25 mi one way). Regrettably, it was run by an old guy who's not particulary agile, mentally. (Like I am, yeah, right. I'm not criticizing, just explaining why I got a new Smoke unit with no paperwork. Maybe that was the day TWO old guys met....)

Les


----------



## Les (Feb 11, 2008)

Scott,

Thanks for the offer. I'll go downstairs and post tomorrow.

Les


----------



## Les (Feb 11, 2008)

Dave,

Thanks for the addrs and the note. I went to your site last night and scanned about briefly. Looks like just what I've been looking for.

Yes, Picaxe was the micro, and the only ones I could find last year were $50 or so, plus some hardware--a cable, I think. I now have a USB cable, and I've darn sure made plenty of those Cannon plug cables 'way back when. As for the Basic Language, I've always sorta wanted to try it, but when I tell you that I'm dumb about computers, you better believe it to the max. Also, like some old folks, new ways tend to make me a tad anxious, and at this stage of my life, anxious is the last thing I want to feel.

One thing I've concluded is, the English used by computer folks is not necessarily the same as the rest of us speak. The same words have different meanings. But, that's the way the world's always been, I'm not complaining.

Les


----------

