SOC Meter for One-CAN Logging & Graphing

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

garygid

Well-known member
Joined
Apr 21, 2010
Messages
12,469
Location
Laguna Hills, Orange Co, CA
SOC-Meter without Logging Port:

DSCF0119-20.jpg

Introduction:

Our SOC-Meter is ALSO programmed to send all the monitored CAN-messages
back to a PC to be Logged, Graphed, etc. The SOC-Meter is a one-channel
device, so it only monitors one CAN bus at any given time.
However, we usually wire both the EV-CAN and the Car-CAN bus
to a left-side CAN-Selector toggle switch.

The messages are being sent out the AVR-CAN's unused
female 9-pin "D" connector, which is an RS232 serial port.

When Logging, it is best to leave the meter in its "SOC mode",
to reduce the CPU load in the SOC-Meter.

We can add a "Logging Port" to the SOC-Meter Box, connecting
just three wires to the AVR-CAN board's 9-pin D-sub connector, which
is not normally connected to anything when building the SOC-Meter.
Then, logging of the entire EV-CAN bus message-stream is relatively
easy and inexpensive, once you have the SOC-Meter (or equivalent).

You need:
1. a portable Windows PC that can run my free CAN-Do program (XP, Vista, Win7),
2. some might want/need an "automobile" 12v power adapter (often $10 to $20)
for their PC for any longer-duration recording sessions,
3. my free CAN-Do program, downloaded from http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;
4. a high-speed RS232 Serial port on the PC, or a sufficiently GOOD
USB-to-RS232 adapter and an available USB port on your PC.

I have some inexpensive (under $5) adapters, but only a few
appear to be OK for CAN-Logging at 115,200 baud.
Most are not quite sufficient for consistant "flashing" of the AVR-CAN board,
or for reliable high-speed communication (our CAN-Logging).

So, for a few dollars and some modest effort, you can actually
LOG and GRAPH your own Charging or Driving data,
saving a LOT of hand-logging effort while driving the LEAF.
And, it is a lot safer to keep your eyes on the road, and examine the data later.
 
Equipment:

You will need:
1. An SOC-Meter or equivalent
2. A portable Windows PC that can run my free VB6 CAN-Do program (XP, Vista, Win7)
3. The CAN-Do program, a free downloaded from http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;
4. A GOOD (about $25) USB-to-RS232 adapter and a USB port (**)
5. Some may want an "automobile" 12v power adapter for their PC (***)

------------
(**) If you have an RS232 Serial port on your PC, a serial extension cable,
(female at the PC end and male at the SOC-Meter end) could be used.
However, few laptops have real RS232 ports, so the USB adapter is usually easier.

(***) Your laptop battery might be insufficient for longer recording sessions.
 
Setup and Test:

NOTE: It is best to download and use the CAN-Do program FIRST, to see
that it will run on your PC, and to get familiar with using it. Use the
Log file and Recipe file and graph some data of interest.

1. Connecting the SOC-Meter (AVR-CAN Board) RS232 Port to the PC:

a. If the AVR-CAN board is exposed:
Just plug the USB-to-RS232 adapter into the board's unused female 9-pin "D" connector.

b. Logging Port Addition:
Install a "Logging Port" on the Right End of the SOC-Meter box, and add three wires internally to connect the external port to the female 9-pin D-sub on the internal AVR-CAN board.

c. Minimal Change to SOC-Meter:
If the AVR-CAN board is already enclosed in the SOC-Meter Box:
Only two wires are required (three recommended), Ground and the Data-to-PC line (and Data-from-PC line).
Drilling two (or 3) small holes (or making two (or three small
notches) in the Right End of the meter box should allow pushing two (or 3)
properly-sized wires into the female 9-pin "D" connector on the AVR-CAM board and getting those wires out of the box.

Then, add an external female 9-pin "D" connector (and a hood/shell),
connecting to the two (or 3) wires coming out of SOC-Meter box
(from the AVR-CAN's female 9-pin "D" connector).

Plugging the USB-to-RS232 adapter into the added external "D-sub" connector.

Pin 5 is Ground, and pin 2 is data transmitted FROM the AVR-CAN board.
Currently unused, pin 3 is data from the PC TO the AVR-CAN.

2. Set up the PC COM Port and Data Baud Rate:

After the USB-to-RS232 adapter is plugged into the PCD and a driver
(if necessary) is properly installed, the Device Manager shows the adapter
as a COM Port, perhaps port 5 (click the Advanced button on the
Port Settings tab and note the assigned port number).

The data format should be "8, none, 1" (eight Data bits, no Parity bit,
and one Stop bit), which is usually the default for the PC,
and set Flow Control = "None".
The baud rate is relatively fast, 115200 bits per second, to better keep up
with the (sometimes many) CAN bus messages (about 1,000,000 per hour).

3. Start the CAN-Do program (version 1.5.1 or later), and use
the "IO Control" page to set up the Comm Input for EV only
(uncheck the other two), enter the COMM Port number, and
check Show Counts. You are now ready to capture some CAN messages.

4. Start Gathering CAN-Messages:
(in any order)

a. Plug the SOC Meter into the LEAF's OBD connector,
b. Power on the LEAF
c. Power on the SOC-Meter
d. Click "Read Comm" button on the IO Control screen.

5. Stop Gathering CAN-Messages:

a. after seeing the EV "counts" spin upward for a while
b. click the Stop Input button
c. Click Hide (returning to the main screen)

6. See some of the CAN-Messages:

a. Check the "with Time" and the "with Checkpoints" checkboxes.
b. Click "Get Addrs" and see the list of different message-IDs appear.
c. Click one of the message-IDs in the list, and
d. see those messages appear, with "time-stamp" information.

7. See the CAN-Go thread for more info on using the CAN-Go program.
 
An SOC-Meter Logging Kit
1. three short wires, or a 3-conductor "cable"
2. a 9-pin "D" female connector, solder type
3. a Hood/Shell for the 9-pin D connector and/or mounting
hardware for the 9-pin D

Also needed:
1. a "GOOD" USB-to-RS232 adapter cable for a Windows PC,
possibly around $25.

Tentative Logging Kit Pricing:
1. Parts kit somewhere around $10 (may vary)
2. USPS shipping, possibly about $5, if not shipped with something else.
3. Assembly of your Kit, about $10, if desired and applicable.

For a Logging Port Mounted on the Right-End of the Box, you will still need to:
1. Open your SOC-Meter and cut a slot for mounting the 9-pin D.
2. Solder 2 (or 3 wires to the new connector
3. Mount the new female 9-pin D connector on the Right End your SOC-Meter
4. connect the 2 (or 3) added wires into the correct "holes" of the internal connector (see above)
5. close your SOC-Meter
6. test your SOC-Meter stand-alone, then doing logging

For an External Pigtail Connection, you will still need to:
1. Open your SOC-Meter and cut an access hole for the new wires or cable
2. get the wires (or small cable) into your SOC-Meter
3. plug the 2 (or 3) wires into the correct "holes" of the internal connector (see above)
4. close your SOC-Meter
5. connect an external 9-pin D-sub connector, and add a shell/hood
6. test your SOC-Meter stand-alone, then doing logging
 
If you wish to add a new Female 9-pin D connector to the outside
of the Right End of your SOC-Meter project Box, I have drawn a
template hole on a new "Rev 2a" version of the Hole-Template.

Download it for http://www.wwwsite.com/puzzles/socmeter/" onclick="window.open(this.href);return false;

Mounting the connector to the outside of the box requires
a larger hole, as is shown on the Hole-Template.

Mounting the same connector inside the box could also be done,
but the USB-toRS232 adapter cable would have to be one that is made with
enough clearance around the mating Male 9-pin D connector, and many do
NOT have sufficient clearance, or their mounting hardware is female" instead
of male, and the female mounting hardware usually interferes with the case
of the SOC-Meter. So, I suggest mounting on the outside of the box.

NOTE: Instead of mounting a connector on the box, one can put
the connector on a pigtail, in a Hood (shell), and just run the wire,
through a much smaller hole, into the box.
 
I just installed the new "Logging Port" on My SOC-Meter.

1. I opened the SOC-Meter and removed the AVR-CAN board.

2. I drilled the 6 indicated 1/8" holes, and drilled about 9 more
to "almost" drill out the "D-slot" for the connector.

3. Then, I used an eXacto-type knife to finish the D-Slot,
making the edges relatively straight, and the ends sligtly
longer until the larger back side of the female 9-pin D connector
fit into the hole, with the cobbector mounting on the outside of the box.

4. I used some 18 gauge "solid" wire (fatter wire) that fit relatively
well (snugly) into the female holes on the AVR-CAN connector.
I used three pieces about 3 1/8 inch long, stripped 1/2" at the end
going into the female holes on the AVR-CAN connector, and about 3/16"
on the ends to be soldered onto the backside of the new Logging Port conector.

5. Solder to pins 2, 3, and 5 of the Logging Port, and call these wires
#2, #3, and #5 respectively. They will go into holes 2, 3, and 5 of the
female 9-pin D connector on the AVR-CAN board.

6. install the connector on the box. I had difficulty getting the nut
on the inside end of the two mounting screws.

7. Bend the 3 wires in an "S" shape so that they can plug into
the holes (2, 3, and 5) of the AVR-CAN board. When the 1/2" end
of the wire slides into the hole, if it seems "too loose", then bend
a slight curve in the stripped end, and it should be "snug".
These wires each bend 90 degrees downward (into the box) immediately
as they emerge from the connector on the AVR-CAN board, since the
board needs to slide right up next to the Right End of the box.

8. Reconnect the 2x4 and 1x6 "connectors" to the EXT2 header
on the AVR-CAN board.

9. Insert the 3 "Logging Port" wires into holes 2, 3, and 5 of the
female 9-pin D connector on the AVR-CAN board, with #2 to 2,
#3 to 3, and #5 to 5 (of course).

10. Move the AVR-CAN board almost into place, and connect the
9-pin D that carries power and the CAN-bus signals.

11. Check for wiring shorts, etc. as you put the board back in,
especially around the Zener Diode.

12. Install the lid.

13. Carefully test the SOC-Meter, and then
use CAN-Do to test the new Logging functions.

Cheers, Gary
 
Tested with my latest version 1.51 of CAN-Do, found at:
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;

The Logging Port on the SOC-Meter ver F1.08 seems to work fine with CAN-Do
only IF you use a GOOD USB-to-RS232 cable, but NOT if you use a POOR one.
 
The Logging Port on the SOC-Meter (ver F1.08) seems to work fine
with CAN-Do (v1.52) ONLY IF you use a GOOD USB-to-RS232
adapter cable, but NOT if you use a POOR one
.

Using a POOR USB-to-RS232 cable, I got what looked like "garbage" messages.
Also, I "received" only about 100 messages in 15 seconds, not the normal
message rate that is more lke 300 to 500 messages per second!

So, make sure you get a "good" USB-to-RS232 adapter.
Those with the latest FTDI chip MIGHT be the better ones.

-------------- What Adapter IS Good? -----------------
Yes, I bought one of these.
I tested it for Logging on two different (F1.08) SOC-Meters
with Windows Vista, and it seems to work well.

A. The "USB to RS232 Serial DB9 Serial Cable FTDI ... Windows 7 ..."
(item RPC-USB-RS232-3M for $24.95 inc. shipping)
from http://www.valley-ent.com" onclick="window.open(this.href);return false; (Search for USB RS232) to get this:
http://www.valley-ent.com/catalog/rs232-serial-cable-adapter-ftdi-chipset-feet-p-530.html" onclick="window.open(this.href);return false;

It is also available from http://www.amazon.com" onclick="window.open(this.href);return false; and all 5 reviews are 5-star:
http://www.amazon.com/Serial-Adapter-Chipset-Supports-Windows/dp/B003N9TYW0/ref=sr_1_3?ie=UTF8&qid=1317486328&sr=8-3" onclick="window.open(this.href);return false;

It has a 10-foot cord and male attachment hardware (both convenient).

Valley Enterprises Int'l, LLC
3951 South 3300 West
Rexburg, Idaho 83440
phone: (208) 356-4785
[email protected]

Yes, the $25 is more expensive than many $5, $12, ... adapters,
but this one worked without even installing a driver on my Vista 32bit laptop.

-------------- What Adapter MIGHT BE Good? -----------------
No, I have not tested any of the following.

However, I would try #4 first (or #2), I think, if you cannot get,
or do not want adapter "A" listed above.

1. This "Windows 7 Compatible USB Serial Adapter FTDI Chip
RS232 DB-9 920K with TX/RX LED" MIGHT be good, but it
only has a short cable, and has female attachment hardware.

$18 at Amazon:
http://www.amazon.com/Windows-Compatible-Serial-Adapter-RS232/dp/B004WLA4P4/ref=sr_1_2?ie=UTF8&qid=1315460244&sr=8-2" onclick="window.open(this.href);return false;

2. This "36inch FTDI USB to Serial Cable for MA PC Linux with Windows Certified Drivers" has a 3-foot cable and appears to have the male attachment hardware (desired).

$19 at Amazon:
http://www.amazon.com/36inch-Serial-Windows-Certified-Drivers/dp/B004WM1WUY/ref=sr_1_6?ie=UTF8&qid=1315460244&sr=8-6" onclick="window.open(this.href);return false;

3. This "6ft. USB to RS232 Converter for Windows 7 (32/64bit) FTDI CHIP RX/TX LED" has a 6-foot cable, but has the female attachment hardware that might not mate well with the SOC-Meter's Logging Port mounting hardware.

$20 at Amazon:
http://www.amazon.com/6ft-RS232-Converter-Windows-64bit/dp/B004I6594Y/ref=sr_1_7?ie=UTF8&qid=1315460244&sr=8-7" onclick="window.open(this.href);return false;

4. This has a 10-foot cable and has the male attachment hardware (that we desire): "USB to RS232 Serial DB9 Cable Adapter FTDI Chipset 10 Feet Supports Windows 7 64bit"

$25 at Amazon:
http://www.amazon.com/Serial-Adapter-Chipset-Supports-Windows/dp/B003N9TYW0/ref=sr_1_14?ie=UTF8&qid=1315460244&sr=8-14" onclick="window.open(this.href);return false;

5. For those wanting to do 3 or 4-bus CAN logging, this "4 Port RS232 FT4232HL Professional USB to Serial Adapter with TX/RX LED and COM Retention FTDI Chip & Fast 920K Per Port Transfer Speed Certified Microsoft Windows 7 and 2008 Driver Included (32/64-Bit)" might be quite good.

$45 at Amazon:
http://www.amazon.com/FT4232HL-Professional-Retention-Certified-Microsoft/dp/B004ETDC8K/ref=sr_1_5?ie=UTF8&qid=1315460244&sr=8-5" onclick="window.open(this.href);return false;

-----
 
If you get and test one of these USB-to-RS232 adapters, please let us know your results.

Or, you could buy one (or more), have it (them) sent to me, and arrange with me to test it (them) before I send it (them) to you as part of your SOC-Meter Kit (with Logging Port).
 
This afternoon I posted an instruction sheet for
adding the Logging Port to your SOC-Meter.

See http://www.wwwsite.com/puzzles/socmeter/" onclick="window.open(this.href);return false;
 
See the 8th post for a USB-to-RS232 Adapter that works, $25 from:
http://www.valley-ent.com" onclick="window.open(this.href);return false;

10-foot cord, male mounting hardware, black, FTDI,
and they say it works with all modern Windows.
 
Yes, this $25 adapter is more expensive than many $5, $12, ... adapters, but
this one worked properly (without even installing a driver) on my Vista 32bit
laptop when doing the high-speed (115200 baud) Logging from the SOC-meter.

Having bought and tested this one, and since it has the right features
and good specs:

----------------------------------------------------
USB to standard 9-pin / DB9 serial port
Full Compliance with USB 1.1 and 2.0
Supports RS232 serial interface
Supports RS232 Serial DB9 devices
Supports over 1Mbps data transfer rate
Supports remote wake up and power management
Length: 10 feet
USB Chipset: FTDI
Supports: Windows 2000, Windows XP (All), Windows Server 2003, Windows Vista (All) , Windows Server 2008, Windows 7 (All), Windows Server 2008 R2, Linux and Mac OS X.

For list of drivers click on link below.
[They have a link to download drivers, if needed.]

----------------------------------------------------
A. The "USB to RS232 Serial DB9 Serial Cable FTDI ... Windows 7 ..."
(item RPC-USB-RS232-3M for $24.95 inc. shipping)
from http://www.valley-ent.com" onclick="window.open(this.href);return false; (Search for USB RS232) to get this:
http://www.valley-ent.com/catalog/rs232-serial-cable-adapter-ftdi-chipset-feet-p-530.html" onclick="window.open(this.href);return false;

It is also available from http://www.amazon.com" onclick="window.open(this.href);return false; and all 5 reviews are 5-star:
http://www.amazon.com/Serial-Adapter-Chipset-Supports-Windows/dp/B003N9TYW0/ref=sr_1_3?ie=UTF8&qid=1317486328&sr=8-3" onclick="window.open(this.href);return false;

It has a 10-foot cord and male attachment hardware (both convenient).

Valley Enterprises Int'l, LLC
3951 South 3300 West
Rexburg, Idaho 83440
phone: (208) 356-4785
[email protected]
----------------------------------------------------
 
Over the weekend, I took the plunge and did the data port installation and upgrade. The instructions were great and one absolutely needs the wiring diagram to be successful. It's not the best installation job in the world as I got a little too zealous with carving the hole for the DB-9 connector (using a combination Dremel tool with grinding bit and razor knife). But my solder joints aren't cold and everything is working great at 115,200 baud. I guess that $40 Gigaware USB to Serial Adapter I got at Radio Shack (in desperation, I might add) paid off. At the end of the day, I made a 15 minute test run covering about 6 miles using CAN-Do V1.52. It was great to see the dashboard changing in real time and the graphs were quite interesting.

Any way to use CAN-Do to extract the CAN EV files to an Excel spreadsheet for creating graphs with axes?
 
1. See the $25 USB-to-RS232 adapter that was tested (two posts above).

2. No data "extraction" yet, but it could be added. But, would Excel be able to handle 2 million data points?

3. Axis info will get added before too long (I hope).

4. I want to show any "event" checkpoints on the graph before long. I will probably add these just after clearing the plot.

5. The present horizontal axis is simply message number, rather than a more-proper "time" axis. But, it works well enough for now.
 
Hey

I need to log the vehicle SOC and rate of current charge/discharge from the battery pack, as well as vehicle speed...any advice on how to do that?
 
TonyWilliams said:
tamoora said:
Hey

I need to log the vehicle SOC and rate of current charge/discharge from the battery pack, as well as vehicle speed...any advice on how to do that?


What are you building?

I am trying to build a Neural Network where I input vehicle speed, discharge rate, and SOC and it outputs powertrain efficiency...some sort of a reverse efficiency map
 
Initially run my CAN-Do program on a Windows PC with a downloaded Log file and Recipe file, from:
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;

Get familiar with it and what it can do.

Then, use it with a "logging" SOC-Meter to capture and log EV-CAN message data from driving.

You can even see that data real-time on CAN-Do's "Dashboard" screen.

The Recipies show Pack Amps (and Volts), GIDs (as "soc"), and RPM (for speed).

With CAN-Do you can capture the message data, write it to an EV-Log (.evc) file, and extract just the values of interest to a ".csv" file.

Run that through your analysis program.

Later, you can write a program to process data in real time, if that is of interest.
 
Back
Top