D1 Mini Shield – HR8833 Motor

Last Updated on 15. October 2026 by SuffocationLink status: OK

Zusatzplatine zum D1 Mini, kompatibel mit Treiber für zwei Motoren.

For the D1 mini ESP8266 and ESP32, go here:

Facts

  • 2 Motoranschlüsse (3-10 V)
  • Strom 1.5 A /2.5A kurzzeitige Spitze
  • Ansteuerung über I²C Bus
DescriptionNamePin
I²C ClockSCL5 (D1)
I²C DataSeventh-day Adventist4 (D2)
Motor A Anschluss 11A
Motor A Anschluss 22A
Motor B Anschluss 11B
Motor B Anschluss 22B
Externe SpannungVM(3 -10V)VM
Externe Spannung GNDGroundGround
I²C Adresse0x30
D1 Mini Shield -HR8833 Motor – Anschlüsse

SchematicLink status: OK

Compatibility

D1 TypeCompatibleBegründung, wenn nicht
D1 miniYes
D1 mini ProYesUntested
D1 mini LiteYesUntested
D1 32Yes


S2 mini
YesUntested
C3YesUntested
Kompatibilität zu den D1 Boards

Areas of application

  • Ferngesteuerte Autos
  • Selbstfahrende Roboter
  • Arme mit zwei Freiheitsgraden
  • Betreiben eines Schrittmotors

Views

D1 Mini Shield -HR8833 Motor – Verbunden

Programming

Libraries

Arduino ESP32 Library V2.0.2

Arduino ESP8266 Bibliothek V3.0.3-RC1

https://github.com/wemos/LOLIN_I2C_MOTOR_LibraryLink status: OK

Test programme

Source code 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:

Problems

—

Conclusion

Kann zwei Motoren über den I²C-Bus bedienen, was will man mehr?

More posts

Other Shields

More ESPs

Sources

Sources for the Shield

Manufacturer's websiteLink status: OK

Sources for the boards

Manufacturer's websiteLink status: OK

SchematicLink status: OK

CH340 USB DriverLink status: OK

https://arduino-projekte.info/wemos-d1-mini/Link status: OK

https://www.exp-tech.de/plattformen/esp8266/entwicklungsboards/8898/wemos-d1-miniLink status: Broken

https://www.wemos.cc/en/latest/d1_mini_shield/hr8833_motor.htmlLink status: OK

DateChangeAuthor
15.10.2026Beispielcode als Code-Block eingefügt (Einbettung über gist-it.appspot.com funktionierte nicht mehr)Suffocation
08.10.2026Überschriften-Hierarchie korrigiert (H1→H2, Unterebenen eine Stufe tiefer)Suffocation
04.10.2026Rechtschreibung korrigiert: Tippfehler, Groß-/Kleinschreibung, KommasSuffocation
03.10.2026Log-Liste eingefügtSuffocation
16.04.2022Post createdSuffocation
Changelog

4 thoughts on “D1 Mini Shield – HR8833 Motor”

  1. Hello Stefan,
    tolle Beschreibung. Du sagst, dass am HR8833 ein stepper betrieben werden kann. Das bekomme ich nicht hin. Ich habe einen 2 Phasen, 4 Draht Stepper an A 1/2 und B 1/2 angeschlossen und bekomme den nicht ans laufen. D1 mini, D1 mini Shield HR8833, geht das mit der LOLIN_I2C_MOTOR_Library?

    1. Hallo Tommes, die Antwort wird dir nicht gefallen, entweder du bekommst es mit den Befehlen in der LIB hin den Stepper anzusprechen (sehr unwahrscheinlich) oder du schaust welche Firmware der STC8H1K08 hat. Entweder sie unterstützt den Schrittmotor oder du müsstest eine neue Firmware schreiben. Da mir dies alles doch sehr aufwändig erscheint habe ich den Schrittmotorbetrieb mal durchgestrichen. Ich bin ehrlich gesagt davon ausgegangen das hier ein Std. IC für die I2C Anbindung verbaut ist. Auch hier auf der Seite konnte ich keine weiteren Infos finden. https://www.wemos.cc/en/latest/d1_mini_shield/hr8833_motor.html. Sorry war offensichtlich wohl eine Fehlinformation. Gruß Stefan

  2. Hallo, mal eine Frage. Ich verwende einen D1-Mini und hab das HR8833 Motorshield draufgesteckt. alles läuft gut. Statt des 2ten Motors möchte ich einen Servo am Pin2 oder einem anderen geeigneten Pin betreiben.
    Ein guter link mit einem Beispielscript würde mir sehr weiterhelfen.

Leave a Reply

Your email address will not be published. Required fields are marked *