Very impressive !. A PLC would have been my starting point but that's just me, there are many ways to achieve the same end result.