4
\$\begingroup\$

I have been building a Li-Ion charge controller with MCP73831. The STAT pin has 3 states as shown below:

MCP73831-states

The circuit I come up so far is this:

states-detector-circuit

Is there a way to detect the HI-Z state with another transistor and an LED?

\$\endgroup\$
6
  • \$\begingroup\$ You can turn a hi-z state into a known voltage by putting a weak voltage divider on it. Then, you just need a way to distinguish the three valid voltage levels. \$\endgroup\$ Commented Apr 13, 2015 at 9:17
  • \$\begingroup\$ I was thinking about that as you can my comments down below (to user Mattu475), but how do I do that? As the circuit is becoming more complicated, I don't see a point in using transistors anymore, as a small microcontroller can do it easily. \$\endgroup\$ Commented Apr 13, 2015 at 12:50
  • \$\begingroup\$ Yes, switching to an MCU is likely a good idea. What part are you uncertain about how to do? The voltage divider? \$\endgroup\$ Commented Apr 13, 2015 at 12:52
  • \$\begingroup\$ @Nick Johnson: I just simulated/tested it with atmega328 with resistor voltage dividers (2x10k) and it works nicely. Thanks! \$\endgroup\$ Commented Apr 13, 2015 at 14:09
  • \$\begingroup\$ Happy to help! I've added an answer to this effect. \$\endgroup\$ Commented Apr 13, 2015 at 15:09

5 Answers 5

3
\$\begingroup\$

The best way to measure the Hi-Z state is to hook up a voltage divider to the output. When the output is not being driven, the voltage will settle at the potential set by the voltage divider, which provides you with a third voltage to measure.

Distinguishing these three voltages using transistors is tricky, and probably not worth it - using an MCU, or failing that, window comparators, is a better solution.

\$\endgroup\$
4
\$\begingroup\$

I'm reasonably new to circuit design, but was struck with the same problem in that I did not want to put 5v on my 3.3v MCU. I also wanted something that did not draw much current.

As an alternative to the voltage divider that others have suggested, I used a second GPIO pin of the MCU to toggle a pull-up / pulldown resistor using a P-Channel and N-channel MOSFET (see circuit below). I then took STAT and put it through a simple inverted to ensure it is within the MCU 0v - 3.3v range. Note: Weaker Pull-up and pulldown resistors could probably be used to even further reduce current usage.

For this to work, the MCU would then need to take 2 readings, the first with CTL low and the second with CTL high. If the readings change, then ~STAT must be floating.

Hope this helps everyone.

enter image description here

\$\endgroup\$
0
1
\$\begingroup\$

I don't think so. You cannot know the potential of your hi-Z output, as it is is tied to no potential.

If you look at page 2 in the datasheet, you see that the output pin is driven by two mos-fets that are leading to the high impedance output. The voltage at 'IN' will be anywhere between Vdd and Vss. Thus, there might be a different voltage, every time the Output is switched to hi-z.

\$\endgroup\$
4
  • \$\begingroup\$ Yes, there is a way of detecting it, with a micro-controller. On the STAT pin you setup a pull-up and a pull-down resistor and connect it to an analog pin. But without a microcontroller, with some LEDs, I don't know how to do it. \$\endgroup\$ Commented Apr 13, 2015 at 7:42
  • \$\begingroup\$ But I don't recommend this method. If the hi-z output happens to float around 0V, your microcontroller might detect it as a logic low. The same could happen, if the output floats around the high level. \$\endgroup\$
    – Mattu475
    Commented Apr 13, 2015 at 7:58
  • \$\begingroup\$ Those pull-up and pull-down resistors together prevent just that case. \$\endgroup\$ Commented Apr 13, 2015 at 8:02
  • 1
    \$\begingroup\$ Also I answered to your question (is it possiple with a additional transistor and a led?). It isn't. \$\endgroup\$
    – Mattu475
    Commented Apr 13, 2015 at 8:02
1
\$\begingroup\$

Use R and 2R resistors. R can be 1.8k, then 2R is 3.6k. Wiring: VCC--[2R]--A--[R]--SIGNAL--[R]--B--[2R]--GND

(A XOR B) = /(SIGNAL=="Hi-Z")

If SIGNAL==Hi-Z, A is 2/3VCC (logical HI), B is 1/3VCC (logical LO). Please continue...

\$\endgroup\$
0
\$\begingroup\$

You could try the following configuration. It shows one LED for high, the other LED for low and both LEDs (slightly dimmer) for Hi-Z.

enter image description here

Check that your input voltage is enough to turn both LEDs on in series. You could also consider making the resistor a higher value if you have particularly bright LEDs, to avoid dissipation in the charger IC.

\$\endgroup\$

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