# Voltage Translation

back in electronics after 7 years and found that nothing is in my bio-disk gifted by god.

now, i have a motor system that i want to make sure, no one cut the cable. apart from the 24volt motor power line (via h-bridge for fwd/rev movement) i also added 2 cables, one carrying volt (24v) to the end of it and other as return...

24v ----------------|
| motor
return -------------|


now, this surely brings back the 24v back to me from motor, and i can measure the presence of it and can say, no one "cut" my cables. but since i want to check via microcontroller, how exactly i can do it? (I did it using relay as an isolator, translating 24v to 5v. now i wanna do it with an n-fet). All i need is uC have to see 5v in a pin of it, when 24v is present.

Note: uC and the hbridge are two boards, 2 PSUs, commonly grounded by tying GND togather.

Now please tell me, is this acceptable?? MCU will see HI when switch ON and LOW when switch OFF.

• If you can tell us what you want to achieve with that signal in uC, I think we'd be able to suggest more convenient ways for you. For eg, In case you strictly need it for some programming stuff, you'd need to have scale down voltage and detect both polarities. But if you just want indicating LED, there are easier ways. Also, in which section you need to detect cuts... after or before H-Bridge or both sides of H-bridge?
– Deep
Aug 23 '19 at 5:35
• "Nothing is in my bio-disk gifted by god" makes zero sense. Aug 23 '19 at 16:03
• @JYelton I think he is just trying to say his brain remembers nothing. Aug 25 '19 at 0:34
• The option C is a good method i feel for me. Except that can i use a mosfet instead of an opto coupler?? I know it's a again a stupid question... just to be sure... enter image description here Now please tell me, is this acceptable?? MCU will see HI when switch ON and LOW when switch OFF. Aug 28 '19 at 18:34
• You could use a FET as long as you don't violate VGS (max) for the FET you use (which is typically near +/- 20V) Aug 28 '19 at 20:17

Three options

A) Voltage divider:

simulate this circuit – Schematic created using CircuitLab

B) Linear regulator:

simulate this circuit

C) Isolated interface using an optocoupler:

simulate this circuit

• The option C is a good method i feel for me. Except that can i use a mosfet instead of an opto coupler?? I know it's a again a stupid question... just to be sure... enter image description here Now please tell me, is this acceptable?? MCU will see HI when switch ON and LOW when switch OFF. Aug 28 '19 at 18:34
• You can use a MOSFET, but if you don't need isolation, why not just use A) or B)? Aug 29 '19 at 0:17
• Using any sort of common ground or power bus is not TRUE isolation. With solution A), the zener provides over-voltage protection. With B), the regulator accepts up to 35 Volts, also has it's own built in protection, and cost \$0.12. One generally uses a transistor when one needs to provide a higher current signal from a lower current source, which is not the case here... Aug 29 '19 at 0:25
• A) is a good way and cheaper. But if Zener fails, i mean gets damaged for some reason, then it may just fire the MCU. B) Is nice, but it will heatup the board and itself as 24v - 5v is a lot of heat. C) is practically isolation and yep, the best in my eyes except of my MOSFET concept, which also gives a kindof isolation. MOSFET in SMD will save some space in PCB than 4N25. But not significant space... Note: Common ground is not total isolation, but i have no way, actually there will be 2 PSU, one for 24V and other for 12V as AUX. Both via a reverse back feed protection will make 5V Aug 29 '19 at 4:25
• Since it will have a dual PSU, hence there will be common ground, but the purpose is only confirming that the cable of the motor (for which the 24v is) not cut by some person (a wire will be passed from pcb to motor and come back again) for motor line presence by the MCU. That's what is the actual purpose... Aug 29 '19 at 4:34