I’m working with an Arduino Giga as a drop-in replacement for an Arduino Mega. In order to manage the new 3.3V architecture, I am using several Level Translator Breakout - PCA9306 (SKU: BOB-15439) boards to handle logic level conversions to 5V for signals. This works for 90% of my use cases without issue. However, when I connect these boards to a stepper motor driver (34MD series from AA), the output voltage drops from the expected 5v to 3.09V.
The 34MD input is an opto-diode, requiring 1.0mA to be sourced or sinked to enable. I have configured it to source. The datasheet recommends putting 3.5V+ across the +/- terminals. When I read with a multimeter, it seems the driver is getting exactly 1mA of current, but the voltage is dropping to 3.09V.
Is there any reason the level translator would be unable to source 1mA of current at 5V? The datasheet specs seem to say that 1mA is well under any maximum current, but it could depend on the setup of the breakout board.
In case it helps, I do believe the level translator - stepper driver interaction is at fault, because when I unplug the stepper and read signals at the connector they read 5V as expected.
it’s enterprise, so I can’t share photos, but I put together a rough wiring diagram. I’ve used star grounding so every component (including power supplies) has a unique connection to the same ground bus.
A couple other discoveries over the last week: putting a large enough resistor (~10k) between the - pins on the driver and ground gets the voltage close to 5V, but the driver itself no longer gets pulled high (presumably because it cannot source enough current). Also, the Level Translator seems to source current to the arduino – a multimeter connected + to pin D6 and - to SDA1 read -3mA when D6 was high.
I have checked all the connections for continuity and replicated the issue on multiple level shifter boards, so I am confident there are no bad connections in the soldering or wiring.
You shouldn’t need a level translator for an optocoupled input, as long as the MCU I/O pin is configured to source the required LED current.
If the optocoupler LED input has an external current-limiting resistor designed for 5V drive, simply replace that resistor with a suitably lower value.
Edit: just looked at the specs for the 34MD112S, and saw that the input voltage range is 3.5-8.6 VDC.
You might be able to get away with applying 3.3V directly, so that is worth a try.
If that does not work, any NPN transistor or logic level N-MOSFET (with suitable pullup to 5V) can be used as the level translator.
The PCA9306 is a specialist level translator for I2C busses. It has no drive capability. It can only sink current. It relies on external pull-up resistors to provide the ‘high’ logic level. It’s probably not a good choice for your project. You may be able to use it, but only with a few circuit changes:
Thank you! The 3.3V worked like a charm. I was skeptical after reading the datasheet and seeing the 3.5V requirement, but I don’t have much experience with optocouplers, so I really appreciate everyone’s advice!