0
\$\begingroup\$

I have two signal lines that I will be monitoring with an MCU Input I/O pin (3.3v powered). Both inputs will be coming from external sources. I will be monitoring each of them for a high or low state. The problem is that the signal coming in could be between 0v and 24v, and the signals coming in "may" be serial data (approx 9600 baud).

Below is using something like the BAT54SWT1G Schotch Diode Array to clamp voltages at 0v and 3v.

EDIT: Updated schematic with a current limiting resistor before the clamping diodes.

schematic

simulate this circuit – Schematic created using CircuitLab

Schematic was redrawn in conventional orientation by Transistor

\$\endgroup\$
  • 2
    \$\begingroup\$ For clamping, you need to limit the input current, so the resistor goes between the input and the clamp. \$\endgroup\$ – Janka Feb 14 '18 at 18:49
  • 1
    \$\begingroup\$ If you connect +24V to the input you will likely destroy everything connected to the 3.3V rail. \$\endgroup\$ – Spehro Pefhany Feb 14 '18 at 19:52
  • \$\begingroup\$ Why a simple zener can't do the job? Too slow? \$\endgroup\$ – Fredled Feb 14 '18 at 20:16
  • \$\begingroup\$ What exactly does "could be between 0V and 24V" mean? What are the thresholds on that and do you have a guaranteed low level. Your circuit may not work if Vil is much above zero. You may also be better to use opto-couplers for this if the signals are at a distance. Safer too. \$\endgroup\$ – Trevor_G Feb 14 '18 at 20:45
  • 2
    \$\begingroup\$ @apaul: I've redrawn your schematic in a conventional manner for readability. Never rotate the ground symbols. They should point down to the, eh, ground. Signal flow should generally be left to right and higher voltages to the top. Delete one schematic and keep the other. (I don't mind.) \$\endgroup\$ – Transistor Feb 19 '18 at 21:14
4
\$\begingroup\$

Input signal source resistance is not specified. The clamping diode current flow could be excessive.
You might consider adding a pull-down resistor (or a pull-up resistor) so that the MCU I/O line falls to a known-state when no input signal is connected.
The V1 voltage should be the MCU Vdd power supply.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ I like this solution, and it makes sense. I do not have a specified source resistance yet but will work on getting those values. I am thinking I would use this exact circuit but instead of the pull-down would use a 1M pull-up to Vdd (MCU's voltage). Am I correct that the max current usage of the clamp @24v input would be approx 2mA? \$\endgroup\$ – apaul Feb 19 '18 at 14:26
  • \$\begingroup\$ Yes, 2 mA. The single device BAT54S could be used (dual-diode, series), instead of two plain BAT54 (single diodes). I had just scaled the time-constant R1C1 to match your original RC. Be aware that the input shouldn't linger at 1.7V - Digital inputs expect quick transitions from low-to-high & high-to-low. \$\endgroup\$ – glen_geek Feb 19 '18 at 14:47
  • \$\begingroup\$ @apaul Be certain than your MCU, and circuits that are powered by its Vdd supply, draw more than this 2mA current at all times, otherwise, your 24V signal source could end up powering, and over-volting the 3.3V supply. Generally, DC regulators are designed to supply current, and not designed to sink current - regulator output voltage can rise above 3.3V for the "sinking-current" case. \$\endgroup\$ – glen_geek Feb 20 '18 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.