Comments on Need guidance: Sensing 12 V and protecting hall sensor input
Parent
Need guidance: Sensing 12 V and protecting hall sensor input
I’m working on a throttle interface circuit for a BLDC motor controller using an STM32 MCU, and I would like some suggestions for two things — 12 V sensing and hall sensor input protection.
The throttle module outputs the following signals:
-
Hall sensor output: 0 V to 4.5 V range (analog signal proportional to throttle position).
-
Forward/Reverse switches: Digital outputs that switch 12 V when pressed.
These signals come through a 4ft long cable from the throttle mounted on the machine housing, where users can touch the assembly. The 12 V line originates from the STM32 controller board’s buck converter output (12 V rail) and goes to the throttle circuit which has it's own LDO to convert 5V for the hall sensor.
I’m evaluating options for:
- Safely sensing the 12 V signal on the MCU side (3.3V). I have tried below transistor circuit which works just fine but zener diode (BZX84 Zener Diode 3.3 V 250 mW ±1%) can leak after repeated surges. Which is better design considering ESD or overvoltage conditions.?
Here is the another way (Opto based).
Is there any advantage with this design?
2. Proper ESD and surge protection for the hall sensor line (0–4.5 V analog input). I am using TVS DIODE VRWM 5V and clamping voltage of 12V and after voltage divider added BAT54 to keep the rail within 3.3V and GND. I have added 33 ohm on the MCU side for taming surge voltage, is it okay to add? also Any General input protection considering the cable length and possible ESD/hot-plug events ?
What would be the best approach here for robust and noise-immune interfacing?
EDIT: Based on Lundin's comment, I have created this quick circuit.
Post
The BJT is overkill and might have issues of its own (voltage spec, ESD etc) and you don't need to switch a lot of current either. Also a plain zener is too slow to help against spikes, you need a TVS.
Similarly with the optocoupler, it is overkill and in general just a last resort in case you suspect very bad conditions on-site (bad grounds etc). Additionally, an optocoupler turns into a useless waste of space when you use same grounds on the primary and secondary as in your schematic - it literally does nothing except adding BoM cost. Beware of the Arduino optocoupler disease!
The most standard way to do this is a simple voltage divider as in my answer here: https://electronics.stackexchange.com/a/756620/6102 Which is more or less identical to your 2) schematic so that's what I would use. It doesn't matter if it's a MCU or a hall effect sensor you need to protect. Simple, inexpensive, safe.
Except you can use a much higher series resistor towards the MCU, the value is by no means critical but high resistance means better protection of the MCU pin in case of mishaps.
Also consider that the Schottky diodes will have some forward voltage so you won't cap the signal level to exactly 3.3V but rather to 3.3V + Vfwd. BAT54 got roughly 0.3Vfwd so you should place it towards a +3V ref in case the exact voltage is important.

0 comment threads