Connect with us

Trouble with PIC and Relay controlled model train point motors PART II

Discussion in 'Microcontrollers, Programming and IoT' started by AimSkyward, Feb 16, 2013.

Scroll to continue with content
  1. AimSkyward


    Jan 28, 2013
    Hi All,

    Some time ago I posted a thread regarding a problem I am having when using a dspic30f4011 to control a Hornby Point Motor.
    To summarise I ultimately have to control a number of points motors using momentary toggle switches with corresponding LED indicators to show which tracks are live and which are not. I am using four Port Expanders with the dspic using I2C. Two of the Port Expanders read the toggle switch inputs and two output the corresponding LED pattern.
    I am using relays to switch 14V through to the points motors with a standard 5V coil voltage connected to the COMMON pin of the SPDT toggle switch. When switched the 5V signal is passed to the input of the Port Expander as well as the relay coil so I can determine which switch has been activated.
    I have put a diode across the coil to eliminate back emf (kindly pointed out thanks to my previous post) but I am still having the problem of the program halting whenever the points motor is switched. When I remove the motor and run the program when only the relay itself is being operated everything works fine so I am wondering what could be the reason.
    I am using separate supplies for the 5V which supplies the main board and relay coil and the 14V for switching the points motor.
    Any help would be much appreciated as I have been stuck with this for some time :).

    Thanks in advance for your help
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