Showing posts with label Electronics. Show all posts
Showing posts with label Electronics. Show all posts

Monday, August 3, 2009

Better sound for model railroads

I like sound a lot. Sound is a big part of the railfanning experience, and it can also be an important part of model railroading, but there are problems.

Not that I’m opinionated or anything, but the sound on DCC decoders is just awful. David K. Smith wrote an eloquent piece on this a couple of years back, and I’m going to second and third his motion. There are basically two problems with onboard loco sound: the earbud-sized speakers on the boards aren’t capable of reproducing sound with any kind of fidelity, and even if they could (or even if you piped the sound output of a decoder through a separate amp and speakers), the 8-bit sound digitization on the board is akin to the sound in a plastic child’s toy.

I think it’s easy to get hung up on the idea that a loco’s sound must originate from exactly the same place as the loco, and I’d like to refute this notion. As modelers, we don’t duplicate reality exactly, but rather we design and build heightened and augmented versions of it, with certain things emphasized and other things de-emphasized. Next time you watch a movie, note how the synced sound consists mainly of dialogue and Foley (footsteps, explosions, etc), with much of the sonic environment being “wild” or unsynchronized.

So, what to do if you’re interested in a realistic, high quality, immersive sonic atmosphere for your pike? You can make (if you’re handy with digital audio software and have access to a sound library) or buy a basic environmental sound mix containing country, city, and industrial noises, have these on audio CDs or other playback hardware, and reproduce them through a decent amp, with decent speakers behind or below your layout.

But what about the loco sounds? Time to think outside the box:

  1. If your layout (or one part of a large layout) is a yard or industrial switching area, augment your environmental sound mix with occasional and random slow-speed loco movements, brake, coupler, bell, and horn sounds, so that the loco you’re controlling becomes just part of a larger sphere of activity. This can be amazingly effective, even though there is no loco “sync sound.”
  2. If you must have specific sync sound for the loco you’re operating, you could compile a collection of around a dozen key loco sound sequences (station halt, comin’ ‘round the bend, distant and close horn blows, etc) as audio files on a computer. Then use software to trigger these sounds; do this concurrently while you operate the loco. Combine the computer’s sound output with the basic environmental mix, and route this to two good speakers in a stereo pair under the layout, or above it. Again, the overall psychological effect of good, balanced, immersive sound far outweighs being able to have the sound come from a precise location of the layout.
  3. Don’t use loco sounds, make do with the natural clickety-clack on your model rails.
Remember that, like everything visual on your layout, sound also needs to be to scale. This means using very low volume levels: imagine that as you peer down at your layout, how loud would the sounds be if this was the real world and you were floating in the sky looking down?

Finally, note that our ears are much less sensitive to bass and treble at lower volume levels. Your amp (or CD player) may have a “loudness” function, which compensates for this by boosting bass and treble. This keeps the sound fuller without making it louder. Use it if you have it.

Thursday, July 23, 2009

My favorite electronics vendors

Here is a short list of electronics vendors that sell items of interest for hobbyists. If nothing else, the sites are fun to browse. Note that I am not financially affiliated with any of these vendors.

Monday, April 20, 2009

LED "rosettes" to light structures

I wrote earlier about using yellow LEDs to light structures internally. Having just started construction on a new module, I've decided to apply this technique, and have sorted out some better specifications than the ones I previously posted.

The advantage of LEDs is that they are dim enough that, with proper positioning, they won't make the structure walls "glow" in the dark, even if you don't paint the insides of the structures black (a chore I despise, and one which presents many opportunities for accidentally painting over places that need to be glued). Their dimness also means you pretty much need one LED per window, sometimes two for a big window.

So, because even a simple structure usually requires several LEDs, I've been constructing circuits of 6 LEDs. I bend the leads of 6 LEDs, solder them positive-to-negative in series, then solder a 220-ohm resistor to the positive end (a value that will give the right current to the LEDs using most transformer accessory power), and two wires to the opposite ends, making a kind of circle I call a "rosette." This rosette/array of LEDs can then be arranged inside the structure, so the LEDs are a millimeter or two behind each window, pointing right at it ... of course it's a good idea to diffuse the light by backing the window with vellum, frosted mylar, paper, etc.

Each of these circuits will consume 20-25ma, depending on transformer voltage. I use a single full-wave bridge rectifier to feed the circuits (since the LEDs only conduct in one direction). As you can surmise, you can power a large number of LEDs using only a fraction of the power from one transformer.

Tuesday, September 16, 2008

Sharing 16-20V AC accessory power between turnouts and lights

It's often said that incandescent lights on a layout, be they inside your structures or the streetlamp variety, look better and last longer if they are run below their rated voltage, for example running a 12V lamp at 9V. To do that, though, you can't just wire up all the lamps to your accessory power, you generally have to run them off the variable DC output of an extra transformer.

I have a nifty solution for this problem, which also reduces flicker in the lights if you use the same accessory power with remote turnouts. Using diodes, create two circuits off the accessory power with each circuit rectified in a different direction. The half-wave rectified power in one circuit is still plenty powerful for the coils in your turnouts. The other circuit goes to the lights, and since there is a lag when incandescent lights switch on or off, they appear to still be glowing continuously, albeit a bit dimmer.

Note that this doesn't work for any LED lights, the half-wave power will product a very noticeable flicker since LEDs shut on and off instantaneously.

Friday, April 25, 2008

A great microcontroller board for model railroaders

I wrote earlier about the myriad uses for microcontrollers on model railroad layouts, and at that time recommended the pricey but easy to use BASIC Stamp by Parallax. It's a great learning system for those who are new to microcontrollers. However, for those who are a bit more comfortable with basic electronics and simple programming, I'd recommend taking a look at the Arduino, in particular their Diecimila board which costs about US$35.

Unlike the BASIC Stamp, which runs interpreted BASIC on the board, the Arduino uses a compiled language called Wiring which is very close to C/C++, so code runs much faster; the software and development environment are freely downloadable. In addition, there is 14K of flash memory on the board for your program, 14 digital I/O pins, 6 separate analog input pins, and serial communication. There's also an on-board USB jack for easy connection to a PC; the board gets its power from the USB jack, a battery, or an external power supply.

Saturday, December 8, 2007

A different approach to lighting plastic structures internally

Anyone who has attempted to install internal lighting in plastic structures has faced two headaches: the incandescent lamps normally used are bright enough that the structure's walls tend to "glow," and the light also throws into relief the fact that there is nothing inside the building (obviously the latter point is moot for those very few of us who super-detail their structures by placing items inside).

The usual solution for the former is to paint the inside of the structure black. This presents new problems, especially if you're dealing with an already built-up structure, because the edges of windows and doors need to be unpainted so they can be glued to the inside of the walls. However, leaving them unpainted will cause "glow" light around the edges. It's a Catch-22.

My solution is to replace the incandescent light with yellow LEDs right behind each window or door which is to be lit. This looks great in the dark, and the LEDs are dim enough that they won't make the walls glow.

First, determine which windows and doors will always be dark, and attach black construction paper behind the glazing and any other details such as curtains. Easy.

Second, for windows/doors where you want nighttime light to appear, attach regular white paper behind the glazing. Now, using regular 5mm yellow LEDs (not the super-bright ones), place one LED behind the white paper on each window or door, sitting 3mm or so back from the paper. Wire all of them in parallel, making sure the anodes and cathodes are all going the same way (i.e. they should all be wired with the same polarity). To this parallel LED cluster, attach one 1K-ohm resistor in series (it doesn't matter whether this is attached to the anode or cathode side). You can try reducing the resistor's value if the LEDs appear too dim, but don't go below 680 ohms.

The last step is to put a full-wave bridge rectifier between your accessory power (I'm assuming you'll be using 16-20V accessory power to light the structures) and the LEDs with resistor. Make sure you match the + output of the rectifier to the anode side, and the - to the cathode side, with your resistor in series on one side. If you omit this step, the LEDs will only be using half the power cycle since they only pass current in one direction, and they will flicker and appear dim. Since each structure will only be drawing around 15ma or so, one 1-amp rectifier should be good for quite a few structures.

Thursday, December 6, 2007

Uses for microcontrollers in model railroad electronics

Microcontrollers are fascinating little devices that have multiple uses for model railroads. I've used them several times -- perhaps in future posts I will drill down to specific how-to's, but for now I'd like to just present a few ideas in hopes of stimulating the creative juices.

First, if you've never used a microcontroller, know that they are not nearly as daunting as you might think. A basic grounding in electronic theory is helpful, but even without this you can buy educational packages that include both the devices and learning tools. In fact, the package I would recommend for most beginners is based on a microcontroller system called the BASIC Stamp, and is available at Radio Shack for $80. This package includes a great how-to book, programming software, and lots of extra electronic parts you can use. (A word about the BASIC Stamp system: it rates low in terms of cost-effectiveness, but high in terms of learning and ease of programming.)

On to the applications:


Custom throttles

Microcontrollers excel at timed, switched, or pulsed electrical signals, so they are a natural bridge between a knob and a sophisticated pulsed-modulated drive signal for locomotives. Or, forget about one knob, and use some combination of switches, sensors, or other electronic components to control the movement of trains.


Animated/timed/sequenced lights or LEDs

A flashing "neon" sign, "crawling" light patterns you see around marquees, arc welders, campfires, train signals, traffic signals, etc.


Block detection

Connect some basic block detection circuitry to a microcontroller, and now the position (and, in DC systems, direction) of your train on the tracks can control signals, crossing gates, or ...


Automatic turnouts

This is not for everyone, but the first layout I built used a microcontroller between block detection circuitry and the magnetic coils on remote turnouts. An example: imagine the mainline approach to a turnout is A, the mainline route after the turnout is B, and the diverging route is C. If a train goes from A into the turnout without stopping, the system makes sure it will continue on to B. However, if the train comes to a stop in A but resumes movement in less than 3 seconds, the turnout is thrown and the train will proceed to C.

In DC (not DCC) systems, you can also differentiate based on the train's direction of travel, or use this in tandem with the timing of starts and stops to intelligently control the turnouts.

You can begin to see the possibilities here; the microcontrolled turnouts can replace a big part of a control panel. Of course, there are limitations to this approach depending on the degree of prototypical operation you wish to retain, but it's intriguing to consider the possibilities.


Automatic uncoupling

Similar to the above, but substitute the coil of an electromagnetic uncoupling magnet for the turnout coils, and now your train motion (again, based on train position and/or direction) can be used to trigger uncoupling events.


Automatic nighttime

Use the microcontroller with a photoresistor (or several of them) to turn on the after-dark lights on your layout, based on the ambient level of light in the room (i.e. whether or not the room lights are turned on), or based on a clock.


Complex animation

Combine your microcontroller with a servo motor, and the animated elements on your layout are no longer limited to simple circular or back-and-forth motion. The BASIC Stamp package described earlier includes one servo motor that can turn 180 degrees end to end; there are also motors available that can turn continuously.

Monday, December 3, 2007

Build or buy a nifty PWM hand held throttle

PWM control is great on DC layouts, particularly for yards and switching districts. It enables truly slow scale speed operation without hiccups or "instant" starts and stops.

This fellow sells a neat little hand held throttle that generates a PWM signal and gets its power for the AC outputs on your transformer. He also shows the complete schematic if you'd like to build it yourself.