Corbin's Treehouse - Corbin Dunn, Santa Cruz, CA
Plug Bug

Archive for 2012

Plug Bug: Bad cell

Well…lost a good post on my bad cell.


Long story short: one cell has been sagging really badly, so I replaced it. About 20,500 miles.

The bad cell had high resistance, and was swelling at the top slightly. The cells were never really abused. Never overcharged (although, at first I was charging them to 4.0v, per the spec that came with them. I now charge to 3.7 or so).


Plug Bug: Transmission replaced

Some updates on the electric bug. Back on Thanksgiving I was on a slight hill pointed downwards (at Nathan’s house). I put the car in reverse, but missed the gear and stepped no throttle. The car didn’t move, but the motor sped up quite a bit, however, I couldn’t hear it. I slammed it hard into reverse, without using the clutch, and the car made a big “thunk” noise as it went into gear really hard. Ever since that happened, the car would not stay in second gear, and kept popping out quite frequently. It appears I damaged the tranny.

So, I got a new one from Bugformance. Not cheap, as it was about $1000 out the door with a few seals and new gear oil (and that is excluding the $300 core deposit). I could have probably got one online for cheaper…but then I would have had to wait a few weeks without driving the car (or driving it in a rather unsafe manner).

I always have to re-remembrer how to do things, and it took me a while to get the old tranny out:


Then stick the new one on. It went in pretty easily. The new tranny is rebuilt with the gear ratios (1st-4th): 3.8, 2.06, 1.32, 0.89. The casing was quite a bit beat up compared to mine…but I didn’t really have a choice.


So far, so good. This all happened a short bit before 20,000 (electric) miles:


Photography: Uni up the pass

Uni up the pass, Switzerland 2012


BMS Display part 4 – graph

I updated my BMS display software to actually respond to the buttons I have. Now I have another screen of data, graphing each cell. The graph goes from 2.0v at the bottom to 4.0v at the top and shows the min and max cell numbers (and the voltage). My cell #38 is dying. It is starting to trip my BMS when my pack is only 50% charged. Actually, it shouldn’t be tripping the BMS because it does sag to a pretty low voltage, but it always comes back up to > 3.00v when resting (i.e.: under no load).

The updated display:


The code is also on github for my user corbinstreehouse.

Here is a video of it in action. Sorry, it is shaky, but that is because I’m holding my phone in one hand while driving a small mountain road.

My bad cell can be seen in this screen shot:

Screen Shot 2012-11-25 at 8.44.36 PM.png
It is sagging to 2.57v under load! I draw the line in red when it is less than 2.8v, and orange when it is less than 3.0v (and green when under normal voltage).

How to make an Elithion BMS Display

Here is directions to make your own Elithion BMS Display. Use at your own risk!


Parts required:

Arduino UNO – (the Leonardo will NOT work) – ~$30
Sparkfun CAN Bus shield– $45
Adafruit proto shield – $12.50
Adafruit 2.2″ TFT LCD Display – $30
Extra long male/female header pins for the Arduino
8 wire shielded cord – $3 (Frys Electronics)
Serial port + wire to tap into your can bus (or plug directly into the Elithion CAN bus output)

NOTE: this project could be made *much* more cheaply by using a different display, and making your own CAN Bus setup instead of using the shield. I finally have enough hardware experience to probably do that at this point, but the above parts made this project really easy.


Read my concept Part 1, research notes Part 2, and see Part 3 pictures. For simplicity, I’m going to let you decide how to connect the things together with wires/plugs, and I’m only going to show where the wires go to.


1. Use the extra long female header pins and solder them to the proto shield. This allows you to plug it on top of the arduino and stack the shields.

2. Wire the protoshield to the display. See the adafruit tutorial for information/details, and wire it how they say. However, connect the CS pin on the display to pin 3 on the Arduino UNO. This pin can be changed to any pin you like; you will just have to modify the code in BMSDisplay.cpp to what you choose:

#define DISPLAY_CHIP_SELECT 3 // the only variable pin (usually pin 10, but we want it on 3, as the Can bus shield uses 10 for chip select)

#define DISPLAY_RESET 9 // Don’t change

All these pins can be seen in the initializer for the UTFT display in code:


In my shield, I wired up each pin to the display using a little connector I got at Fry’s. It plugs into the right side of the shield, and I use red jumper wires to connect each pin.

3. Tap into your CAN bus on the Elithion. Take a look at the CAN bus shield schematic — specifically, the top right section shows the DB9 (serial) plug. The serial port on the shield needs to have 4 wires plugged into the Elithion Can BUS output: 5V+, Can High, Can Low and Ground. You can either solder these directly onto the Can Bus shield, or use a serial port and length of wire to allow it to easily be plugged in and out. Look at the schematic to see which wire goes where if you are using the serial (DB9) plug.

4. Compile my code and upload it to the Arduino UNO. Hook the Arduino up via USB. This step requires you have the Arduino software installed. And the appropriate libraries that i wrote/modified. On my Mac, the Libraries are installed in ~/Documents/Ardunio/Libraries/ –I think this is the “Sketchbook location” option in the Arduino app’s preferences (IE, mine says: /corbin/Documents/Arduino).

4A: Copy UTFT_Adafruit_22TFT to your Library folder.
4B: Copy ElithionBMSCanBus to your Library folder.
4C: Download the ElithionBMSDisplay main project and put it wherever you want (usually ~/Documents/Arduino, but it doesn’t matter as much).

On a Mac, open BMSDisplay.xcodeproj in Xcode. Make sure you have the Upload scheme selected:
Screen Shot 2012-11-23 at 12.10.08 PM.png

and do a “build” in Xcode. This builds and uploads the code to the Arduino.

If you don’t have a Mac, you can probably rename the BMSDisplay.cpp file to BMSDisplay.pde and open it up in the Arduino app and compile/upload it. I haven’t tried this though, so it might not work.

5. Plug the shield into the Arduino UNO, and then the Can bus shield on top of that. Hook up the display wires. Hook up the CAN bus wire to the Can bus shield. Turn on your car; the Arduino will be powered by the can bus v+ line.

Elithion BMS Display – part 3 pictures

Elithion BMS Display in my car, showing the basic features (State of Charge, amps out or in, pack voltage, min/avg/max cell voltage):



Notice there are 5 buttons below; those will be wired up to the arduino to control more functions, but for now, the 1.0 release seems to be working well enough. The display shows errors/warnings at the top when they occur (and given that I have a dying cell, I see them). For example, here it is showing what happens when it can’t find the BMS (ignore the lower red line…that was testing):


The display housing is 1/8″ aluminum. I used Sketchup to accurately place all the holes I wanted. The Sketchup file (LCD Layout.skp) looks like this:

Screen Shot 2012-11-23 at 11.32.41 AM.png

I measured for 5 buttons based on a little prototype board, and the 2.2″ TFT display from Adafruit:


I machined out the holes with my mill:

IMG_8962.JPG \

and bent the 90 degree back with a cheap-o Harbor freight brake:


The backside has an indentation to let the buttons stick out, but the bend messed up my clearance:


I solved this by machining out the bottom area more that let the 5 buttons fit on:


They are held in place by some small bolts that I drilled and tapped into place. I actually had to turn the head of the bolts to get them to not hold the buttons up too tight, which prevents them from freely clicking. I may have to tweak how this is done…since the buttons are intended to have a 5v source on one side, which I don’t want to be grounded via the bolts:



The display mounts perfectly, as my holes lined up dead on:


Elithion BMS Display – part 2

I did a lot of work on my display and now it is working!

If anyone else is interested in the code, it is all at

Good information to learn more about CAN bus and the Elithion spec:

PIDs for the Elithion can be found here:

The Can bus shield:

Plug Bug: Charger Control Updates

I made some updates to my charger control project. I discovered my EVSE didn’t like the way I was testing for the proximity switch on the plug latch to be closed. Whenever the Arduino was on, I had the 5v line running through a 2.yk resistor to ground in order to detect it not plugged in. There was another line going into the Vehicle J1772 inlet. That goes into a circuit inside the plug that looks like this:

Screen Shot 2012-11-17 at 8.34.04 AM.png

What happens here is the resistance to ground changes once the J1772 plug is plugged in, and changes again once the latch switch is engaged. The problem I was having is that the ground inside the switch is shared with the 240 AC ground, and also tied to the vehicle ground. The EVSE was noticing that there was some voltage coming off the ground, and after a certain amount of time for not charging would go into a fault state. This caused me to not properly do timed charging!

So, I switched my proximity detection around to use an Arudino digital pin to feed the 5v only when I want to test for the proximity. I removed proximity testing when the timer was not actually wanting to charge, and it fixed this problem.

I also tweaked some of the menus to work a little better. Source is on github.

Elithion BMS Display – part 1

I want a better BMS display for my car. I have the Elithion BMSPro“, which has worked pretty well in my conversion. Sometimes it gives faults earlier than I would want, and sometimes I’ve had bank communication errors that really shouldn’t happen (all connections are tight, and I don’t have excessive noise in my environment). There are a few displays out there listed on the Elithion website. I have the round small one made by elithion; it is lacking in features and doesn’t have the ability to show fine grained state of charge. There are simply 10 bars, and that means at any given time the car could be within a 10% range of state of charge. I want a specific number showing me the SOC. The fault indication is also not very good; the blinking light isn’t very useful other than to give you a warning something is wrong; sure, it warns, but why? you have to hook up another display (like an iPhone) or a computer to see what is up. The “third party”  K & K Multifunction display is large and ugly…and I want something I can control.

So, I’m going to write my own hardware/software combo. I bought:

1. Arduino Leonardo (I have an UNO in my car already)

2. Adafruit 2.2 TFT display— Now I realize you can get much cheaper ones at other locations (oh well)

3. Canbus shield from spark fun

I quickly ran into problems with this basic hardware. The display doesn’t work with a Leonardo unless you wire directly to the ICSP pins on the board (well, it will work in software mode, which is slow). I initially did wire it up, but then realized another problem. The Canbus shield won’t at all work with the Leonardo. It really assumes the ICSP pins are wired based on the UNO spec. So, I went out and bought an UNO from radioshack (expensive! but I wanted one that day).

The next problem was that the demo code for the Adafruit display really sucks. The fonts are horrible, and the graphics are terrible. Luckily, I found a great library called UTFT by Henning Karlsen. It worked with the display I had..but only ran in serial mode. That was going to be a problem, as it was horribly slow, and worse, conflicted with the Canbus shield. As soon as the Canbus shield was initialized the UTFT library stopped working. I realized it was because the UTFT library assumes 100% control of all the pins, whereas I wanted it to share all the pins and use the SPI method of talking (which only requires one dedicated pin to talk to a particular device — this works by having a “Chip select” (CS) pin that identifies when that device is being talked to).

So, I took the time to port the UTFT library to the Adafruit 2.2 shield, by using the (ugly) code from adafruit as a drop in hack to get it working. It took a while, but I figured it all out, and now understand a lot more about the Arduino hardware and how things work with it. (Code available soon)

So now, it is time to read the Canbus spec and get rolling.


In the picture above: Arduino on bottom, Adafruit prototype shield in the middle (hooking pins up to the display), and the Canbus shield on top. I also plan to add some other neat things, like temperature reading and GPS information. That way I can calculate how many miles are left based on the state of charge and what watt/hours per mile the car has actually been getting.

EV Converstions and white Clean Air Stickers

In California, EVs can get a clean air sticker and the right to use the carpool lane while solo (also called the High Occupancy Vehicle lane, or HOV). I love the fact that California is promoting clean energy.


Apparently the DMV has stopped giving out the white stickers to DIY conversions (based on this post from! I think I got really lucky in getting mine. One thing to note from this page on the DMV Website:

12. Q: I want to convert my gasoline powered vehicle to a qualifying fuel type so I can qualify for CAV decals. What are the requirements?

A: Contact ARB prior to conversion to determine if converting your vehicle is possible and follows current law. For more information visit ARB or call 1-800-242-4450.You must obtain a certification from ARB if your vehicle’s motive power was changed as a result of an aftermarket conversion (e.g., gasoline to electric). A copy of the ARB certification letter must be attached to the CAV decal application

So, apparently it might be possible to do so, if you follow the right steps.

We should encourage them to allow more home-brew EV conversions. If you have a conversion, please contact: Ms. Shobna Sahni, (626) 450-6104,

(c) 2008-2017 Corbin Dunn

Corbin's Treehouse is powered by WordPress. Made on a Mac.

Subscribe to RSS feeds for entries and comments.

16 queries. 0.209 seconds.