Voltage level shifter but from 30v to 3.3v

I want something like a voltage level shifter, which is typically used for 5V to 3.3V conversion, but I need to handle 30V to 3.3V. I’m looking for a simple, easy-to-integrate electronic circuit that can send and receive digital signals from a high-voltage, high-current controller board to an ESP32 without signal loss or noise.

You might suggest using resistors, but a simple resistor divider won’t work for my case. I need to transmit and receive digital signals reliably, without signal degradation or noise.

For example, I have an industrial controller board that controls a stepper motor. Both the controller board and the stepper motor operate at 30V and 2A, and there is no separate motor driver. I also have no information about the motor’s speed or when it stops—there are no logs available and that the reason I am trying to build this project.

My plan is to place the ESP32 between the industrial controller board and the stepper motor. I would connect the wires that were originally going to the stepper motor into the ESP32, and then from the ESP32 back to the motor. However, I cannot directly connect them without stepping the voltage and current down (for the ESP32) and then back up (for the motor). The goal is to monitor the process by reading the step and direction pulses on the ESP32, forwarding the same pulses to the motor, and sending the data to the cloud for later analysis.

Additionally, I want to remotely control the machine’s operation by adjusting the speed of the stepper motor—either increasing or decreasing it.

Note: The stepper motor is a 6-wire unidirectional type

Two resistors making a voltage divider has done this for about 100 years.

Topic moved. Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.

You are aware that the ESP32 is a 3.3V device. Your topic title refers to 3.3V but your topic body refers to 5V.

…without signal loss and noise. For example, there is an industrial controller board that controls a stepper motor where both needs 30v and 2A power, but I have no information about how fast the motor is spinning or when it stops. Basically, I have no working logs.

So, my plan is to place my ESP32 between the industrial controller board and the stepper motor to monitor the process. I will read the step and direction pulses on the ESP32, forward the same pulses to the motor, and send the data to the cloud for later analysis.

Additionally, I want to remotely control the machine’s operation by adjusting the speed of the stepper motor—either speeding it up or slowing it down. I want to achieve this functionality.

Confused. Are you planning to measure the motor wires? Bad idea.
Can't you get the step/dir pulses from the input of the driver.
Bigger stepper drivers commonly have opto couplers inputs.
Need more info.

But the control signals may only be 5V.
Did you measure the voltages?

This is different to what you originally asked. Add these extra details at the beginning.

Motor speed sensing and control is normally done using optical sensors or Hall devices.
It should be straightforward to monitor other parameters like current and voltage.

You will need to take care if your project involves the inner workings of the controller etc.

@insas So you want to use the power from a motor in another system as a trigger to tell another device the information about what the motor is doing? So you need to step the motor's 30 volts down to 5 volts or 3.3 volts?

Interesting. I have thought of the same thing before, I just haven't had a chance to see it through to fruition yet. In my (hopefully) future project, the motor is either analog or PWM driven, so a voltage divider would not work at the lower speed levels. The measurable speed range is about 6 volts up to 28 volts. I was thinking to use a 5 volt to 30 volt buck converter with a 5 volt output.

I don't know how fast a buck converter is. Do you need a response down to the microsecond? In my project it wouldn't matter. If it is triggered within a few microseconds, that is fast enough. And if it is a PWM signal, some timing math would tell me if it is still running or not.

perhaps the solution you have in mind is not the most practical one. You want te measure the speed and direction of your motor, adjust the speed on the go and without delay get in return the speed of the motor. is that what you want?

@insas ,

I have deleted your other post on the same subject .

Crossposting is against the Arduino Forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated crossposting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

I've used this circuit in the past. It's safer than a voltage divider.

Black wire: ground, Blue wire: 30V

The Pin35 label goes to a digital input configured as INPUT_PULLUP

R1 is 12k because I had hundreds on hand. But anything in the 10-30k range should be fine.

Remember that OP wants to measure a stepper motor with at least four wires with complex current controlling PWM signals. I wouldn't know how to extract speed/dir from stepper motor wires.

Me neither, but I know how to transform a 30V pulse to a 3.3V one :-)

@insas

You will need much more than a level shifter to do what you want. It will be impossible without a lot of additional circuitry and a stepper motor driver not to mention the software.

However you can easily monitor the motor voltages but controlling the motor will be much too complicated.

how

See the image in post #12.

As has already been mentioned several times, you cannot see any step and/or dir signals directly at the motor wires. The motor signals are complex PWM signals created by the controller/driver. The only chance to do what you want is to monitor the input signals of the (unknown) stepper controller. So far you didn't tell us anything about that controller.

You are probably wondering where the two vertical lines in the circuit image go.

If you look up "voltage translator" (VT), you'll get some more information.

Although a Bipolar Transistor (2N3904) is used, many VTs use MOSFETs.

Often used to change logic levels from say, 3.3-V to 5.0-V, and vice versa.

This plan definitely will not work. Your industrial controller will not work anymore if you separate it from the stepper motor. It needs the inductance of the stepper coils to work properly. I think you’ve got the wrong idea about how a stepper controller/driver works. The motor and driver form a single unit that only works together.

A simple voltage level shifter will not help you.