Input signal conversion


I need some advice to convert an input signal.

The input signal is a 0-12V (more or less 12V, it's an automobile device), square wave (more or less too) I need to convert it to 0-5V with a good square wave.

Of course the goal is to have it connected to an arduino device.

What is the best way to do this ?

Thank you :)

Best way, don't know. One way is to feed the signal to a voltage divider that will output no more than 5V with the maximum input voltage. If the signal is not clean enough, feed it to a 74HC14 Hex Inverting Schmitt Trigger IC schmitt trigger data sheet then to the Arduino input. The Schmitt trigger will square (clean) up the signal. You might also want to look into input protection for automotive circuits. It is a popular topic on the forum.

I wonder if there is an easiest way to do this.

My goal is to have the smallest footprint possible.

Maybe with a simple transistor ? (I'm not good with analog signal)

You can do it with 1 resistor, R >= (12- 5) / 1 mA = 7 kOHm. Choose 10- 100 k. Atmel’s uCPU is well protected on all inputs, at least for 10 years life span