Hello everyone.
My first post here and a start to what may become a very exciting change of paced for me.
Let me explain what I am trying to achieve.
I have a stand alone DC controlled model rail layout which has an analogue shuttle controller which moves up to 3 trains between sidings each end. Each end has two sidings. The analogue controller has a programmed device which controls which polarity voltage is applied to the track and when.
It also controls the point (switch) motors to ensure the correct siding is selected. This all works well and with the exception of the point (switch) motors I do not want to change anything.
The switch motors however are not fantastic being basically solenoid operating on a push pull basis depending on which winding is activated. There is real room for improvement here. SG90 servos are being used in model railways a lot these days and this is the basis of the direct I would like to take.
LittleWicketRailway (LittleWicketRailway (Little Wicket Railway) · GitHub) has kindly written some code that does a lot of what I need to do, however it uses an external piece of software to operate the SG90 servos. The code is here: ServoControl/Servos.ino at master · LittleWicketRailway/ServoControl · GitHub
What I would like to do is replace the JMRI interface and use the input pins (Digital or Analogue) to control the activation of the appropriate servo.
The control module mentioned earlier uses a Capacitor Discharge unit to drive the existing motors. This is basically a pulse of positive going DC, say up to 12V. There are two lines per point motor plus a combined ground. So to move the point motor/solenoid in one direction it fires on line 1 (coil 1) and then to move the point back it fires on line 2 (coil 2).
I am not sure how to do the next bit, monitor the output from the controller module and set the SG90 to either of its two predetermined end stops. I realise that the inputs will have to have something like a 5V1 zener diode across to protect the input from excess voltage.
How do I translate those inputs into something useful?
Any pointers welcomed...I am very much a beginner and really need help here!
Thank you
Jon