Last Updated on 15. Oktober 2026 by sfambachLink-Status: OK
Motorplatine zur Ansteuerung von zwei Motoren (6,6 V – 38 V) über den I²C-Bus
Zum D1 mini ESP8266 und ESP 32 gehts hier lang:
- Preview – W600-Pico V1.0.0 1MB FlashLink-Status: OK
- (Wemos) C3 MiniLink-Status: OK
- (Wemos) D1 ESP32Link-Status: OK
- Wemos D1 Mini Pro (V1.1.0)Link-Status: OK
- Wemos D1 MiniLink-Status: OK
Fakten
- Versorgungsspannung 6,6V – 38 V
- Maximaler Dauerstrom 2A (kurzzeitig bis zu 3,6A)
- Steuerung Vorwärts/Rückwärts (Geschwindigkeit), Stopp/Bremsen
| Beschreibung | Name | Pin |
|---|---|---|
| I²C Takt | SCL | 5 (D1) |
| I²C Daten | SDA | 4 (D2) |
| Motor A Anschluss 1 | 1A | |
| Motor A Anschluss 2 | 2A | |
| Motor B Anschluss 1 | 1B | |
| Motor B Anschluss 2 | 2B | |
| Externe Spannung | VM(6,5 -38V) | VM |
| Externe Spannung GND | GND | GND |
| Default I²C Adresse | 0x30 | |
SchaltplanLink-Status: OK
Kompatibilität
| D1 Typ | Kompatibel | Begründung, wenn nicht |
|---|---|---|
| D1 mini | Ja | |
| D1 mini Pro | Ja | Nicht getestet |
| D1 mini Lite | Ja | Nicht getestet |
| D1 32 | Ja | |
S2 mini | Ja | Nicht getestet |
| C3 | Ja | Nicht getestet |
Anwendungsbereiche
- Ferngesteuerte Autos
- Selbstfahrende Roboter
- Arme mit zwei Freiheitsgraden
- Betreiben eines Schrittmotors
Ansichten



Programmierung
Bibliotheken
Arduino ESP32 Bibliothek V2.0.3-RC1
Arduino ESP8266 Bibliothek V3.0.2
https://github.com/wemos/LOLIN_I2C_MOTOR_LibraryLink-Status: OK
Testprogramm
Quellcode MotorTest.ino (GitHubLink-Status: OK)
/* Testprogramm for D1 motor shields
Step 1: Motor A Forward -> increase Speed -> decrease speed
Step 2: Motor B Forward -> increase Speed -> decrease speed
Step 3: Motor A&B Forward -> increase Speed -> decrease speed
Lib:
https://github.com/wemos/LOLIN_I2C_MOTOR_Library
Inspired by the examples of the library
Created by S. Fambach
Visit http://www.fambach.net if you want
*/
#include <Wire.h>
// get the motor lib and get an object
#include "LOLIN_I2C_MOTOR.h"
LOLIN_I2C_MOTOR motor; //I2C address 0x30
void setup()
{
Wire.begin();
Serial.begin(115200);
Serial.println(F("Init Motor Shield..."));
while (motor.PRODUCT_ID != PRODUCT_ID_I2C_MOTOR) //wait motor shield ready.
{
motor.getInfo();
}
Serial.println(F("... Success"));
}
void loop()
{
// M1 forward test ********************************************************
Serial.print(F("MA forward Test .."));
motor.changeStatus(MOTOR_CH_A, MOTOR_STATUS_CW);
motor.changeFreq(MOTOR_CH_A, 20000);
motor.changeStatus(MOTOR_CH_B, MOTOR_STATUS_STOP);
Serial.print(F(".. increase speed .."));
for (int i = 0; i < 100; i++) {
motor.changeDuty(MOTOR_CH_A, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
Serial.print(F(".. decrease speed .."));
for (int i = 100; i > 0; i--) {
motor.changeDuty(MOTOR_CH_A, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
motor.changeDuty(MOTOR_CH_A, 0);
Serial.println(F(".. Finished"));
// motor.changeStatus(MOTOR_CH_A,MOTOR_STATUS_STOP);
// M1 backward test ********************************************************
Serial.print(F("MA Backward Test .."));
motor.changeStatus(MOTOR_CH_A, MOTOR_STATUS_CCW);
motor.changeFreq(MOTOR_CH_A, 20000);
motor.changeStatus(MOTOR_CH_B, MOTOR_STATUS_STOP);
Serial.print(F(".. increase speed .."));
for (int i = 0; i < 100; i++) {
motor.changeDuty(MOTOR_CH_A, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
Serial.print(F(".. decrease speed .."));
for (int i = 100; i > 0; i--) {
motor.changeDuty(MOTOR_CH_A, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
motor.changeDuty(MOTOR_CH_A, 0);
Serial.println(F(".. Finished"));
motor.changeStatus(MOTOR_CH_A, MOTOR_STATUS_STOP);
// M2 forward test ********************************************************
Serial.print(F("MB forward Test .."));
motor.changeStatus(MOTOR_CH_B, MOTOR_STATUS_CW);
motor.changeFreq(MOTOR_CH_B, 20000);
motor.changeStatus(MOTOR_CH_A, MOTOR_STATUS_STOP);
Serial.print(F(".. increase speed .."));
for (int i = 0; i < 100; i++) {
motor.changeDuty(MOTOR_CH_B, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
Serial.print(F(".. decrease speed .."));
for (int i = 100; i > 0; i--) {
motor.changeDuty(MOTOR_CH_B, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
motor.changeDuty(MOTOR_CH_B, 0);
Serial.println(F(".. Finished"));
// M2 Backward test ********************************************************
Serial.print(F("MB backward Test .."));
motor.changeStatus(MOTOR_CH_B, MOTOR_STATUS_CCW);
motor.changeFreq(MOTOR_CH_B, 20000);
motor.changeStatus(MOTOR_CH_A, MOTOR_STATUS_STOP);
Serial.print(F(".. increase speed .."));
for (int i = 0; i < 100; i++) {
motor.changeDuty(MOTOR_CH_B, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
Serial.print(F(".. decrease speed .."));
for (int i = 100; i > 0; i--) {
motor.changeDuty(MOTOR_CH_B, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
motor.changeDuty(MOTOR_CH_B, 0);
Serial.println(F(".. Finished"));
// test both motors ********************************************************
// forward test
Serial.print(F("Both forward Test .."));
motor.changeStatus(MOTOR_CH_BOTH, MOTOR_STATUS_CW);
motor.changeFreq(MOTOR_CH_BOTH, 20000);
//
Serial.print(F(".. increase speed .."));
for (int i = 0; i < 100; i++) {
motor.changeDuty(MOTOR_CH_BOTH, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
Serial.print(F(".. decrease speed .."));
for (int i = 100; i > 0; i--) {
motor.changeDuty(MOTOR_CH_BOTH, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
motor.changeDuty(MOTOR_CH_BOTH, 0);
Serial.println(F(".. Finished"));
// Backward test ********************************************************
Serial.print(F("Both backward Test .."));
motor.changeStatus(MOTOR_CH_BOTH, MOTOR_STATUS_CCW);
motor.changeFreq(MOTOR_CH_BOTH, 20000);
Serial.print(F(".. increase speed .."));
for (int i = 0; i < 100; i++) {
motor.changeDuty(MOTOR_CH_BOTH, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
Serial.print(F(".. decrease speed .."));
for (int i = 100; i > 0; i--) {
motor.changeDuty(MOTOR_CH_BOTH, i);
if ( (i % 10) == 0 ) {
Serial.print(".");
}
delay(200);
}
motor.changeDuty(MOTOR_CH_BOTH, 0);
Serial.println(F(".. Finished"));
/********************************************************/
motor.changeStatus(MOTOR_CH_BOTH, MOTOR_STATUS_STOP);
delay(2000);
// stop
}
So siehts auf der Konsole aus:

Probleme
—
Fazit
Kann zwei Motoren über den I²C-Bus bedienen, was will man mehr?
Weitere Beiträge
Andere Shields
- D1 Mini Shield – Prototyp-PlatineLink-Status: OK
- D1 Mini Shield – RGB LED (Einzeln)Link-Status: OK
- D1 Mini Shield – RGB LEDLink-Status: OK
- D1 Mini Shield – PIR (Bewegungssensor)Link-Status: OK
- D1 Mini Shield – HR8833 MotorLink-Status: OK
- D1 Mini Shield – SG30 LuftqualitätsmessungLink-Status: OK
- D1 Mini Shield – I2C ConnectorLink-Status: OK
- D1 Mini Shield – Matrix LED ShieldLink-Status: OK
- D1 Mini Shield – Oled 64×48Link-Status: OK
- D1 Mini Shield – Buzzer (Pipser)Link-Status: OK
Mehr ESPs
- Rundes 1,28″-TFT GC9A01 an ESP8266, ESP32 und ESP32-C3Link-Status: OK
- October Check 2026 – Neue Mikrocontroller und BoardsLink-Status: OK
- Ulanzi TC001 Smart Pixel ClockLink-Status: OK
- ESP WEB Serial BibliothekLink-Status: OK
- ESP32-C3 seeed studio xiaoLink-Status: OK
- ESP32-C3 Super Mini BoardLink-Status: OK
- Preview – LuatOs ESP32-C3 BoardLink-Status: OK
- ESP32 BlueTooth GamepadLink-Status: OK
- ESP01 – DHT11 Temperatur und Feuchte Sensor PlatinenLink-Status: OK
- ESP01 Relais PlatinenLink-Status: OK
Quellen
Quellen zum Shield
HLink-Status: OKerstellerseiteLink-Status: OK
Quellen zu den Boards
HerstellerseiteLink-Status: OK
SchaltplanLink-Status: OK
CH340 USB TreiberLink-Status: OK
https://arduino-projekte.info/wemos-d1-mini/Link-Status: Unbekannt
https://www.exp-tech.de/plattformen/esp8266/entwicklungsboards/8898/wemos-d1-miniLink-Status: Kaputt
| Datum | Änderung | Autor |
|---|---|---|
| 15.10.2026 | Beispielcode als Code-Block eingefügt (Einbettung über gist-it.appspot.com funktionierte nicht mehr) | sfambach |
| 08.10.2026 | Überschriften-Hierarchie korrigiert (H1→H2, Unterebenen eine Stufe tiefer) | sfambach |
| 04.10.2026 | Rechtschreibung korrigiert: Tippfehler, Groß-/Kleinschreibung, Kommas | sfambach |
| 03.10.2026 | Log-Liste eingefügt | sfambach |
| 15.04.2022 | Beitrag erstellt | sfambach |
Haben Sie ein Codebeispiel zum Antreiben eines Schrittmotors mit AT8870?
Ich kann es mit LOLIN_I2C_MOTOR nicht zum Laufen bringen.