Codey OnlineBibliothèque de composants Arduino & ESP32 › Logic Level Shifter 8-channel
Logic Level Shifter 8-channel
Communication

Logic Level Shifter 8-channel

Convertisseur de niveau logique 8 canaux pour convertir de la logique 3,3V vers de la logique 5V, bidirectionnel

Protocoles: I2C, SPI Largeur: 28.7 mm

Brochage — Logic Level Shifter 8-channel

Broche Signal Description
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

Exemple de schéma de câblage — Logic Level Shifter 8-channel

De Vers Fil
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

Exemple de code Arduino — Logic Level Shifter 8-channel

Cet exemple a été écrit et vérifié à la compilation pour le arduino-uno. Codey Online l'adapte pour vous à toute autre carte prise en charge.

// 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);
}

Composants similaires

Logic Level Shifter 4-channel

Logic Level Shifter 4-channel

MAX485 TTL to RS485 Converter Module

MAX485 TTL to RS485 Converter Module

Construisez votre projet Arduino ou ESP32 avec l'IA

Décrivez ce que vous voulez créer. Codey Online écrit le code, dessine le schéma de câblage, le compile et flashe votre carte directement depuis le navigateur.

Commencez gratuitement