24V pullup resistor to a 3V3 input pin - Page 1
Forum section: electronics / projects

author: Seekonk
author_rank: Super Contributor
timestamp: February 25, 2017, 11:41:11 am
content: This is a discussion elsewhere, a variation of Dave's powering a micro with an input pin. In this case an external device identifies itself by the value of a resistor connected to a onewire type buss. Besides a digital input, the master has an A/D connected and another pull down resistor that can be switched in and out. When switched in a voltage divider forms and by the A/D reading, one of four possible devices can be identified. three of the four resistor values will make the master work. A 2.7K pullup connected to a 3V3 supply is the normal configuration.This isn't hard to replicate. Instead it has been suggested to just put a 47K resistor to 24V and letting the substrate clamp the voltage to the chips supply. It is assumed that the extra current will be tolerated by the supply. Is this just bad form or can one in a million chips be damaged be damaged by this method?

author: retrolefty
author_rank: Super Contributor
timestamp: February 25, 2017, 12:05:06 pm
content: It is a valid electrical protection method. In your case you are limiting input pin current draw to .5ma.However one would have to verify the datasheet maximum allowed specification with the specific device. A better solution is to use a dual fet voltage level translator circuit for each pin needing such protection.

author: hlavac
author_rank: Frequent Contributor
timestamp: February 25, 2017, 01:07:14 pm
content: This may be a bad idea.Many power supplies will not tolerate reverse current from the higher voltage (they can only source current, not sink it).You may end up charging the 3.3V power supply rail to 24V or blowing up the pass transistor in the supply

author: Ian.M
author_rank: Super Contributor
timestamp: February 25, 2017, 01:18:48 pm
content: You haven't said what MCU. Devices with analog features can have their operation seriously disturbed by substrate current injection - even at currents far less than their specified abs. max. clamping current. Other ADC inputs are likely to be affected, and there may be worse problems than that. e.g. there have been cases of PIC MCU internal oscillator frequency being shifted by over 50%, and shifts in the BOR threshold leading to unexpected resets are also possible. Other makes may have different vulnerabilities so YMMV.Assuming the 3.3V rail can always tolerate half a mA lifting it, an external Schottky diode to clamp the pin without significantly forward biassing the substrate diode would be advisable if you intend to use a pullup to above the rail voltage.

author: Seekonk
author_rank: Super Contributor
timestamp: February 25, 2017, 02:18:00 pm
content: The commercial device's internal MCU and circuitry are unknown, valued at $800. The A/D is likely part of the MCU. It seems a little risky just to save an extra resistor and some small regulator (even a LED as a shunt). Just curious at others experience and potential pitfalls

author: Ian.M
author_rank: Super Contributor
timestamp: February 25, 2017, 02:38:19 pm
content: If the 24V supply is reasonably stable, you can get there with a potential divider using E48 series resistors: Upper arm 19.6K, lower arm 3.16K. That gives you a Thevenin equivalent resistance of 2.72K from an equivalent voltage of 3.33V

author: Seekonk
author_rank: Super Contributor
timestamp: February 25, 2017, 03:22:32 pm
content: But you forget, the voltage measurement is made after about 4K is placed in parallel with that 3.16K. This second voltage divider is made from a switched in unknown lower resistor and the 2.7K as is described in the patent.voltage value may be detected by the analog to digital converter 608 . A protection resistor 612 may be utilized to protectthe A-D converter. For example, if the pull-up resistor represents thetype of power supply, a detection of 3.9 K ohms may beinterpreted by a master controller that the power supply is anin?nite supply (mains). A detection of 2.7K ohms may beinterpreted as a 90 Watt power supply. A detection of 1.8Kohms may be interpreted as a 60 Watt power supply. A detection of 1.0K ohms may be interpreted as a 30 Watt powersupply. Other voltage levels and coding schemes may also beutilized to code information about the power supply unit inthis analog manner. Optionally, digital messaging may alsobe utilized to detect information about the power supply unitor other components of the bus. In such a case, a data messagewith information from circuits or memory of the power supply unit or based on signals from the detectors or sensors ofthe power supply unit may be sent from a processor of thepower supply unit to a system level controller or processor.

author: Ian.M
author_rank: Super Contributor
timestamp: February 25, 2017, 03:29:39 pm
content: You cant tell the difference between a single 2.7K resistor to 3.3V and the potential divider fed with 24V I described. The Thevenin equivalent resistance and Thevenin equivalent voltage are both within 1%.Load it with whatever switched pull-down resistor you like and it behaves the same.DO THE MATHS!

author: madires
author_rank: Super Contributor
timestamp: February 25, 2017, 04:29:09 pm
content: If overvoltage is the normal operation mode I'd add a proper interface circuit and don't rely on the MCU's clamping diodes which are more like a limited protection of last resort. Staying with the 3V3 regulator (a Zener could do that job also) is the better way. Saving a few cents vs. reliability & liability issues for $800 devices is a no-brainer.

author: Kalvin
author_rank: Super Contributor
timestamp: February 25, 2017, 04:47:35 pm
content: Just add a 3V zener between the ADC input pin and the ground. The zener will do the clamping and your MCU will be happy.

author: Kalvin
author_rank: Super Contributor
timestamp: February 25, 2017, 05:00:25 pm
content: Another solution if you do not have a suitable zener: Place a 1 Megohm resistor between the ADC input and the 3V3 power rail as a pull-up resistor. Place a 1N4148 in series with the ADC input pin and the 24V pull-up resistor so that the diode's anode is connected to ADC pin and cathode is connected to 24V pull-up resistor. When the external sense resistor is not connected, the diode is reverse-biased and the ADC will read 3V3. When the external sense resistor is connected, the diode will be forward-biased and the ADC will be able to measure the voltage of the resistor divider. The diode will provide approx. 400 mV - 600 mV voltage drop which is also temperature dependent, though. If the resistor divider provides distinctly different voltages, the tempco and the voltage drop may not be an issue.

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2017, 05:04:59 pm
content: Quote from: Seekonk on February 25, 2017, 11:41:11 amIf the chip has clamping diodes on the inputs then it should be fine.Some people even connect directly to the mains like this:http://www.atmel.com/Images/Atmel-2508-Zero-Cross-Detector_ApplicationNote_AVR182.pdf