Codey OnlineArduino- & ESP32-componentenbibliotheek › Logic Level Shifter 8-channel
Logic Level Shifter 8-channel
Communicatie

Logic Level Shifter 8-channel

Logic level shifter met 8 kanalen om 3,3V-logica bidirectioneel naar 5V-logica om te zetten

Protocollen: I2C, SPI Breedte: 28.7 mm

Pinout — Logic Level Shifter 8-channel

Pin Signaal Beschrijving
HV1 digital High-voltage side of channel 1 — connect to the 5V device line
HV2 digital High-voltage side of channel 2 — connect to the 5V device line
HV3 digital High-voltage side of channel 3 — connect to the 5V device line
HV4 digital High-voltage side of channel 4 — connect to the 5V device line
HV power-high High-voltage supply rail for the 5V side of the shifter
GND ground Common ground reference shared by both logic domains
HV5 digital High-voltage side of channel 5 — connect to the 5V device line
HV6 digital High-voltage side of channel 6 — connect to the 5V device line
HV7 digital High-voltage side of channel 7 — connect to the 5V device line
HV8 digital High-voltage side of channel 8 — connect to the 5V device line
LV1 digital Low-voltage side of channel 1 — connect to the 3.3V MCU line
LV2 digital Low-voltage side of channel 2 — connect to the 3.3V MCU line
LV3 digital Low-voltage side of channel 3 — connect to the 3.3V MCU line
LV4 digital Low-voltage side of channel 4 — connect to the 3.3V MCU line
LV power-low Low-voltage supply rail for the 3.3V side of the shifter
GND.1 ground Common ground reference shared by both logic domains
LV5 digital Low-voltage side of channel 5 — connect to the 3.3V MCU line
LV6 digital Low-voltage side of channel 6 — connect to the 3.3V MCU line
LV7 digital Low-voltage side of channel 7 — connect to the 3.3V MCU line
LV8 digital Low-voltage side of channel 8 — connect to the 3.3V MCU line

Voorbeeld-aansluitschema — Logic Level Shifter 8-channel

Van Naar Draad
board:5V x1:HV red
board:3.3V x1:LV darkorange
board:GND x1:GND black
board:GND.1 x1:GND.1 black
board:A4 x1:LV1 green
board:A5 x1:LV2 blue
board:D4 x1:HV1 yellow
board:D5 x1:HV2 purple

Voorbeeld-Arduinocode — Logic Level Shifter 8-channel

Dit voorbeeld is geschreven en compile-gecheckt voor de arduino-uno. Codey Online past het voor je aan naar elk ander ondersteund board.

// Canonical beginner example for an 8-channel logic level shifter
// This sketch demonstrates two shifted digital channels:
// - A4/A5 on the Arduino Uno side (3.3V logic domain via LV1/LV2)
// - D4/D5 on the 5V side (via HV1/HV2)

const int LV_PIN_1 = A4;
const int LV_PIN_2 = A5;
const int HV_PIN_1 = 4;
const int HV_PIN_2 = 5;

void setup() {
  pinMode(LV_PIN_1, OUTPUT);
  pinMode(LV_PIN_2, OUTPUT);
  pinMode(HV_PIN_1, OUTPUT);
  pinMode(HV_PIN_2, OUTPUT);

  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  Serial.println("8-channel logic level shifter demo");
  Serial.println("Toggling two channels on both sides of the shifter.");
}

void loop() {
  // Step 1: set all lines LOW
  digitalWrite(LV_PIN_1, LOW);
  digitalWrite(LV_PIN_2, LOW);
  digitalWrite(HV_PIN_1, LOW);
  digitalWrite(HV_PIN_2, LOW);
  Serial.println("All channels LOW");
  delay(1000);

  // Step 2: set channel 1 HIGH
  digitalWrite(LV_PIN_1, HIGH);
  digitalWrite(HV_PIN_1, HIGH);
  Serial.println("Channel 1 HIGH: A4 <-> D4");
  delay(1000);

  // Step 3: set channel 2 HIGH
  digitalWrite(LV_PIN_2, HIGH);
  digitalWrite(HV_PIN_2, HIGH);
  Serial.println("Channel 2 HIGH: A5 <-> D5");
  delay(1000);

  // Step 4: return everything LOW
  digitalWrite(LV_PIN_1, LOW);
  digitalWrite(LV_PIN_2, LOW);
  digitalWrite(HV_PIN_1, LOW);
  digitalWrite(HV_PIN_2, LOW);
  Serial.println("All channels LOW again");
  delay(1000);
}

Vergelijkbare componenten

Logic Level Shifter 4-channel

Logic Level Shifter 4-channel

MAX485 TTL to RS485 Converter Module

MAX485 TTL to RS485 Converter Module

Bouw je Arduino- of ESP32-project met AI

Beschrijf wat je wilt bouwen. Codey Online schrijft de code, tekent het aansluitschema, compileert het en flasht je board rechtstreeks vanuit de browser.

Gratis starten