here is the lock for the gates it dose not work all that well i will have to spend some more time on it
i was told about the
picaxe microchip  http://www.rev-ed.co.uk/picaxe/
 a big thanks to the man who told me about  them
 PICAXE microcontrollers are exciting, low-cost, re-programmable chips that can be used as low-cost 'brains' in many kinds of electronic project. eg my gates 
here is the new lock it still needs some more work
Here is the new layout for the power and relay   

i have put the new parts in and all  wires in place too i just have to program the picaxe
A short film of the gates in action click here for film