Hi All,
I would be very grateful of some help with the following problem.
To cut a long story short I am trying to switch several model railway points motors using relays (5V coil) to supply a 14V voltage. I have momentary toggle switches (SPDT) linked to an MCP23017 port expander (and the coil of the relay) with PORTS A and B connected to both throws of the toggle switch (each toggle switch takes up two pins - one for each throw). When toggling the switch the COMMON pin on the switch passes a 5V HIGH to the Port Expander pins and sets off an interrupt to the dspic so I can identify which switch has been switched. I then use this data to send a string to another MCP23017 which lights relevant LEDs to identify which points are live (One green and One red LED for each point motor). All of this is done with I2C and seems to work fine.
The problem is that I am using a 14V power plugpack which goes straight to the relay (to supply the point motor when the 5V coil is switched) and then on to a voltage regulator to step the voltage down to 5V for the dspic etc..., however, when I switch the toggle switch the relay triggers, the point motor operates and the LEDs light very briefly but the dspic resets and it all goes horribly wrong from there .
I suspect it is either current related or to do with the linked Grounds (everything is on the same Ground). I am no Electronics expert so it might be obvious to someone who knows their stuff. To be clear the plugpack provides the 14V needed for the relay/points motors as well as the supply to the v.reg for the step down to 5V.
Any help would be much appreciated.
Thanks in advance.
I would be very grateful of some help with the following problem.
To cut a long story short I am trying to switch several model railway points motors using relays (5V coil) to supply a 14V voltage. I have momentary toggle switches (SPDT) linked to an MCP23017 port expander (and the coil of the relay) with PORTS A and B connected to both throws of the toggle switch (each toggle switch takes up two pins - one for each throw). When toggling the switch the COMMON pin on the switch passes a 5V HIGH to the Port Expander pins and sets off an interrupt to the dspic so I can identify which switch has been switched. I then use this data to send a string to another MCP23017 which lights relevant LEDs to identify which points are live (One green and One red LED for each point motor). All of this is done with I2C and seems to work fine.
The problem is that I am using a 14V power plugpack which goes straight to the relay (to supply the point motor when the 5V coil is switched) and then on to a voltage regulator to step the voltage down to 5V for the dspic etc..., however, when I switch the toggle switch the relay triggers, the point motor operates and the LEDs light very briefly but the dspic resets and it all goes horribly wrong from there .
I suspect it is either current related or to do with the linked Grounds (everything is on the same Ground). I am no Electronics expert so it might be obvious to someone who knows their stuff. To be clear the plugpack provides the 14V needed for the relay/points motors as well as the supply to the v.reg for the step down to 5V.
Any help would be much appreciated.
Thanks in advance.