This details the implementation of a simple battery current meter, as
part of a larger cluster of gauges and indicators. It's part of an ongoing
R&D project [that, in hindsight, occupies a period from early 2005 well
into 2010 and beyond] -- to give a Prius some of the geek-appeal
instrumentation that Toyota doesn't care to provide for the mainstream
driver. Well, not that Prius drivers are particularly mainstream, by
and large, but whatever. This car desperately needs some real *gauges*.
[This is also one of my earliest pages about the Prius, which is why it's
stylistically klunky, and you can probably see some minor evolutionary
changes through later pages on other topics. Over a subsequent update or
two I see no reason to change this page in any profound way; I will always
be a fan of simple, accessible web pages designed to *provide information*,
not be an exercise in fluffy HTML design.]
Overall, the cluster currently has a vacuum gauge [aka "how hard is the
engine working"], a tach, a voltmeter for the aux battery, and the current
meter. The panel itself and many of the other parts are part of a completely
rebuilt dashboard from a project-truck I was doing over 20 years ago, and
it's ironic that much of this first saw light of day in something that got
12mpg with a good tailwind. I'm not one to throw stuff like this away so I
still had it all around. The triangles of LEDs, originally for directionals,
will eventually become some other sort of indicators -- I'm thinking to
mirror the U/V/W phase drives to MG1 and MG2 with them.
The little black-taped bar down in front of the panel is a piece of plastic
with some LEDs glued on top, for illumination at night. A complete kludge,
but it works well enough.
Back view of the cluster through windshield. Much still remains to be filled
in, but this whole unit just lifts right out and can be taken back into the
shop for mods and additions. At this point in time, things are just sort
of kludged in for proof of concept. What's nice is that visually, from
driver's eye to lower edge of windshield, there's plenty of room to drop
something in here and not interfere with any sightlines.
Getting the vacuum line up to the dash was a *bitch*. There are a couple
of obvious spare passages through one of the two firewall glands on the
right-ish where wiring passes through, which appear to be the proper
"official" way to penetrate the firewall, but getting *to* either side of
this area involves, in the words of a friend who's installed too many car
stereos, an intense session of kundalini yoga. In this case the gland is
way behind the engine block in front, and up behind the air-conditioning
box inside. But there's a convenient vacuum tit on the right side of the
intake manifold, normally sealed off with a rubber cap, and the firewall
gland isn't too far from that, so it all seems entirely appropriate. Six
feet of hose still isn't quite enough to reach across to the gauge, though,
once a certain amount of length is used up getting through and heading up
behind the air-conditioner.
But I didn't do this page to talk about vacuum gauges. This is all about
having a simple, realtime visual indication of current into and out of the
battery, to get a better idea of where some of the system's energy is going.
There are times when the MFD shows battery charging, but the SOC doesn't
rise. So, a tool to ferret out what's going on is clearly needed.
There are a couple of options for sensing current. Resistive shunts are
old-school, involve invasive cutting of a lead, and have many accuracy
and thermal issues. Hall-effect sensor modules with built-in conditioning
electronics are commonplace now, and in fact the Prius uses them for its own
current-sensing needs. Magnetoresistive sensors are also gaining popularity
but those are probably still a bit too exotic for this relatively simple
need. So it boils down to: buy a completely separate sensor and wrap the
right electronics around it, or tap into the existing one? Clamping a sensor
around one of the orange wires just going into the inverter and bringing
the output right through to the dash is sort of appealing, but subsequent
information has tipped the choice over to simply monitoring the same input
the battery ECU does. I also save on not springing $20 or more on an extra
sensor and the glue to power it, and since most of the modules are one-piece
donuts that don't actually *clamp*, it avoids having to mess with the
battery leads at all to thread another sensor on.
There is prior art in the "tap the sensor" area, described in Graham
current meter page for a first-generation car, and a little research
indicates that it's the correct approach for this one as well.
The first problem, of course, is getting at the battery electronics.
The hybrid battery box is under the panel just behind the seat backs...
which is difficult to remove, in fact; besides the two luggage hold-down
ring bolts, there are three hidden plastic clips in a triangle across the
top of the pack, and unclipping those without breaking them is an interesting
bit of plastic-bending. But as most other panels and parts inside the car,
it's all just bendable plastic and with a little careful persuasion, pops
Down to the bare-metal battery box. That topmost bracket on the left seems
structural in some way -- connects very sturdily to the LHS shock-tower and
under the seat. Almost like it's designed to lift the battery box up out of
the way during a severe frame-bending side impact or something.
One *does* want to do most of this work with the service plug removed, per
the many loud cautions in the service manual about working around the high
voltages. But of course for powering things back up and testing, everything
has to remain connected and live. Working around this stuff is not really
that different from working around household electricity -- certainly to be
respected, but it's not going to leap out and zap you unless you do something
stupid. The innards of TVs and monitors are probably more dangerous, and
I'm well used to working on those too.
A few bolts later, along with displacing the back seat and left trim panel,
we've got the business end of the battery box open. It's conveniently under
a separate piece of covering metal, so the batteries themselves remain
covered. The white current-sensor donut is attached to the forward wall at
the left, with the lowermost orange wire run through it.
Oooh, the service plug seems to be back in! Danger, will robinson! Here
we are powered up and live, and what's with that paper clip hanging out
of the computer??
The paper clip, in fact, is a quick-n-dirty tap of the yellow wire that
brings the current-sensor output to the ECU. Initial readings to confirm
Wayne Brown's earlier findings can be taken this way. The sensor's power
is +5 and ground; its output sits at 2.5VDC and swings higher or lower
depending on magnitude and polarity of measured current. I couldn't find
any specific info on the Denso part# 131400-0050, but the LEM Electronics
HAIS-200-P or the Tamura L01Z200S05 work almost identically so it seems to
be fairly standard operation. With the wire run through as in the Prius,
negative voltage swing means charging, positive means discharging. That's
exactly how the meter will work -- when speaking of "battery current", one
should think of it supplying power as "positive". Obviously, if the donut
were 180ed or moved to the other lead, the output would swing opposite, but
then the brain-box would be *very* confused.
About to start the real installation. Tools brought out, the box open,
wires hangin' out in the breeze, a HOT SOLDERING IRON sitting on top of
the battery pack ...
To make life easier I simply remove the contacts from the current-sensor
plug. The wedge-like "official tool" that Toyota recommends making a few
of is sitting there next to it, and it *does* work really well. Once the
leads are out of the connector and separated, it's easy to slit the insulation
and lay bare just enough of the wire to attach the tap harness to.
The main relays are right here; they're mounted at rather odd angles. The
whole battery box has a cheezy, non-deburred feel to it, like those cheap
PC cases that you can cut yourself to ribbons working inside of. And those
connections look to me like they can just *barely* deal with 100 amps. The
pack is fused for 120A in the service plug.
Tap leads spliced in and taped, ready to sleeve up and reassemble.
The output connector is also shown. The sensor output is fairly low
impedance -- maybe 100 ohms internal resistance, typical of an op-amp
output stage, but just to be safer I take it through a 1K resistor so
that if something bad happens downstream, it won't affect the ECU's
idea of what's going on. I would use a higher value except that my tap
has to run all the way up to the dash, so it should be able to swing a
solid signal through a long [albeit shielded!] cable.
This is a change from the original idea of dropping the entire buffer circuit
*here* in the battery box. It's now all up at the cluster, making it more
accessible. After determining the relative "strength" of the sensor's output,
I figure that it's safe to run externally as long as it's nominally shielded
and protected against transients. Other people have confirmed this, too.
And here comes the cable that will carry sensor output and +5V to the dash.
It's a piece of old balanced mic cable -- 2 wires + shield, and a robust
sheath that can protect itself fairly well against most physical quirks of
the route it takes. The matching male connector for the tap harness is
soldered on and beaded with a little hot-melt for insulation and rigidity.
After being plugged together, the entire connection is loosely wrapped in
gaff tape and shoved down behind the ECU.
The output wire routed around past the left end of the back seat, and along
the door-edging trim toward the front along next to the stock harness.
Almost finished the run to the front. The wire next dives in under the kick
panel and thence upward to the dash. It's pretty easy to run through all
this stuff, including behind the panel on the middle door pillar. Plenty
of room to end-feed it, even with the connector attached.
The real circuit isn't even built yet. For initial testing, the battery-box
wire arrives here, into a proto-board so the driver circuit can get a "real
life" test before being committed to more permanency. Eventually will go
onto a real circuit board mounted behind cluster, as part of several other
bits of support electronics for subsequent hacks.
The buffer circuit is just a simple pair of op-amp followers; one providing
a fixed 2.5V reference [or more properly, the current sensor's Vcc/2] and the
other buffering the donut output. The op-amps can source/sink 20mA or so and
the meter only needs half a mil at full deflection, so that gives plenty of
stability. Still using the DMM to sanity-check readings. Seeing a nice
solid 2.5V at "ig-on", when no battery current is possible, and so in this
state the reference trimpot is used to zero the meter. We should be done
at this point, but something's not quite right...
A little force-charging. DMM and the analog meter aren't matching very well;
calibration probably has to be revisited and I know the cluster in general
does *not* have a very solid ground connection yet. But for an analog thing
to just swing around and show approximate flow, it's good enough for now.
Close up of the meter. I have no clue where I trashpicked this thing, but
it's perfect for reading +/- 100A in this case. With an 1.8k series resistor,
it's pretty much a +/- 1V FSD voltmeter to read the buffered current-sensor
output deviation from 2.5 V. Basically, one volt output deviation == 100A.
Slightly more than forward creep, but not quite enough to overcome the
parking brake. Surprisingly little current appears needed for a gentle
And even in its kludged, under-construction state, the panel looks totally
cool at night!
The simple circuit to read the current sensor output and drive the meter.
The 5V supply is only used to derive the reference voltage; the op-amp
power comes from the normal 12V. I was originally going to use the 5V for
power too but the non-rail-to-rail op-amp can't drive *quite* high enough.
Fortunately, the 324 *can* get within one junction of negative, so there's
plenty of headroom there to read a -100 amp level.