WattsLeft™ Monitor (Parallax SX28AC/DP SOC/CAN Project)

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.
EXCELLENT ! :cool:

A couple of suggestions/ideas:

1. Is there a way to mount this in the sunglasses case so that it can be hidden ? ( Even if the original swivelling cover would have to be removed, replaced with something else that could be used to hide/close it when parked. )

2. For an event that last 10hrs or more (e.g. L1 charging) you could use letters (A, B, C, etc) for the single digit indicating the hours.

:)
 
With the sunglasses case open it blocks part of the view to the rear window. It also puts the display much closer to your eye. At first glance it does not seem to be a good fit. However, perhaps someone can come up with a clever solution.

How many max hours are you looking for? I use a 16 bit number to store the time so I have two options.

1. Max 16 hours at 1 second resolution displayed as F:59:59 (= 15:59:59)
2. Max 32 hours at 2 second resolution displayed as V:59:58 (= 31:59:58)

The current software has a max of 7:59:58 with 2 second resolution but it can be changed to one of the above. I just need to know which people prefer.

Jim
 
An L1 charge session could take 24 hours, so it's probably better to support 24 hour charge events than to have 1-second resolution. :)
 
Very nice work.

You might add a 2-way multiplex chip controlled by an output pin to
select between the two CAN inputs.

If you do not intend to write to the CAN buses, the transceiver chips can
just be left in "listen" mode all the time.

Where did you find the rear right-angle hood for the OBD connector?

What input voltage range does your regulator chip accept?
What chip did you use?

Again, great work.
 
Gary,
Both EV and CAR CAN chip outputs go to the CPU and can be software selected. So no need for another external chip. Remember, my CAN processor is all software so I can use any input pin to receiver CAN data.

Currently both CAN transceiver chips are left in listen mode but the rev 1.1 PCB does have the option to routine one of drivers to the CPU with a jumper. If I every get daring enough I might write some code to talk to the car.

The OBD connector is one I made from a straight one. It is cheaper than the standard right angle ($3 each) and I can add my own 4 twisted pair cable (CAT-5) going to the logic/display box and 4 wire cable (phone) going to the selector pot. I cut the connector just above the lower two screws that hold the hood together.

Here is a close-up of the install connector. It is about 1/4" shorter than the one you use and the cable exits right next to the socket. In the picture you can see how it could be routed directly up and inside the lower cover panel although I have not done this yet. The flat phone cable is on top with the round CAT-5 below.
obdii.jpg


The DC-To-DC Converter Controller is a PJ34063 and is rated to operate in a range from 3 to 40 volts.

Jim
 
I just completed the full install with all wires hidden and mounted above the rearview mirror. The most difficult part was finding room in the center console for the rotary selector. From the top it looks like there is lots of room but when you turn it over and look at the back almost all is unusable. I had to do some cutting of plastic to make it fit.
consoleg.jpg


Here is the completed cable set ready to be installed.
cableset.jpg


Here is what the OBDII connector looks like with the cable routed up out of the way.
obdiihiddenza.jpg


Here is a side view. Cable runs along headlining then down inside pillar next to windshield.
sideviewzz.jpg


Finally the view from the driver’s seat.
driverview.jpg


I will be taking it out for a test ride to see how well the hanger works.

Jim
 
Here is an option I just came up with for those who do not wish to drill a hole in your console to mount the rotary selector. This small (55x35x20mm) box can be mounted with Velcro within easy hand reach to the left side of the center console (between cup holder and shifter but on the side vertical surface).

controllertop.jpg


controllerside.jpg


One issue I have had with the 2x16 LCD display has been not being able to read it while wearing polarized sunglasses. That may have been resolved today when my wife mentioned she was now able to read the display while driving with sunglasses. I had just finished building the last two prototype etched boards Sunday night and had swapped one into the Leaf for testing. The only difference from the first one was I had not removed the protective film they always place on LCD screens.

I went through the garbage and was able to retrieve the film I had removed from the previous screen. Testing with the old screen that had it removed confirmed that the screen was now readable with polarized glasses totally independent of orientation.

Any optical experts willing to explain why the plastic film has this effect?

The final etched boards with Bluetooth support will be here tomorrow (one week ahead of schedule).

Jim
 
My guess is that the thin piece of plastic is acting as a quarter wave retarder plate. We use these in 3D production to reduce the affects of polarized light and I suspect that it is having the same affect here.

 
Just before 1PM the package of production boards arrived on my door step.

Here is what one seal pack looks like.
sealedpack.jpg


Here it is out of the plastic pack. The six pin connector J3 on the right edge is for the Bluetooth module. Only four pins are normally used but the module supports two more. One is used for an external status LED. The board supports this extra pin with a resistor going to J6 which is just to the left under the left edge of C1 cap.
boardfrontv11.jpg


The back side now has all the surface mount parts.
boardbackv11.jpg


This morning I finished assembling and testing the last of three pre-production boards. The last one had one etching problem where they left copper on that shorted out the DC-DC converter. It shorted +12v to +5v to Ground. It can’t get much worse than that. I did not catch it until I had soldered all the parts in and started testing the DC-DC converter section

After clearing the shorts the board came up find. But now I know to visually inspect each board before I start soldering and do a volt to ground check first.

The three pre-production boards also came with excess solder on each pad which I needed to remove from one pad to mount the SMD parts flat. The production boards are clean and have just a thin film of solder so SMD parts will go on much quicker.

The only part I am missing for the first production run of boards is the RGB LED. I found a place that sells them for $0.16 each instead of the $3.45 that Radio Shack wants. Hopefully they will arrive in the next couple of days. But the LED is the last thing to go on after the boards are assembled so I can start production now.

Jim
 
Turbo3 said:
Just before 1PM the package of production boards arrived on my door step.

Here it is out of the plastic pack. The six pin connector J3 on the right edge is for the Bluetooth module.

Very nice! What firm are you using to produce the PCB and what layout software?
 
The PCBs are from expresspcb. They provide the free schematic and layout software. Once you lay it out you can get an instant quote from within the layout software. Ordering is also done right in the layout software. Just select type and quantity and then enter your credit card number.

Jim
 
A lot of progress has been made on both the hardware and software this month. Let’s cover the software first.

Modifications to the event timer software were made to support LEAFer’s request to support the longer times possible when charging from 120 volts. I took his suggestion of using letters for numbers greater than 9 in order to still fit within the H:MM:SS display space available for time on the 2x16 screen.

This turned into a somewhat major change in the way the event times were saved within the register space. The result being the freeing up of a large number of internal registers. Originally only three bits were available for hours within the two byte time variable but by using a more efficient packing scheme I was able to increase that to five bits for hours while still keeping a two second granularity.

The max time is now 31:59:58 which is displayed as V:59:58. More than enough to cover the time it takes to charge a Leaf battery from empty to full on 120 volts or even 100 volts (i.e. Japan).

With the freed up registers I was able to increase the number of saved events from four to seven. This then required the invention of a way to select more than eight screens. The method I came up with added seven new screens by adding one line of code and using a new flag for history.

Each time the rotary selector is turned fully clockwise so the Debug screen is selected the History flag is toggled ON and OFF. When OFF the first seven screens are for real time data (SOC, Power Bar, Motor RPM). When the History flag is ON the first seven screens display the seven last drive/charge events. This allowed the rotary selector code to remain unchanged.

A side benefit was four new screens for real time data. I just needed to come up with what to display on them. Just as I was finishing this code up Steve Lemke emailed me for a status update and a suggestion he came up with after seeing the new RAV4 EV maximum distance to empty screen.

He suggested I add a screen where I calculated the maximum miles remaining based on current gids and a user selectable mile/kwh number. This sounded like something that could be added since it did not require any additional register space just some calculations and a screen to display it.

Rather than have the user select a miles/kwh number I decided to display a range of five values (4.0, 4.5, 5.0, 5.5, 6.0). With two digits for miles below each number so the driver can see the effect of different driving styles on the remain miles. The final format used the letter scheme for numbers above 99 which is not so important for miles but when I created a kilometer version seemed more useful. Also below 1 mile or km of range the display switches to “.x” to show the last few tenths available.

There are actually three of these “Distance to Event” screens as I am calling them (not to empty). The events are Low Battery warning, Very Low Battery warning and Turtle identified by the letters ‘L’, ‘V’ or ‘T’ in the left most position (at the 49,24,4 gids level).

Here is what it looks like.

dtlb.jpg

dtvlb.jpg

dtturtle.jpg


Here is the km versions for VLB and Turtle.

dtekmvlb.jpg

dtekmturtle.jpg



So to summaries the improvements:
- Max event timer increased from 8 hours to 32 hours
- History screens increased from four to seven
- Added three ‘Distance to Event’ screens (miles or km) LB, VLB & Turtle
- Total selectable screens increased from 8 to 15.

The next post will cover the hardware status.

Jim
 
This week I built up five of the new Rev 1.1 boards. Here is what they look like.

Back side showing black connector for Bluetooth module.
rev11backside.jpg


Same board with Bluetooth module installed
rev11backsidebt.jpg


Component side of board. Second CAN Transceiver is for testing only and will not be installed in the shipped product. (no software support for it at this time)
rev11componentside.jpg


Just completed set of five boards.
rev11btboards.jpg


Five rev 1.1 boards and three rev 1.0 boards ready to be mounted in cases.
readyforbox.jpg


The same software runs on both rev 1.0 and rev 1.1 boards. The rev 1.1 boards have the option to add a Bluetooth module. The rev 1.0 boards support only a hardwired serial port. Current output format for both is eleven byte CAN-DO (SOF, ID_LO, Data_count+ID_HI, followed by 8 bytes of data).

The next step is to modify the cases to take the completed modules then make up some cables. Cases are back-ordered but I do have six in stock. Another batch of cases is coming in the next two weeks.

Jim
 
Here is the schematic for the WattsLeft rev 1.1 board. The SX28 chip is reprogrammable through the included four pin debug port. So it is conceivable that someone could write their own firmware for it. All chips are in sockets. Only the EV CAN bus tranciever is installed at this time. There are jumpers to allow the software to drive the EV-CAN bus (U4 not populated) or receive data from the Bluetooth module which are not used at this time and left open.

turboscanv11.jpg


Jim
 
Yesterday I came up with a better idea for how to mark and cut the holes in the plastic box. The original idea and the one used for the first box was a paper template. This 1:1 template was glued to the box and then the marked holes drilled or cut out. This worked ok for the first box but the rounded edges on the box made alignment a problem. The template also had to be printed and then cut out.

A quick stop at Ace Hardware and I had the parts to make a Hard template that allowed perfect registration every time.

The parts were a brass sheet used as a base plate and ½” flat brass stock used for side rails. The stock was cut into four pieces and attached around the box to hold it in place.
regtmpltstep1.jpg


Next step was to use the paper template to drill the four mounting holes and LED hole.
regtmpltstep2.jpg


The hardest part is making the large rectangular cut-out for the LED display.
regtmpltstep3.jpg


Once the template was made a box is placed on the template with the side guide rails holding it in perfect alignment. Double side tape holds the box to the template during the drilling and cutting operations
regtmpltstep4.jpg


Here is the first box made with this new hard template with the electronics installed.
regtmpltbox.jpg


Here’s the hard template from the top side.
regtmplttop.jpg


The goal for tomorrow is to do the same to the other five boxes I have.

Jim
 
Turbo3 said:
A side benefit was four new screens for real time data. I just needed to come up with what to display on them. Just as I was finishing this code up Steve Lemke emailed me for a status update and a suggestion he came up with after seeing the new RAV4 EV maximum distance to empty screen.

He suggested I add a screen where I calculated the maximum miles remaining based on current gids and a user selectable mile/kwh number. This sounded like something that could be added since it did not require any additional register space just some calculations and a screen to display it.

Rather than have the user select a miles/kwh number I decided to display a range of five values (4.0, 4.5, 5.0, 5.5, 6.0).

Exactly what I've been asking for. I would want to start at 3.5 through 5.5. I'd probably prefer a selection knob, since my economy stays very close to one figure for both freeway and town driving.

Great work.

Now, how will you scale this data for different battery capacities; both permanent losses and temperature related temporary ones? Gid reading should work well for permanent loss, but it doesn't seem to scale well in cold.
 
Tony,

You are siding with my wife. She was saying I should have a lower starting value than 4.0. For now this range is not user selectable but I am open to lowering it. It could also be an option when ordering but I would prefer that the default value be what most people would like to have.

Anyone else have an opinion? What would be most useful to you? 3.5 thru 5.5 or 4.0 thru 6.0

There will be no temperature compensation.

As far as I understand it, permanent loss will just lower the max starting gid and better batteries will increase the highest gid. In that case the current formula handles it. Better motors on future Leafs will just increase the miles/kwh number so then maybe the 6.0 makes more sense.

Jim
 
Turbo3 said:
Tony,

You are siding with my wife. She was saying I should have a lower starting value than 4.0. For now this range is not user selectable but I am open to lowering it. It could also be an option when ordering but I would prefer that the default value be what most people would like to have.

Anyone else have an opinion? What would be most useful to you? 3.5 thru 5.5 or 4.0 thru 6.0

There will be no temperature compensation.

As far as I understand it, permanent loss will just lower the max starting gid and better batteries will increase the highest gid. In that case the current formula handles it. Better motors on future Leafs will just increase the miles/kwh number so then maybe the 6.0 makes more sense.

Jim

I too am siding with your wife. My life time average is more like 3.6 and in the winter can get down closer to 3.0. This feature is EXACTLY how I want to use a gidmeter though! I don't care about percent full or how many gids there are, just let me assume I'm going to get x miles per kwh and then do the math for me. I'd be happy with 3.5+ but maybe starting at 3.0 would be better? Looking good :)

This is looking very nice! It's hard to judge depths in the images but is there much extra space in the box? Looks deeper than the boards are.
 
Here is a top down view of the case. The top of the nylon standoffs is the bottom of the back cover. The highest points are the black Bluetooth connector and the adjustment screw on the Pot used to fine tune the range on the rotary selector which comes within about 1/32” of the back cover. The box is 1.5” thick

topviewx.jpg


Looking like the default starting value should be 3.5 with 3.0 and 4.0 as order time no cost options. I’ll have to go calculate what the km/kwh equivalent numbers are.

Anyone outside the US want to comment on what range they would like to see? Right now it is 6 thru 10 km/kwh.

Jim
 
Back
Top