OpenUC2

UC2 ESP32 Flashing Tool

User-friendly tools to flash/upload the firmware for the openUC2 ESP32 device in the browser:

Pick your UC2 PCB and flash the software using the browser! No programming or other software required.

Test the Firmware

An online Tool will enable you to connect to the ESP and control certain hardware elements. Follow this link, select the ESP32 and hit e.g. the LED on button.

UC2 Logo

Flash the Firmware

This webpage will install UC2-ESP. To get started, connect an ESP device to your computer and hit the button (we assume you installed the CH340 or CP2102 driver; The links to the drivers will be suggested if no Serial device is found by the browser.).

Note: This is only available on Chrome or Microsoft Edge. 

ESP32 WEMOS D1 R32-based UC2 board

This is an off-the-shelf board that can - in conjuction with the CNC Shield v3 - be used for most of the microscopy tasks we use in the lab every day. The serious disadvantage is the inability to quickly add new devices since the pins do not really allow this. More information can be found here.

Pin Layout

        
          // ESP32-WEMOS D1 R32
          const int PIN_DEF_MOTOR_DIR_A = 0;
          const int PIN_DEF_MOTOR_DIR_X = GPIO_NUM_16; 
          const int PIN_DEF_MOTOR_DIR_Y = GPIO_NUM_27;
          const int PIN_DEF_MOTOR_DIR_Z = GPIO_NUM_14;
          const int PIN_DEF_MOTOR_STP_A = 0;
          const int PIN_DEF_MOTOR_STP_X = GPIO_NUM_26;
          const int PIN_DEF_MOTOR_STP_Y = GPIO_NUM_25;
          const int PIN_DEF_MOTOR_STP_Z = GPIO_NUM_17;
          const int PIN_DEF_MOTOR_EN_A = GPIO_NUM_12;
          const int PIN_DEF_MOTOR_EN_X = GPIO_NUM_12;
          const int PIN_DEF_MOTOR_EN_Y = GPIO_NUM_12;
          const int PIN_DEF_MOTOR_EN_Z = GPIO_NUM_12;
          const bool PIN_DEF_MOTOR_EN_A_INVERTED = true;
          const bool PIN_DEF_MOTOR_EN_X_INVERTED = true;
          const bool PIN_DEF_MOTOR_EN_Y_INVERTED = true;
          const bool PIN_DEF_MOTOR_EN_Z_INVERTED = true;

          const int PIN_DEF_LASER_1 = GPIO_NUM_18;
          const int PIN_DEF_LASER_2 = GPIO_NUM_19;
          const int PIN_DEF_LASER_3 = 0; //GPIO_NUM_21 

          const int PIN_DEF_LED = GPIO_NUM_4;
          const int PIN_DEF_LED_NUM = 64;

          const int PIN_DEF_END_X = GPIO_NUM_13;
          const int PIN_DEF_END_Y = GPIO_NUM_5;
          const int PIN_DEF_END_Z = GPIO_NUM_23; 

          const String PIN_PS4_MAC_DEF = "1a:2b:3c:01:01:01";
          const int PIN_PS4_ENUM_DEF = 2;


          #define WEMOS_D1_R32_BOARD_NAME "ESPDUINO-32 Wemos D1 R32"

          // timer definitions
          #define WEMOS_D1_R32_STEP_TIMER_GROUP TIMER_GROUP_0
          #define WEMOS_D1_R32_STEP_TIMER_INDEX TIMER_0

          // Define step pulse output pins.
          #define WEMOS_D1_R32_X_STEP_PIN          GPIO_NUM_26
          #define WEMOS_D1_R32_Y_STEP_PIN          GPIO_NUM_25
          #define WEMOS_D1_R32_Z_STEP_PIN          GPIO_NUM_17
          #define WEMOS_D1_R32_A_STEP_PIN          GPIO_NUM_19

          // Define step direction output pins. NOTE: All direction pins must be on the same port.
          #define WEMOS_D1_R32_X_DIRECTION_PIN     GPIO_NUM_16
          #define WEMOS_D1_R32_Y_DIRECTION_PIN     GPIO_NUM_27
          #define WEMOS_D1_R32_Z_DIRECTION_PIN     GPIO_NUM_14
          #define WEMOS_D1_R32_A_DIRECTION_PIN     GPIO_NUM_18

          #define WEMOS_D1_R32_X_END_STOP          GPIO_NUM_13 // arduino 9
          #define WEMOS_D1_R32_X_END_STOP          GPIO_NUM_5  // arduino 10
          #define WEMOS_D1_R32_X_END_STOP          GPIO_NUM_23  // arduino 11


          // Define stepper driver enable/disable output pin(s).
          #define WEMOS_D1_R32_STEPPERS_ENABLE_PIN GPIO_NUM_12

          // Define homing/hard limit switch input pins and limit interrupt vectors.
          #define WEMOS_D1_R32_X_LIMIT_PIN         GPIO_NUM_13
          #define WEMOS_D1_R32_Y_LIMIT_PIN         GPIO_NUM_5
          #define WEMOS_D1_R32_Z_LIMIT_PIN         GPIO_NUM_23

          // Define spindle enable and spindle direction output pins.
          #define WEMOS_D1_R32_SPINDLE_ENABLE_PIN  GPIO_NUM_18
          #define WEMOS_D1_R32_SPINDLEPWMPIN       GPIO_NUM_19

          // Define flood enable output pin.
          #define WEMOS_D1_R32_COOLANT_FLOOD_PIN   GPIO_NUM_32

          // Define user-control CONTROLs (cycle start, reset, feed hold) input pins.
          #define WEMOS_D1_R32_RESET_PIN           GPIO_NUM_2
          #define WEMOS_D1_R32_FEED_HOLD_PIN       GPIO_NUM_4
          #define WEMOS_D1_R32_CYCLE_START_PIN     GPIO_NUM_35

          // Define probe switch input pin.
          #define WEMOS_D1_R32_PROBE_PIN           GPIO_NUM_39

          #define WEMOS_D1_R32_UART2_RX_PIN            GPIO_NUM_33
          #define WEMOS_D1_R32_UART2_TX_PIN            GPIO_NUM_32
          #define WEMOS_D1_R32_MODBUS_DIRECTION_PIN    GPIO_NUM_15
          #define WEMOS_D1_R32_MODBUS_BAUD             19200


          // Pin mapping when using SPI mode.
          // With this mapping, SD card can be used both in SPI and 1-line SD mode.
          // Note that a pull-up on CS line is required in SD mode.
          #define WEMOS_D1_R32_PIN_NUM_MISO        GPIO_NUM_19
          #define WEMOS_D1_R32_PIN_NUM_MOSI        GPIO_NUM_23
          #define WEMOS_D1_R32_PIN_NUM_CLK         GPIO_NUM_18
          #define WEMOS_D1_R32_PIN_NUM_CS          GPIO_NUM_5
        
      

Advanced Users

We provide two firmware versions: V1 (deprecated) and V2. The latter is implemented in the Platform.io standard. You can find more information on their dedicated github repositories:

Viewing logs & sending commands

ESP Web Tools allows users to open a serial console to see the logs and send commands.

Screenshot showing ESP Web Tools dialog with a console showing ESPHome logs and a terminal prompt to sent commands.

Screenshot showing the ESP Web Tools logs & console Based on the ESPHome Web-Tool.