Cheap and good way to feed 12v digital input

The caps would be very bad for serial communication... the 7805 will work up to a certain frequency but then it simply can't switch between 0 and 5v fast enough killing the serial data...

Change the 2 zener resistors for 10k to keep the current down.