Robotics projects often combine parts that use different digital logic voltages, such as a 3.3 V microcontroller and a 5 V motor controller, sensor, or actuator board. A logic level shifter lets these devices exchange digital signals safely. It matters because a 5 V signal connected directly to a 3.3 V input can damage the smaller device or make it behave unpredictably.
Level shifting is a simple way to protect pins while keeping communication reliable.
A bidirectional logic level shifter translates signals in both directions, so either side can send data when the communication bus allows it. Many common modules use MOSFETs and pull-up resistors to shift open-drain signals such as I2C between low-voltage and high-voltage systems. The low-voltage side connects to the 3.3 V supply and ground, while the high-voltage side connects to the 5 V supply and the same ground reference.
When wired correctly, a logic 0 stays near 0 V and a logic 1 rises to the correct voltage for each side.
Key Facts
- A logic level shifter translates digital signals between different voltage standards, such as 3.3 V and 5 V.
- For safe communication, both devices must share a common ground: GND_low = GND_high.
- Logic low is usually near 0 V on both sides: V_low ≈ 0 V.
- Logic high becomes the supply voltage for each side: high on LV side ≈ 3.3 V and high on HV side ≈ 5 V.
- Ohm's law helps choose pull-up currents: I = V/R.
- A MOSFET bidirectional shifter works well for open-drain buses such as I2C, but it may not be ideal for fast push-pull signals without checking the data rate.
Vocabulary
- Logic Level
- A logic level is the voltage range a digital circuit interprets as a 0 or a 1.
- Level Shifter
- A level shifter is a circuit that converts a digital signal from one voltage range to another.
- Bidirectional
- Bidirectional means a signal can be translated in both directions between two connected circuits.
- Pull-up Resistor
- A pull-up resistor connects a signal line to a positive supply so the line becomes logic high when no device pulls it low.
- MOSFET
- A MOSFET is a transistor often used as an electronic switch in logic level shifting circuits.
Common Mistakes to Avoid
- Connecting a 5 V output directly to a 3.3 V input, because the input pin may receive more voltage than it is rated to handle and can be permanently damaged.
- Forgetting the common ground connection, because voltage signals only have meaning when both circuits share the same reference point.
- Putting the low-voltage supply on the high-voltage side, because the shifter labels LV and HV must match the actual 3.3 V and 5 V rails for correct translation.
- Using any level shifter for any signal speed, because some MOSFET and resistor modules are too slow for high-frequency SPI, PWM, or fast serial signals.
Practice Questions
- 1 A 3.3 V microcontroller must read a digital signal from a 5 V sensor output. What device should be placed between them, and which side should connect to the microcontroller?
- 2 A level shifter uses a 10 kΩ pull-up resistor to 5 V on the high-voltage side. Use I = V/R to calculate the pull-up current when the line is pulled low.
- 3 Explain why a robot with a 3.3 V controller and a 5 V actuator board may work for a short time without a level shifter but still be unsafe as a design.