LGB Rail Turnout + L298N + Arduino

Hello,
I want to test that I can switch the LGB Turnout with an Arduino and a motor driver L298N. this is just a test but for the moment it is a fail. With a DC motor everything is ok but when I wire the LGB Turnout to the L298N I am hearing a kind of whistle like a ultrasound. This is a LGB 12010 turnout motor 14V-20V.
Does somebody has a idea? Thanks

const int motor1pin1 = 2;
const int motor1pin2 = 3;
const int enablePin=9;


void setup() {
  // put your setup code here, to run once:
  pinMode(motor1pin1, OUTPUT);
  pinMode(motor1pin2, OUTPUT);


  //(Optional)
  pinMode(9, OUTPUT); 
  //(Optional)
  digitalWrite(enablePin,LOW);
}

void loop() {
  // put your main code here, to run repeatedly:

  //Controlling speed (0 = off and 255 = max speed):     
  //(Optional)
 analogWrite(enablePin,100); //ENA pin
  //(Optional)
  
  digitalWrite(motor1pin1, HIGH);
  digitalWrite(motor1pin2, LOW);
  delay(110);
  digitalWrite(motor1pin1, LOW);
  digitalWrite(motor1pin2, LOW);

  delay(5000);
  
  digitalWrite(motor1pin1, LOW);
  digitalWrite(motor1pin2, HIGH);
  delay(110);
  digitalWrite(motor1pin1, LOW);
  digitalWrite(motor1pin2, LOW);

  
  delay(10000);
}

This may be the problem. I don't know what the turnout does if it is supplied less than 14V. Does it just move slowly?
By using the speed control, you are effectively supplying the Turnout only 14 * 100/256 volts.

The ancient technology L298 will drop 2V to over 4V (depending on current draw) by itself and dissipate that power as heat. So with 14V provided, your turnout is seeing 12V at best. Modern MOSFET output motor drivers are much more efficient. Pololu has a good line of modern DC motor drivers.

it works!!!!
255 instead of 100
Thanks

1 Like

yes I am waiting for a pololu DRV8876
thanks!!!

That is a good little motor driver. I use a couple of them.

I looked for specifications for the LGB Turnout, but that term is not specific enough. Do you know the stall current of motor in that device? The motor will draw the stall current, briefly, every time that the motor starts. The motor driver must be able to gracefully handle that current surge.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.