Connect with us

Drive model railraod turnout?

Discussion in 'Microcontrollers, Programming and IoT' started by French_guy, Oct 26, 2012.

  1. French_guy

    French_guy

    5
    0
    Oct 26, 2012
    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
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    9,280
    1,881
    Nov 17, 2011
    A circuit like this could be used:
    [​IMG]
    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.
     

    Attached Files:

  3. Harald Kapp

    Harald Kapp Moderator Moderator

    9,280
    1,881
    Nov 17, 2011
    This circuit inludes the level shifter:
    [​IMG]
     

    Attached Files:

  4. French_guy

    French_guy

    5
    0
    Oct 26, 2012
    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 !!!!
     
  5. Harald Kapp

    Harald Kapp Moderator Moderator

    9,280
    1,881
    Nov 17, 2011
    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.
     
  6. French_guy

    French_guy

    5
    0
    Oct 26, 2012
    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
     
  7. Harald Kapp

    Harald Kapp Moderator Moderator

    9,280
    1,881
    Nov 17, 2011
    Try it.
    As I said: without knowing the characteristics of the coil of the driver it is hard to decide which capacitor to use.
     
  8. French_guy

    French_guy

    5
    0
    Oct 26, 2012
    Looking at the graph... does that mean there will be a permanent average of 6v on the coil?
     
  9. Harald Kapp

    Harald Kapp Moderator Moderator

    9,280
    1,881
    Nov 17, 2011
    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.
     
  10. French_guy

    French_guy

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

    Thanks
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-