Raspberry Pi is not "that" reliable for production.
Arduino is much better and definitely much more reliable. You can do it with maybe a hundred lines of code at most and it has libraries to do interface with a ton of hardware. Plus once you prototype it on a Mega or Uno it cheap to programme, new stand alone boards on cheap 2 layer PCB (I recommend seeedstudio, cheap PCB's)
You can THEN use the Pi to talk to the Arduino via UART or SPI and host a web page if you want. Pi sounds good but long term, you will face allot of unexpected problems :(#
Micro Controllers, they used every where! Fridges, microwaves, heating systems, cars, bikes, some toasters, PC's, Macintosh, iPhone, Android, Nokia 3310, Nokia Lumia, Raspberry Pi HD camera, tvs / monitors, health equipment like cardio vascular implants, Everywhere!
Even in the BCM Processor, a version of a MCU kicks of the "System On Chip". The BIOS on motherboards is initialised by proprietary MCU's to kick off the OS on the PC. Has any of that ever concerned you? Has it crashed? needed updates? Nope.
Processors are required today run operating systems that need more processing power and flexibility, like on the Pi or Smart TV's and iphones/android. They are prone to heartblead, malware, viruses, corruption, ram failure, bla bla bla.
Dont get me wrong. I love the Pi as small computer thing. It would make a great front end for 10 of these devices the OP builds with MCU's.
Arduino happens to be very mature, popular, and compatible with crap loads of hardware (code wise) is cheaper and is definitely MORE reliable in doing the same thing over for 10 years without failing, than the Pi doing the same without some interruptions and wont last 3 months.
Sure, Micro controllers like atTiny or atMega are 8mhz or 16mhz and cannot decompress a JPEG. But that is not required. There are newer MCU hybrids with 32mhz - 96mhz frequencies if you needed to analyse a bitmap a zillion times over without getting a blue screen or hacked by heartbleed.
I talk from experience and the fact that MCU are so transparent in our lives today is because they just work. I am NOT trying to sell more Arduino's or PIC's and defer people away from the Pi. I want poeple to buy more Pi's and buy my book about Pi's.
But the PI is just not the solution to the OP's problem and even if he got there he would regret using the Pi. I am not going to pretend like a it is by providing him false hopes and maybe answers. And as it turns outs the OP knows exactly what he wants to do he just started on the wrong Q&A.