I've been having issues with a lot of noise on the inputs of my arduino controller. It controls the switching of electric gate opener. It's my little project I've been working on for a while. The problem was that sometimes (most of the time

) when the motor turned on it created some noise on the controller inputs which made it switch off the motor. The issue was that I only used pulldown resistor and a capacitor at the inputs as wanted to save I few euros on production cost. Anyway i decided to redesign the whole thing and also make it more universal this time.

Originally it used 5V input connected right to Arduino. Now I used 12V input and 6N137 optocoupler. That gave me input voltage from 6,4V up to 20V. For the outputs I'm using just simple relays switched by npn transistor. Now it's working nicely as it should. I was worried it would be too expensive but it costs just about 20€ for one complete board.
Schematic and board are in attachements. What do you think?
Ideas for later improvement will be appreciated.
Here are the EAGLE files if anybodys interested:
https://mega.nz/folder/5RpFRD4A#gl7PvyP2cFege6wbkLXDXA