WeMos D1 R32 + EX8874¶
Refer to Complex Build - ESP32 for a general overview.
The information below may help explain how to overcome some of the complexities when using the
WeMos D1 R32 ESP32.
WiFi reliability¶
- Solder a 250 to 330 ohms resistor, GPIO_0 to 3.3V, for reliable WiFi when using the WeMos D1 R32 ESP32duino.
IOREF voltage¶
-
Do not confuse adding the resistor to correct high voltage on GPIO_0 with the need to work around the incorrect voltage of the IOREF pin.
-
From top to bottom the pins are: IO0, 5V (incorrect -- IOREF should be 3.3V -- so not Arduino UNO R3 compliant), RESET, 3.3V, 5V, GND, GND, VIN as seen here:
-
Note that some ESP32duino boards may not have the IOREF pin location labelled. Measure the voltage if in doubt.
-
As the IOREF pin on the WeMos D1 R32 is 5V, modify the EX8874 using the 3V3 IOREF Override solder pad on the EX8874. If this is not done, the ADC inputs will receive up to 5V when the IOREF pin is 5V.
-
Bend the IOREF pin or confirm that the trace connecting the pin is completely cut.
One EX8874¶
Review of motor shield define from MotorDrivers.h for ESP32 WeMos R1 D32
#elif defined(ARDUINO_ARCH_ESP32)
// STANDARD shield on an ESPDUINO-32 (ESP32 in Uno form factor). The shield must be eiter the
// 3.3V compatible R3 version or it has to be modified to not supply more than 3.3V to the
// analog inputs. Here we use analog inputs A2 and A3 as A0 and A1 are wired in a way so that
// they are not useable at the same time as WiFi (what a bummer). The numbers below are the
// actual GPIO numbers. In comments the numbers the pins have on an Uno.
#define STANDARD_MOTOR_SHIELD F("STANDARD_MOTOR_SHIELD"), \
new MotorDriver(25/* 3*/, 19/*12*/, UNUSED_PIN, 13/*9*/, 35/*A2*/, 0.70, 1500, UNUSED_PIN), \
new MotorDriver(23/*11*/, 18/*13*/, UNUSED_PIN, 12/*8*/, 34/*A3*/, 0.70, 1500, UNUSED_PIN)
// EX 8874 based shield connected to a 3.3V system (like ESP32) and 12bit (4096) ADC
// numbers are GPIO numbers. comments are UNO form factor shield pin numbers
#define EX8874_SHIELD F("EX8874"),\
new MotorDriver(25/* 3*/, 19/*12*/, UNUSED_PIN, 13/*9*/, 35/*A2*/, 1.27, 5000, 36 /*A4*/), \
new MotorDriver(23/*11*/, 18/*13*/, UNUSED_PIN, 12/*8*/, 34/*A3*/, 1.27, 5000, 39 /*A5*/)
- STANDARD_MOTOR_SHIELD and EX8874_SHIELD are pre-defined for use with ESP32 in MotorDrivers.h
- Do not edit MotorDrivers.h; a custom motor define would be added in config.h
- Note how the ESP32 GPIO pin numbers are used, and the Arduino pin locations are shown/commented.
Alternate pins A2 and A3 are required for the WeMos D1 R32 / ESP32duino.
One EX8874 motor shield would use the motor define EX8874_SHIELD, and update the solder pads to use A2 and A3.
When one EX8874 motor shield is used with WeMos R1 D32 ESP32duino, the alternate current sense pins are used as the A0 and A1 pin locations cannot be used as ADC input when WiFi is enabled.
Single EX8874 Checklist¶
- Cover the barrel connector on WeMos R1 D32, as VIN power will be provided by EX8874
- Add resistor for WiFi reliability - GPIO_0 to 3v3
- IOREF Override set to 3v3
- Confirm that IOREF pin is bent or trace is cut
- Alternate pins enabled via solder pads
-
#define MOTOR_SHIELD_TYPE EX8874_SHIELD
on one line in config.h
Stacked EX8874¶
-
Reminder: No modifications are needed when installing EX8874 for 4 track outputs on EX-CSB1.
-
IOREF: The IOREF override is also needed for the top shield.
-
VIN: Refer to instructions on cutting the VIN trace and disabling the regulator for the top shield.
-
Stacking motor shields on WeMos D1 R32 ESP32duino requires a combination of solder pads and complex wiring. Note the location of GPIO pins 15 and 33 (image above), where wires or right-angle header pins will need to be installed on the WeMos R1 D32 ESP32duino.
- A custom motor define will be needed in config.h
#define EX8874_SHIELDX2 F("EX8874_SHIELDX2"), \
new MotorDriver(25/* 3*/, 19/*12*/, UNUSED_PIN, 13/*9*/, 35/*A2*/, 1.52, 5000, 15), \
new MotorDriver(23/*11*/, 18/*13*/, UNUSED_PIN, 12/*8*/, 34/*A3*/, 1.52, 5000, 33), \
new MotorDriver(26/* 2*/, 5/*10*/, UNUSED_PIN, 14/*7*/, 36/*A4*/, 1.52, 5000, 2 /*A0*/), \
new MotorDriver(16/* 5*/, 17/* 4*/, UNUSED_PIN, 27/*6*/, 39/*A5*/, 1.52, 5000, 4 /*A1*/)
#define MOTOR_SHIELD_TYPE EX8874_SHIELDX2
Stacked EX8874 Checklist¶
- Cover the barrel connector on WeMos R1 D32, as VIN power will be provided by one EX8874
- Add resistor for WiFi reliability
- IOREF Override set to 3v3 on both EX8874 boards
- Confirm that IOREF pin is bent or trace is cut
- VIN trace cut and regulator disabled on top EX8874
- Alternate pins enabled via solder pads
- Complex wiring added
- Jumpers added for GPIO 15 and 33
- Add the custom motor define - 6 lines in config.h
TODO