Maker Pro
Maker Pro

Drive model railraod turnout?

French_guy

Oct 26, 2012
5
Joined
Oct 26, 2012
Messages
5
Hello

I would like to drive Kato Unitrack N scale turnouts from a microcontroller
They are based on 1 unique coil: a pulse of 12V will activate it, and the same pulse but reversed will activate it the other way
The usual way is t use a momentary DPDT switch

But how can I do that with only 1 micro output (1 or 0)?

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
A circuit like this could be used:
attachment.php

You will haveto tweak the components, this is only a quick and dirty simulation. You will need an additional level-shifter (Google) from the µC's output (3.3V or 5V) to the 12 V used in the circuit.

The coils is placed at the position of R1 (R1 used for simulation only).
The µC-Signal ("in" in the schematic, here already level-shifted to 0V...12V) is either at 0V or 12V. If at 0V, Q2 is conducting, if at 12V, Q1 is conducting. In the steady state either C1 or C2 is fully charged and no current flows through R1 (your coil).

The circuit operates as follows:

Assume Vin=0V: Q2 is fully conducting, C2 is fully charged. When the input now changes to Vin=12V, Q2 is turned off, Q1 is turned on. C2 will discharge through R1 and Q1. This produces a negative current pulse in this setup.

Assume Vin=12V: Q1 is fully conducting, C1 is fully charged. When the input now changes to Vin=0V, Q1 is turned off, Q2 is turned on. C1 will discharge through R1 and Q2. This produces a positive current pulse in this setup.
 

Attachments

  • Unitrack.gif
    Unitrack.gif
    35.3 KB · Views: 257

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
This circuit inludes the level shifter:
attachment.php
 

Attachments

  • Unitrack_2.gif
    Unitrack_2.gif
    14 KB · Views: 263

French_guy

Oct 26, 2012
5
Joined
Oct 26, 2012
Messages
5
Thanks a lot
C1 and C2 are not the same value?
I will send pulse to change the microcontroller's output.....But how do I make sure that the coil NEVER receive 12V for too long (for output=0 or 1)
The voltage on the coil will only last the time to discharge the capacitor?

I would not want to destroy those turnouts, they are expensive !!!!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
C1 and C2 are the same value. The difference in the schematic comes from some uncorrected experimenting on my part.
You may try this circuit even without either C1 or C2, one Capacitor could suffice. That depends, among other factors, on the characteristics of the drive.

The circuit only generates pulse, see the green line in my simulation. The pulses are ~50ms long. Chances are that if you actuate the drive manually the pulse will be considerably longer.
 

French_guy

Oct 26, 2012
5
Joined
Oct 26, 2012
Messages
5
So what is the good value for C1 and C2: is it 10 microF or 100 microF
If I need longuer pulse, I will have to play with the value of C1 and C2?

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
Try it.
As I said: without knowing the characteristics of the coil of the driver it is hard to decide which capacitor to use.
 

French_guy

Oct 26, 2012
5
Joined
Oct 26, 2012
Messages
5
A circuit like this could be used:
attachment.php

You will haveto tweak the components, this is only a quick and dirty simulation. You will need an additional level-shifter (Google) from the µC's output (3.3V or 5V) to the 12 V used in the circuit.

The coils is placed at the position of R1 (R1 used for simulation only).
The µC-Signal ("in" in the schematic, here already level-shifted to 0V...12V) is either at 0V or 12V. If at 0V, Q2 is conducting, if at 12V, Q1 is conducting. In the steady state either C1 or C2 is fully charged and no current flows through R1 (your coil).

The circuit operates as follows:

Assume Vin=0V: Q2 is fully conducting, C2 is fully charged. When the input now changes to Vin=12V, Q2 is turned off, Q1 is turned on. C2 will discharge through R1 and Q1. This produces a negative current pulse in this setup.

Assume Vin=12V: Q1 is fully conducting, C1 is fully charged. When the input now changes to Vin=0V, Q1 is turned off, Q2 is turned on. C1 will discharge through R1 and Q2. This produces a positive current pulse in this setup.

Looking at the graph... does that mean there will be a permanent average of 6v on the coil?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
No.

The green graph is the current (I(R1), see the legend on top. The current is graphed on the right y-axis in Milliamperes with 0mA in the center. Since the coil is current-drivem I haven't graphed the voltage across the coil. From V=L*di/dt it can easily be seen that after a few milliseconds di/dt is approx. 0mA/s and therefore U=0, too.

The blue graph is the input voltage graphed on the left y-axis in Volts.
 

French_guy

Oct 26, 2012
5
Joined
Oct 26, 2012
Messages
5
oops, sorry
I am not that good with analog circuits, I prefer by far digital :)

Thanks
 
Top