There was a time, while I was working on my Round House and Turntable project, when my efforts were delayed. During these days, I started to work on smaller pieces, such as rolling stock and signal towers and bridges. While I was building the signal towers and bridges, I started brainstorming with some ideas for making the signals actually work! Up to that point, my ideas for signals had included three, separate colored lenses (red, yellow, and green, of course). What I wanted was a signal with only one lens. That's when I remembered the hole in the middle of the 2x2 round bricks and plates, and I decided to see if I could fit an LED through the hole. The sub-miniature LEDs fit just fine. (You can even fit some mid-size LEDs in there!)
Here's how I put these things together. The parts shown in the drawing above are;
When assembling these pieces, it will work better if you place the lens (piece 3) onto the 2x2 round plate (piece 2), and then insert the LED (piece 1) through the hole in the plate, and into the lens. You can then attach the 2x2 round plate to the supporting structure, and that will help to keep the LED in place.
Some LEGO signal device ideas, which use 3 lamps (red, yellow, green). I suppose the three positions help the color-blind folks tell which lamp is lit. Still, these early designs were what prompted me to think about making a controller that could drive three LEDs. From that starting point, I wanted to see what it would take to use a single bi-color LED
Here are a few ideas for blocking the track-ends in your switching yards:
Once I knew that the LED would fit, I wanted to find a way to drive the LED. These LEDs normally come in two colors, with two or three leads. While it would be simple to have a Red/Yellow, Yellow/Green, or Red/Green combination with simple switches, I wanted to push the limits a bit. With a Red/Green LED, you can achieve a yellow appearance by alternating between the red and green states. By changing the ratio of time that each element (red and green) is turned on, you can 'tune' the color quite a bit. (You end up with an orange color if you try to light the green and red at the same time using the three-lead devices.)
My hardware hacking led me to choose TTL (Transistor-Transistor Logic) technology, to ensure adequate drive current for the LEDs. This means that this design relies on a small, regulated 5-volt DC power source (and all resistors presume you are using a +5V supply for the logic). Since I'll have a 12-volt power supply for the LEGO Train Speed Controller, I decided that I could tap that source, and use a low-capacity linear regulator to supply the 5-volts for the digital chips. The 78L05 is good for 1-2 signals, but the LM340T-05, or the LM309K should be used for larger projects.
The timer circuit shown here is capable of providing a wide range of frequency, but it can also vary the on:off time ratio.
The combination of the two resistors and the capacitor create an "R/C circuit", which controls the period of "on" time in free-running 'astable' mode. The second resistor and the capacitor then become a different R/C circuit to determine the length of the "off" period.
Using the potentiometer, you can vary the length of both periods, but the "off" period is affected more than the "on" period, which is how I "tune" a bi-color red/green LED for the best "yellow" output.
The timer circuit is a typical LM555/NE555 timer (a linear IC device, in an 8-pin DIP package, configured as an 'astable multivibrator'), which is a good choice for the low part cost, and ready availability. The 555 timer chip, one resistor (100k, 1/4w), and one capacitor (0.1 uf), and one 150k potentiometer (or another 100k resistor) complete the schematic. A possible test scenario is shown below.
The timer can be an NE555 circuit or similar. The potentiometer can be used to 'tune for yellow'. The inverter shown would allow you to install an LED near the timer, so you could see the yellow as you tune it.
The inverter also provides an inverted timer output, to compliment the original output. (This complimentary signal be used to reduce the number of inverters used in the original schematic shown below.)
My idea was to have a single, pushbutton switch, and a circuit that would sequentially step the LED through four 'color states' (off, green, yellow, red) just by pushing the button. The advantage to this would mean that the circuit could also be automated with sensors under or near the track! The circuit would need to be simple, and easy to make. I took a few passes at the circuit design, trying to reduce the number of gates and chips used, and came up with the following circuit.
The Originally Proposed Schematic (below) has been tested, and works well, using the timer circuit shown in the previous diagram. The timer circuit is not detailed here, so that you can substitute your own timer, if you prefer.The key is to have a timer with a variable on-to-off ratio, giving you some method which allows you to 'tune for yellow'.
The circuit shown is based on TTL technology, and it could be simply combined on a single, custom chip, less than 1/5th in square, with only 8 pins (for someone with venture capital, or access to a chip foundry ;-). The block at the lower left is a (7490) binary counter chip. To achieve the four states, we only need a 2-bit counter. But, rather than build one up from discrete gates and flip-flops, I chose to use a simple counter chip, so I could reduce the number of chips needed per signal. The a and b signals provide our 2-bit counter. Either of the c or d signals would perform a reset of the chip, forcing all outputs back to the '0' state.
however: the '90 has 2 reset inputs, which (I can't remember) are either ANDed or ORed, so it might be that you can get rid of the OR gate that way. On the other hand, you don't care whether it counts 0..3 or 0..7 since you're not using the 'C' bit - so just attach the 'D' bit to both reset inputs and drop the OR!
For the rest of the circuit:
Unless you're particularly set on the counting order of the colors that you have, you could do this:
ledwire1 = B NAND ( A NAND
ledwire2 = A NAND (B NAND NOT(Timer))
(Check me, write out the result, I could be mistaken...)
This can be done with 1 7400 and one inverter, which would be 1/4 7400 or 1/6 of an inverter chip, whatever is more convenient (7400s tend to work better for me; no worrying about open collectors etc. on different inverter chips, more useful anyway, etc.)
Depending on the direction of the LED, you can get 0,R,G,Y or 0,G,B,Y. By inverting A, B, or both, you change the order a bit.
The '90 is a fun chip, along with the slightly less interesting 93, which I needed for a Knight-Rider running red light - only time I ever water colored Lego, for lack of black bricks :)
This Suggested Circuit greatly reduces the parts count and the circuit complexity;
But there is a change in the color sequence. This circuit cycles through the sequence off-green-red-yellow. If you reverse the LED, the sequence becomes off-red-gren-yellow.
I like the simplicity a lot. I'll have to build it and test it, and see if I think the order of the colors is too much of a hassle as an operator.
The counter chips are each needed for a single signal, but you could use a single timer for many signals. (The only caution here is that you would probably want to have your LEDs from the same vendor and batch, so that the 'yellow' timer value would look OK on all of them.) If you have different LEDs, you might want to use individual timers for each circuit, so you could tune each one. Also, if you are making more than one signal, you should consider using the LM556/NE556 timer chip, which is the 14-pin twin-timer version of the 555. You can get two independent timers from one chip!
For my design, I chose the 7490, which is a Binary-Coded Decimal (BCD) counter. This means that a clock input will cycle the counter through a sequence of 0-9, and then restart at 0. It also implies that the outputs will be four signals, in "Two's Compliment" sequence. (So, a is worth 1, b is worth 2, c is worth 4, and d is worth 8.)
In this case, since we only need 4 states, we only need the first two bits (a and b). If either of the other two leads (c or d) is turned on, something is wrong, so we use them with an extra or gate to reset the chip, and setting all of the leads to a logic 0. This gives us a counting sequence of 0-1-2-3, and then back to 0.
State descriptions: 0) green 1) yellow 2) red 3) off (numbers 4-9 force a reset to 0)
The advantage of this design, for the modeler, is that the "power-up" condition should set the counter to the "0" state, which would light the signals to be green. This would be feedback that power was on, and would give you a quick chance to check the status of all the signals. The disadvantage is that you then have to cycle all the signals to the states that you want them, which might then be 'off' (state "3").
Here are the pinouts for the 7490 BCD counter in this configuration. Since the 7490 has a number of reset options/conditions, we tie the additional leads to ground, to ensure that they don't 'float', causing strange operation.
My vision (for my layout) is to have a small, square pushbutton (I'm using S&K panel-mount switches), with a small, rectangular, bi-color LED built in. This LED would be in parallel with the LED in a signal, so I would have a visual indication on the pushbutton that will reflect the state of the signal.
I finally built the circuit on a bread boarding system, and it checks out just fine! If you're curious to see the prototype, you can see the photo of the breadboard with the first circuit prototype.
The illustration at the left shows the Wire wrap pattern (viewed from the underside of the chip) for the updated circuit, using one 7400 IC per signal.
The two timer signals come from the timer circuit, and may connect to many 7400 ICs, side by side, on the same circuit board.
If you are planning to drive more than (6-8) 7400 ICs, you should put the timer signals through a buffer or inverter, so that these buffer parts will help spread out the load for the timers. (The timing signals would go into the buffer parts, and each buffer would drive 6 of the 7400 ICs. Use no more than (6) buffers as loads on timer outputs.)
The illustration to the right shows one of my ideas for using a 6-pin DIP header for connecting each switch and signal to the driver circuit. This allows me to have the pushbutton switch contacts, the LED for the signal, and an LED for the control panel on a single connector.
I've also thought about using a switch with the LED integrated into the switch somehow, rather than using seperate LED mounting devices. For the prototype, I picked an S&K pushbutton switch, which allows a rectangular LED to be installed, so you can see what color the signal should be while you push the switch.
OK, Now What?
So, I have a timer that makes red/green LEDs look yellow, and I have a counter circuit as a sequencer to step the LED through a cycle of colors. How many of these can I make?
I began to worry about the issue of how many sequencers could one timer drive before things don't act the way you would expect. I also began to think about digital control of the power to track segments. And I began to think about using slow flashing LEDs to tell me which sections of track in my Round House were powered. "Aha!" I said to myself. "I'm going to need a whole control system! It must be modular, and expandable." Clearly, I was delusional, but at least I wrote my questions and the ideas down. ;-)
I thought some more about the expansion aspects, and about having a uniform timing source or two. If I design a power and timer board, the signals from that board can then provide a reference to other boards. This way, each timer only needs to source one 'TTL load' on each of the other "controller boards".
I could pick up a small 'card cage' chassis, and some prototyping boards easily enough. Building a current-limited power supply for the 12 volts would be tougher to build. (Of course, a 9-volt supply would be even better, to keep the trains from running too fast, and would reduce the amount of heat generated by linear voltage regulator ICs. I'll have to keep this in mind.)
On each controller board, the incoming signals (such as timers) can be buffered, and the signals would be regenerated as needed to drive all of the circuits on that board, while keeping the advantages of a reference signal. (I won't have to tune separate timers to get the same 'yellow' on each board!)
The "track powered" timer would be a different frequency than the "yellow" timer. Maybe I want a wig-wag timer as well. I could put a bunch of timers on the "Timers Board", and supply each of the various timer signals only to the controller boards that would need those timing signals.
This system would allow me to add as many boards as I needed to provide track power and signal control, even for an extremely large layout. The cards could also be used in small groups. (If you used this system on a large layout, you could have a few of these systems, rather than one large one, if you prefer.)
This image shows one way these functions could be spread out. The 12-volt power supply could also be used to power multiple track Speed Controllers as well.
These pages are NOT sponsored or endorsed by the LEGO companies.
They are the creation of an enthusiast of LEGO bricks.
The official LEGO home page is www.lego.com.
(The LEGO companies have their own pages. This page is mine. :-)
K. Z. Harris, N6UOW
Questions? Comments? Additions? Email frenezulo at baylug.org
Developed on a PowerBook DUO 230!
Illustration Artwork: CLARIS DRAW Pro
Web Page Creation: CLARIS Home Page 2.0
Photo Scanning: STORM Technologies EasyPhoto
Photo Thumbnails: Adobe ImageReady 1.0