In this Circuit you can see a Simple Voltage-Divider her you can get a 12 Volt to 0 Squarewave to a 5V Squarewave to 0 Squarewave most use is for a Arduino if you wanna use older Devices they are getting a 12 Volt Signal and the Arduino only Allows 5 Volt maximum as Input Voltage!!!