Replacing single pole double throw switches

Hello.

I've got a model railway with 4 points on it which are operated by bi-directional solenoids. These are at the moment operated manually by 4 Single Pole Double Throw toggle switches. Each pole on a switch is a changes to a different state for the point. They run on 12v which may be another issue.

Now I'd really like my Arduino to be able to control them. I know I could create some circuit with a transitor to swtich one on when a pin is at HIGH etc. But i'd have to create 8 of these which seems a cumbersome method and would use up lots of pins.

Is there a microchip that will do this over a serial connection somehow? Or any quick method to get around it.

You'll need transistors or similar driver parts which can conduct the quite large currents involved, and you'll need protection diodes, too. As for the need to drive 8 of them, have a look at the example ciruits using the 74LS595 chip.

But surely, if you need to control just 4 points, you could use just 4 I/O pins and use inverters to drive the transistor on the "other" side of the solenoid?

Ah thanks for your help.

You make a good point with the inverter.

I'm already controlling the trains speed with a TIP120 transistor circuit that I found here: http://pcbo.dcs.aber.ac.uk/blog/wp-content/uploads/2008/01/controller-circuit.png

So I guess I can make something similar with an inverter and 4 pins.

Yes, that circuit, or something like it, would probably be OK for a point solenoid. Are you sure that the switches are SPDT and not "passing contact" types? It's been a long time since I did any work on model railways! I suppose there is a switch in the point solenoid itself to cut off the current when the point solenoid has reached the end of its travel.

For the inverter, try the 74LS04.

The switches don;t stay connected no. They reset back to neutral state in the middle. And the solenoids keep going while the current is applied. So i guess they dont have a switch. All i need to do is apply a current for a second or so to either end of the solenoid.

Those are called "centre-off momentary" SPDT switches. Ah, in that case, then you can't use the inverter idea. You will need eight digital I/O pins to control four point motors. Although, maybe you could come up with a circuit that would energise the solenoids for only a second after the I/O pin changes state. Trouble is, that will need extra hardware, so it might be easier to do it in software even if that does use more I/O pins. It's one of those hardware/software trade-offs.