# Electronic Motorized Rotary Switch?

#### wayneh

Joined Sep 9, 2010
16,399
...from what I saw, 6VAC is bright!
You should measure that with an AC multimeter while it's under load. I suspect it will be more than 6V. Whatever voltage it is, that's all you need if you're happy with the brightness. The same voltage as DC should give you the same brightness, as #12 has noted.

It's also worth noting that 6VAC contains peaks to ~1.4X the nominal voltage, so if you rectify and add an electrolytic to smooth out ripple, with no DC load you'll see 6VAC * 1.4 - 1.4V(the diode voltage drop) = 7V DC. Confuses the heck out of noobs.

#### #12

Joined Nov 30, 2010
18,210
You might try putting a 1 ohm, 10 watt resistor in series with your 12V supply. They are at Radio Shack. That will limit the current to 12 amps for the startup. With a load of 2.5 amps, that resistor will eat up 2.5 of your volts. It's power dissipation will be 6.25 watts when the lights are on, so be sure it has room for air flow. Don't short the power supply after the resistor because it will surely smoke with 144 watts on it! Better yet, add a slow blow fuse in series with the resistor. Somewhere around 3 to 5 amps should work.

Here's a concept drawing. The diode is 1N4000 series and the capacitor is yet to be determined.

#### Attachments

• 5.9 KB Views: 22

#### John P

Joined Oct 14, 2008
1,818
PS I like the triple 555 circuit, what would a single 555 with a 4017 circuit look like?
If you look at the commercial product I linked to earlier and scroll about 3/4 of the way down the page, you'll find a circuit diagram of a 555 driving a 4017, with diode-OR logic to drive LEDs simulating a traffic light jut the way you want to run a railroad signal.

#### wayneh

Joined Sep 9, 2010
16,399
Using diodes to "OR" two or more outputs is needed if you want to hold one state for more than one clock tick, so it's needed also for the circuit I provided, since you want the vertical configuration for twice as long as the others. It's not needed for the other outputs which map 1-to-1 to the respective MOSFETs.

Using the method in that commercial device gives another way to tweak the timing (for instance, 3 clock ticks for one state, 4 for another), but it is much more limited for that than tracecom's 3-timer approach.

Tweaking the timing is moot for the simple sequence you've described so far.

#### tracecom

Joined Apr 16, 2010
3,944
So, the simplest 555 based timing circuit for what you want is one NE555, one CD4017, two signal diodes, two resistors, one electrolytic cap, and (optional, but recommended) three ceramic caps. Then, you need three MOSFET circuits, one for each of the patterns; each of those would consist of one MOSFET and two resistors.

Notice in the breadboard photo that I did not include C2 - C4, but they are highly recommended. The MOSFET circuits are not on the breadboard, but are represented by the green, yellow, and red LEDs. The blue LED shows the output of the NE555, but is not necessary for proper operation of the rest of the circuit.

#### Attachments

• 42.6 KB Views: 64
• 104.7 KB Views: 38
Last edited:

#### tracecom

Joined Apr 16, 2010
3,944
And if there is anyone who wants yet another option , here is the way I would do it. Of course, it requires programming a PIC, but it's a very simple program, and the upside is that timing and sequence changes are all done in software.

Rich (BB code):
' Name          : RR Position Signal Lights 629.pbp
' Compiler      : PICBASIC PRO Compiler 3.0
' Assembler     : MPASM
' Target PIC    : 8-pin PIC12F629
' Oscillator    : 4MHz internal
' Author        : tracecom
' Notice        : Copyright (c) 2013 Trace Communications
' Date          : 7/10/2013
' Description : Replicates railroad position signal light pattern. Green lights
' for 30 seconds, yellow lights for 15 seconds, red lights for
' 15 seconds, repeats.

Define  OSCCAL_1K  1        ' Calibrate internal oscillator.

Green var GPIO.0            ' Green Light pin
Yellow Var GPIO.1           ' Yellow Light pin
Red var GPIO.2              ' Red Light pin

mainloop:

high Green
pause 30000
low Green
High Yellow
pause 15000
low Yellow
high Red
pause 15000
low Red

Goto mainloop               ' Do it forever.

End
Note that the MOSFETs in the attached schematic are logic level, as they should be when driven with 5V. The breadboard is pretty simple.

#### Attachments

• 26.6 KB Views: 52
• 127.7 KB Views: 17
Last edited:

#### MRW1962

Joined Jun 29, 2012
18
Hi, because the lamps shut down my 12V supply and run great on the 6 VAC coming from a train transformer do you think that I should use a particular kind of power supply? One that wouldnt be prone to huge inrush currents? Maybe a 6VDC 10A supply with the 1 ohm 10 watt resistors in series with it as suggested earlier? What would you recommend? What do you think of my power supply problem?

#### tracecom

Joined Apr 16, 2010
3,944
Hi, because the lamps shut down my 12V supply and run great on the 6 VAC coming from a train transformer do you think that I should use a particular kind of power supply? One that wouldnt be prone to huge inrush currents? Maybe a 6VDC 10A supply with the 1 ohm 10 watt resistors in series with it as suggested earlier? What would you recommend? What do you think of my power supply problem?
Without knowing what the current requirement is for the lamps, or what the train transformer's current capabilty is, it's impossible to make a valid recommendation. I doubt that the lamps are actually drawing more than 12 amps, but I don't know. If the lamps are actually 12 volts at 15 watts, as you stated in your first post, then their steady state current requirement is only 1.25 amps. Thus 3 lamps in parallel only draw 3.75 amps, which is well within the capabilty of your power supply, even allowing for considerable in-rush current.

The first thing I would do is examine one of the bulbs to determine its true voltage and power ratings. Then, I would power up one of the bulbs using an appropriate power supply and measure its current draw. Then, we will know what sort of power requirements we are dealing with.

The second thing I would do is to thoroughly examine the wiring in the lamp, and draw a wiring diagram of it. At least then, we will know how the bulbs are wired, parallel, series, or something else.

With that information, we can devise a powering scheme that should work.

#### MRW1962

Joined Jun 29, 2012
18
OK, I've decided to convert the incandescent bulbs to LED bulbs. I'll bet that their power requirements are pretty low, maybe a watt or two. As soon as they arrive I'll do a test and get a measurement.

I like the design of these LED bulbs, all of the LEDs point in a line away from the base. This is great because the Signal lamp only uses light that has been reflected off a curved mirror and filtered through a collimator making the light very directional. A directional LED is perfect for this. I'm hoping that they are not TOO directional or else the bulb itself might block some of the light as it bounces off the mirror around the bulb and through the lens.

I'll check back with some power numbers....

#### MRW1962

Joined Jun 29, 2012
18
John P, you mentioned a current limiting circuit to resist the inrush current when the filament is cold. Could I use a LM317 set up to pass 2 or 3 amps on the common wire to ground? Depending on the value I set it at, I could get a nice medium brightness on the bulbs. Would such a regulator have to be heat-sinked?

#### John P

Joined Oct 14, 2008
1,818
The LM317 has a maximum rating of 1.5Amps, so it might not be enough for this purpose. It also imposes a 1.25V minimum drop on the voltage, so you have to decide if that's acceptable. As far as power is concerned, I'd guess that if you can keep the steady-state dissipation at under 0.5W, you wouldn't need a heat sink with the TO-220 package, so that would be about half an Amp if you just use it as a current limiter.

There is a neat little circuit that uses 2 transistors and which can limit current to anything you want (provided that the transistor which handles the major load is properly cooled):

In that circuit, you select Rsense so that when the maximum current flows, you generate 0.6V across it.

#### MRW1962

Joined Jun 29, 2012
18
OK, I got these tail-lamp conversion bulbs with LEDs. According to my meter, with 12V the current is 35ma (35ma seems low to me even for an LED). Strange thing is that my meter's 200ma fuse blew after a few measurements, maybe it is a coincidence. I do not like the color of these bulbs or the dispersal pattern so I may end up ordering a different type with warm white surface mount leds instead of the cheapy T-1 leds. When i have the new current figures i'll check back.

#### MRW1962

Joined Jun 29, 2012
18
Ok, the new 22 LED lamps run at 175 ma on 12 volts. So I'll need to reconfigure the circuit to match the 350 ma current I'll have with these lamps. I think that I'm going with the circuit that Tracecom submitted, but maybe a smaller MOSFET on the output. Any ideas? With these lamps I could probably run everything from a small 12 volt DC regulated power adapter.

#### tracecom

Joined Apr 16, 2010
3,944
Check the specs on BS170 MOSFETs.

#### MRW1962

Joined Jun 29, 2012
18
I have 10 of the BS170G on order, looks like they'll work perfectly. Now its just a matter of experimenting with the cap and resistor, that is how you adjust the time interval right?

#### tracecom

Joined Apr 16, 2010
3,944
I have 10 of the BS170G on order, looks like they'll work perfectly. Now its just a matter of experimenting with the cap and resistor, that is how you adjust the time interval right?
If you referring to the schematic in post 26, the timing is set by R1, R2, and C1. With the values shown, it will give you very close to the timing you asked for, i.e., 15 seconds and 30 seconds.

#### MRW1962

Joined Jun 29, 2012
18
Tracecom, Could that time interval be had using a smaller capacitor? I seem to have more 220mf and 470mf caps around.

#### tracecom

Joined Apr 16, 2010
3,944
Use two of the 470μF in parallel. Should still be close.

#### MRW1962

Joined Jun 29, 2012
18
I still dont have my BS170G's yet so I used a 2N7000 200ma mosfet i had for a test of my pcb, problem is, all the lamps light. The 4017 works correctly. So i guess i got the mosfet wired incorrectly. Because of a datasheet i saw i wired up the mosfet as Drain top, Gate middle and Source bottom (flat on left). Do i have the thing wired backwards?

#### tracecom

Joined Apr 16, 2010
3,944
It depends on whether your description is viewed from the top or the bottom of the 2N7000. Attached is a labeled drawing that is correct.

#### Attachments

• 18 KB Views: 19