State Machine Design for Low Cost Automation