How to connect a Doosan digital I/O port to a microcontroller using a transistor

Based on contributions by MarijnvdWekken.

A Doosan tool digital input expects a 24V signal, while a microcontroller like an ESP32 or Arduino outputs 3.3V or 5V logic β€” they cannot be wired together directly. This how-to shows how to level-shift a digital signal between the two using a single NPN transistor, so the robot can wait for or react to a signal from a microcontroller running its own sensor/servo/gripper logic.

What you need

  • Doosan robot with a free tool digital input
  • Microcontroller (e.g. ESP32 or Arduino)
  • 2N2222 NPN transistor
  • Pull-up resistor: approx. 10–15 kΞ©, from Doosan +24V to the digital input
  • Base resistor: approx. 10–39 kΞ©, between the microcontroller output and the transistor base
  • A multimeter, for testing before connecting to the robot

Steps

1. Understand why a transistor is needed

A Doosan digital input needs 24V to register HIGH. A microcontroller pin only supplies 3.3V or 5V and cannot drive that directly. A transistor is used as an electronic switch instead:

  1. Microcontroller output LOW β†’ transistor off
  2. Microcontroller output HIGH β†’ transistor on
  3. Transistor off β†’ Doosan input is pulled up to 24V
  4. Transistor on β†’ Doosan input is pulled down to GND

Note that this inverts the signal: microcontroller LOW results in Doosan input HIGH, and vice versa. Account for this inversion in your robot or microcontroller logic.

2. Wire it up

  • Transistor collector β†’ Doosan digital input
  • Transistor emitter β†’ Doosan GND
  • Transistor base β†’ microcontroller output, through the base resistor
  • Doosan GND β†’ microcontroller GND (common ground is required)
  • Doosan +24V β†’ pull-up resistor β†’ Doosan digital input (this is the same node as the collector)

Do not connect the Doosan digital input directly to +24V without the pull-up resistor in this circuit β€” the resistor is what limits the current when the transistor pulls the line to GND.

Recommended resistor values:

Resistor Value
Pull-up, Doosan +24V β†’ digital input ~10–15 kΞ©
Base, microcontroller output β†’ transistor base ~10–39 kΞ©

3. Write the microcontroller test code

This toggles the output every 3 seconds, so you can verify the circuit before wiring it to the robot:

#include <Arduino.h>

const int DOOSAN_SIGNAL_PIN = 15;

void setup()
{
    Serial.begin(115200);

    pinMode(DOOSAN_SIGNAL_PIN, OUTPUT);
    digitalWrite(DOOSAN_SIGNAL_PIN, LOW);
}

void loop()
{
    Serial.println("output LOW -> Doosan DI HIGH");
    digitalWrite(DOOSAN_SIGNAL_PIN, LOW);
    delay(3000);

    Serial.println("output HIGH -> Doosan DI LOW");
    digitalWrite(DOOSAN_SIGNAL_PIN, HIGH);
    delay(3000);
}

4. Test with a multimeter before connecting the robot

Before wiring the collector node to the actual Doosan digital input, measure it directly:

Red probe   -> collector / Doosan DI point
Black probe -> GND

Expected result:

Microcontroller output LOW  -> about 24V
Microcontroller output HIGH -> about 0V

If you see this, it’s safe to connect the point to the Doosan digital input.

5. Read the input on the robot side

In C++ with DRFL, read the tool digital input with get_tool_digital_input:

int input_value = robot.get_tool_digital_input(
    static_cast<GPIO_TOOL_DIGITAL_INDEX>(3)
);

if (input_value == 1)
{
    std::cout << "Doosan input is HIGH" << std::endl;
}
else if (input_value == 0)
{
    std::cout << "Doosan input is LOW" << std::endl;
}
else
{
    std::cout << "Error reading Doosan input" << std::endl;
}

Remember the signal is inverted by the transistor: a HIGH read here means the microcontroller output was actually LOW.

Troubleshooting

  • :warning: Check: the resistor values above (10–15 kΞ© pull-up, 10–39 kΞ© base) are the values used in the original setup. They were not verified against the exact input impedance of every Doosan digital input model β€” always test with a multimeter as in step 4 before trusting the circuit with the robot connected.
  • If the multimeter readings in step 4 don’t match, double-check your ground connection first β€” the Doosan GND and microcontroller GND must be common, or the voltage readings will be meaningless.

Related


Rewritten and consolidated (Sept 2026) from the original student how-to’s: How to communicate between a Doosan robot and a microcontroller using a transistor.