I need to communicate by serial port an Arduino with a Raspberry. I know I need to adapt the signals and I will use a level shifter as it is explained in several places.
Even though I'll use a level shifter, I'm wondering, in the case to lower the 5V signal from the Arduino to the 3.3V of the Raspberry, why it is not adequate a simple voltage divisor with two resistors or a diode led wich would lower from 5V to something like 3.3V or 3V.
I've read in some websites that a voltage divider only works in slow communications, but I don't understand why should a complex device as a BSS138 be faster than a led diode or the two resistors of the voltage divisor. Can somebody explain?
That;s because it's a balancing act between the capacity of the input (which you need to charge or discharge during data transmission and the drive capacity of the output. If you add a voltage divider you add extra resistance and reduce the drive capacity. By adding a mosfet you don't reduce the drive capacity (and probably increase it). Although I don't expect to much trouble for serial up to let's say 11520 baud or something.
For most purposes a resistor divider on the transmit side of the Arduino
Is fine .
The Arduino will see the lower voltage from the pi ok in its receive side .
Use something in 2-10k range for your resistors .