Page 2 of 3

Re: Cutting power to EVSE concerns

Posted: Mon Oct 07, 2019 6:41 pm
by Todd1561
Thanks everyone for the input. I’ve put together the final solution tonight and it seems to be working well. It works as follows:

A powershell script runs at the same time every night, it starts by querying the Nissan carwings API to get my current SOC. The script then calculates the time required to get to my 75% set point. Then it sends a TCP command to a PoE powered arduino to turn on a relay for that calculated time. The relay is what breaks/connects the pilot wire and stops/starts charging.

The car doesn’t seem to have any problems with this and still reports the plug connected even when the relay is off. I was worried that by breaking the pilot connection the car would report it not plugged in and allow you to drive away.

Modifying the EVSE was pretty easy, once you get the caps off the torx security screws. The pilot line is the smallest of the 4 wires and just terminates to a ring terminal.

I can provide more info on any of this if there’s interest.

Thanks again for the help!

Re: Cutting power to EVSE concerns

Posted: Tue Oct 08, 2019 5:02 am
by WetEV
Make sure you handle car networking errors correctly.

Re: Cutting power to EVSE concerns

Posted: Tue Oct 08, 2019 5:17 am
by Todd1561
Yes I do have some checks in there to validate the data I'm getting from Carwings

Re: Cutting power to EVSE concerns

Posted: Tue Oct 08, 2019 10:35 am
by davewill
Sounds great. You might want to add hourly checks during the charging period to handle weird cases like plugging in after the start time.

Re: Cutting power to EVSE concerns

Posted: Tue Oct 08, 2019 10:44 am
by Todd1561
Not a bad idea, my solution to that was just to start the schedule pretty late at 1am. With 1 kid and another on the way our days of staying out past 1am are pretty much non-existent :)

Re: Cutting power to EVSE concerns

Posted: Wed Oct 09, 2019 10:09 am
by davewill
Another idea that occurred to me was adding a switch mounted on the outside of the EVSE, either connected to an input on the Arduino or (if you want to be more failsafe) between the Arduino and the relay, that would override the timer and force the EVSE to be on. That way if you need to charge in the middle of the day, or want to go to 100%, all you have to do is flip the switch.

P.S. I'm sure that a lot of people would be interested to see pictures and code for what you've done. It would be very handy for a lot of people.

Re: Cutting power to EVSE concerns

Posted: Wed Oct 09, 2019 10:31 am
by alozzy
I know @mux is very busy with his battery extender business, but I recall him mentioning that "80% charging" can be easily implemented using the "man in the middle" CANBUS device that he designed:

https://mynissanleaf.com/viewtopic.php? ... 10#p531734

Hopefully he's made progress on that front...

I recall that @dala purchased this device from muxsan, perhaps he could look into what coding would be needed to make the muxsan CANBUS device act like a transparent bridge in all respects, other than spoofing the SOC value.

Re: Cutting power to EVSE concerns

Posted: Wed Oct 09, 2019 11:03 am
by Todd1561
davewill wrote:
Wed Oct 09, 2019 10:09 am
Another idea that occurred to me was adding a switch mounted on the outside of the EVSE, either connected to an input on the Arduino or (if you want to be more failsafe) between the Arduino and the relay, that would override the timer and force the EVSE to be on. That way if you need to charge in the middle of the day, or want to go to 100%, all you have to do is flip the switch.

P.S. I'm sure that a lot of people would be interested to see pictures and code for what you've done. It would be very handy for a lot of people.
A physical switch would be a good addition for that purpose. For me it's all done in software. I made a simple app for my phone so I can override the schedule, change the target charge % or force an immediate charge from anywhere in the world. I'm happy to put together some legitimate docs with pics that cover this project. Some of it is pretty specific to my needs and require a 24x7 running server, which probably won't be practical for most people, but I have all that overhead already for other purposes. But I can highlight where people could use some alternatives that would make this more generic. I'll post back here when I've got something together.
alozzy wrote: I know @mux is very busy with his battery extender business, but I recall him mentioning that "80% charging" can be easily implemented using the "man in the middle" CANBUS device that he designed:

https://mynissanleaf.com/viewtopic.php? ... 10#p531734

Hopefully he's made progress on that front...

I recall that @dala purchased this device from muxsan, perhaps he could look into what coding would be needed to make the muxsan CANBUS device act like a transparent bridge in all respects, other than spoofing the SOC value.
I came across this thread early on in my searching, too. If this ever becomes a real product then it would likely be the ultimate answer. Presumably much more self-contained and could be used outside of the home at public charging stations. That's probably the biggest drawback to my solution, it only works at my house. I don't see us doing much public charging so for me it's not a big concern, but may be for others. A CANBUS solution would also not be dependent on having a subscription to the Nissan Connect service and all the headaches that go along with integrating with that API. Hopefully someone develops a product some day.

Todd

Re: Cutting power to EVSE concerns

Posted: Sun Nov 03, 2019 3:30 pm
by nlspace
coulomb wrote:
Sun Oct 06, 2019 4:07 pm
... the early leafs don't heed this pin, which I think is a shocking violation of the J1772 standard. ...
This is really shocking and unbelievable violation of the standard; i had read this post but never experienced it until this last friday.

i came home from the daily ~45 mile commute and plugged in to get a couple of hours of L2 in order to go downtown for a hockey game. Normally i plug in at night and it is ready in the morning. But i pressed the trigger--and nothing happened, the blue lights were on and blinking and i didn't hear the snap of contactors.

i sure didn't want to pull the plug with current in the OBC and across the Main Contactors and cause a ration of damage.

So i tried pressing the "charge off" button on the left knee dash, then pressed the start button and the charge "off" button, still with no success. Finally pressed the brake pedal and start button, and then the contactors snapped off (the car didn't start while chargging). Quite a hassle and PIA especially when it's dark and rainy.

And potentially damaging to the OBC and contactors. Maybe that big 2700 uF 420VDC capacitor in the OBC is big enough to hold up the PFC buss long enough for a graceful shutdown?

Re: Cutting power to EVSE concerns

Posted: Sun Nov 03, 2019 5:22 pm
by coulomb
nlspace wrote:
Sun Nov 03, 2019 3:30 pm
Maybe that big 2700 uF 420VDC capacitor in the OBC is big enough to hold up the PFC buss long enough for a graceful shutdown?
Definitely. I didn't realize that brake+start would stop the charge. So I've been stopping a charge by removing the J-1772 plug. I always expect nasty arcing, but so far it never seems to happen. I wonder if it detects the loss of pilot signal before the AC disconnects, and does a graceful disconnect anyway. I'd still way prefer that it heeded the proximity switch.