Konwerter poziomów logicznych 8-kanałowy do dwukierunkowej konwersji logiki 3,3V na 5V
| Pin | Sygnał | Opis |
|---|---|---|
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 |
| Z | Do | Przewód |
|---|---|---|
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 |
Ten przykład został napisany i sprawdzony kompilacją dla arduino-uno. Codey Online dostosuje go do każdej innej obsługiwanej płytki.
// 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);
}
Opisz, co chcesz zbudować. Codey Online napisze kod, narysuje schemat połączeń, skompiluje projekt i wgra go na płytkę bezpośrednio z przeglądarki.
Zacznij za darmo