Jack Yes like you say 5v would be forced into the picaxe pin. i can add diodes inline with the picaxe pin to prevent 5v entering the picaxe pinsI guessed the switches were there for test purposes, however the point I was trying to make is that if any of those buttons get pushed with the picaxe connected then 5v will get forced into a picaxe output pin.
I have just removed the loads that are switched and the code runs fine so seems to point to back emf issues from the electromagnet and possibly the motor actuator, not sure how to deal with this, maybe to opto isolate the inputs to the transistors to remove any path back, there can be a complete break including the GND terminal, because both loads are being reversed maybe only varisters are suitable, but won't work as well as a diode.
I haven't checked the voltage at the pendulum switch yet but i did take the 5v from the regulator to the +v of the pendulum switch, when i first built the board it was 12v and i got thinking thats not right so adapted it.
On the plans from Richard i did see that he had amended the plans to include a varistor on the elctromagnet, i guess he has similar issues with it causing an issue with the plc
Back to back 15V zeners at 1W looks to be the best way to sort emf issue or atleast i will give it a go
I have re-connected the electromagnet and code runs fine, tried it several times, all good, so it seems its the the actuator that is causing the problems, connected a varistor to the actuator terminals and so far its running correctly, so must be back emf problems and now is the time to find them