Can't measure volts properly: is this a leaky schottky diode problem?

I’ve got a number of power sources for the house lights: two lots of battery packs and a mains adapter. To connect them all together I’ve built a big switchboard with fuses and relays. All good.

Want an Arduino to monitor the power sources and control the relays, but the Arduino will need power no matter which batteries or adapters are connected.

Simple, I thought, diodes:

As long as at least one battery is switched on, the bulb will light, and the batteries won’t leak current from the stronger to the weaker even if they’re both switched on at the same time.

But I’m having problems measuring the battery voltages: even if only one battery is connected, I’m reading the same voltage at A and B, relative to ground. (My circuit is bigger and uglier than this, but I managed to reduce the problem to this on a breadboard)

The diodes in question are big schottkys, and the datasheet describes them as perfect for ORing power in redundant setups. Hmm.

How do I go about countering this?

howiem:
… even if only one battery is connected, I’m reading the same voltage at A and B, relative to ground.

What are you reading with? A voltmeter, an analog input on an Arduino?

(My circuit is bigger and uglier than this, but I managed to reduce the problem to this on a breadboard)

I take that to mean that you implemented the circuit that you’ve shown - a simplification of some other circuit - on a breadboard, and that you find the effect that you describe on your simplified circuit. In particular, you’re not showing us a simplified schematic, and reporting results you got on a more complicated circuit. Is that right?

Here are some experiments that I’d suggest:

  • Substitute a resistor for one of the batteries. You don’t mention the battery voltage, so I can’t suggest an appropriate value - pick something that will draw a milliamp or so. Do you still read the same voltage on points A and B?
  • Install two batteries, and measure between points A and B with a voltmeter. Does it read zero? How does that compare with the voltages of the two batteries when measured outside the circuit?

I suspect that you’re seeing one of these effects:

  • The reverse-biased schottky diodes are a bit leaky. The datasheet, here - http://www.vishay.com/docs/94325/94325.pdf - suggests that they are. The leakage current across the reverse-biased diode is a lot higher than the leakage through the voltmeter, and, with almost no reverse current through the diode, the voltage across it is close to zero. So, you see a voltage at the two anodes as being very nearly identical.
  • With two similar batteries installed, the internal resistance of the batteries lets them share current - they both conduct - and the voltage at the positive terminal of each battery will be almost the same. They’ll differ by the difference in the forward voltages of the diodes, and that won’t be much.

How do you expect the circuit to decide which battery to use? If they have similar voltages, it will draw current from both of them.

What are the battery voltages, and what’s the current drawn by the load?

Hi, if you want to measure battery voltages, do it at the positive terminal of the battery concerned not on the other side of the isolation switch.
If switch A is off, then point A will not be battery A's voltage. Same with B.

Tom..... :slight_smile:

tmd3:

howiem:
... even if only one battery is connected, I'm reading the same voltage at A and B, relative to ground.

What are you reading with? A voltmeter, an analog input on an Arduino?

A voltmeter at the moment, with the intention to move it to the Arduino.

(My circuit is bigger and uglier than this, but I managed to reduce the problem to this on a breadboard)

I take that to mean that you implemented the circuit that you've shown - a simplification of some other circuit - on a breadboard, and that you find the effect that you describe on your simplified circuit. In particular, you're not showing us a simplified schematic, and reporting results you got on a more complicated circuit. Is that right?

Yes - this is the full circuit, more or less:

My problem was that even with a single battery connected, volts appeared at all three of the Arduino's analog inputs. So I built the simplified version, just a couple of diodes on a breadboard, to try and work out what's going on.

What are the battery voltages, and what's the current drawn by the load?

The battery voltages are between 11 and 15 volts. While the house draws a fair load (4-5A typically), my little problem circuit (in the pink area) only needs to provide around 100mA to drive the Arduino, an LCD, an nRF transceiver, several current sensors etc.

From what you've suggested, I think my mistake has been to use big chunky (and leaky) schottkys rather than something smaller. I thought - hey, schottkys are like super-efficient, only a tiny voltage drop so they'll do fine. And I have a box of them. But they're way bigger than I need.

I'll try some smaller diodes. I'm curious, though, say I had a simple battery backup circuit going on:

... and I want to be able to measure the voltage of the backup battery with an Arduino (so, a high-impedance input), what characteristics should I look for in a diode?

TomGeorge:
Hi, if you want to measure battery voltages, do it at the positive terminal of the battery concerned not on the other side of the isolation switch.
If switch A is off, then point A will not be battery A's voltage. Same with B.

Tom..... :slight_smile:

Hi Tom, my problem is I need to constantly monitor the battery voltages so I can switch between them intelligently, but my battery monitor circuit [Arduino] needs to be powered regardless of the battery state. From what tmd3 says, it seems I may be using inappropriately large/leaky diodes.

Hi, try good old 1n4001 or up to 1n4007,standard silicons and see if any different, will prove if shonkies (sic) are a problem.

Tom… :slight_smile:

howiem:
My problem was that even with a single battery connected, volts appeared at all three of the Arduino's analog inputs.

Sounds like the diodes are leaking a bit. This datasheet - http://www.st.com/web/en/resource/technical/document/datasheet/CD00001327.pdf - says that the STPS20L15D will leak about 6 mA with 15V reverse voltage. That's not too far from the reverse voltage you have with no battery in place. To get 12V through the 100K potentiometers shown in the drawing, it takes only 120 microamps. There's likely plenty of leakage.

what characteristics should I look for in a diode?

Adequate reverse voltage, [Edit: add this] adequate forward current, and low leakage. As the other Tom suggests, 1N4001 through 1N4007's fit the bill. This datasheet - http://www.diodes.com/datasheets/ds28002.pdf - shows a leakage current of about 5 microamps at 25C at rated voltage of at least 50V for all of them. They have a higher forward voltage than the Schottky's. They look great for a test, though, and, at 100 mA load, they don't burn much power, so they may be a good choice for a permanent solution. They're inexpensive and ubiquitous, too.

If your intent is to verify the fitness of the battery to serve the load, a reasonable course might be to disconnect the load via a relay; then connect the expected load to the battery using maybe a transistor, resistors and a digital output; and then measure the battery voltage. More hardware, though.

Note that there's no mechanism by which the system selects the active supply. Depending on each supply's actual voltage and internal impedance, it may be that the one with the highest voltage delivers power, or it may be that they all do. When the house power fails, it may be that the batteries are already on their last legs, having supplied the load until they couldn't overcome the diode any more. It may be that you're not yet be finished with this design.

The device shown in the very first picture - it has the (common) cathode shorted to one of the anodes.

(A1-K A2)

Umm, no!

That is how the leadframe is. It lacks the "ST" logo - it appears to be a brand variant of the original device.

Reverse leakage .... don't use schottkys for this, schottkys are mainly for use in high speed switching , they are the worst offenders for reverse leakage...

Hi, I think we need you to post a copy of your sketch, I'm worried that you are not leaving enough time between each analog input read.

Tom..... :slight_smile:

It looked to me that howiem was using that package like a center-tap rectifier, as his drawing seems to indicate, which would account for his “leakage” deal.
So, both legs are the same anode but only the tab is (still) the cathode.
Can’t use one for ‘A’ and the other for ‘B’, if that’s what he’s doing (in re. the “OP”).

Paul__B:
Umm, no!

Hey, Jack Paul_B - you’re getting on my wick.

STPS20L15D.pdf (166 KB)

Here's what looks to be an updated version of the same International Rectifier datasheet: http://www.irf.com/product-info/datasheets/data/stps20l15d.pdf. Unlike the 06/01 version, this one shows only one anode, a cathode, and a "base cathode." It looks like the 06/01 version may have been an error, or maybe IR changed the configuration. My guess is that it's a goof - if were to change the way bit of silicon was connected, I'd give it a new part number, too.

TMD3 is on the money - the big old diodes were STPS20L15Ds. The weird leadframe is just how they came.

Solved the problem, though, using different diodes. I dug a load of different diodes out of some old PSUs and inverters to have a play with, soldering their anodes together, then putting 12V and a multimeter in series with them.

I got a variety of different voltages - apart from some little IN4004s that leak next to nothing. I've rebuilt the circuit with them and everything works fine. The Arduino can read all the power source voltages without any crosstalk / leakage, and is happily controlling the house power again :slight_smile:

TMD3 - your comments about "It may be that you're not yet be finished with this design." is accurate, if only because I tried to isolate and simplify the problem for my question. The house has been running with a similar setup for a couple of years now and it's only now I've been tidying and rebuilding some of the control circuitry that I stumbled into this problem.

The power sources are controlled by relays, with an Arduino in charge but with manual overrides for when I need to fiddle with things. So there's only ever one power source attached to the house at a time, but as the main batteries start to fail, the relay clicks over to the reserves.

All this diodey shenanigans is just to try and keep the Ard powered no matter where there's a bit of power left, and to be honest, even if it fails, the relays are wired such that the fallback option is always the safest (car batteries).

So I've gone from this spaghetti:

to this slightly more ordered spaghetti:

(I should note, because you're an eagle-eyed lot, that all this is all low voltage, not mains, and the MCBs are acting as switches, not fuses. Everything is fused sensibly too)

The house is running on solar automatically again, thanks to you guys, no need for me to keep running up the ladder to switch between battery packs. And my wireless monitors work again, yay! (those nRF modules rock)

Much appreciated - I've learnt a ton. Diodes do let current go both ways, who'da thunk it :wink: