## DIY EV smart charger

thebenchmark
Posts: 9
Joined: Sun Mar 19, 2017 3:26 am

### DIY EV smart charger

I like to control my smart devices myself and I've lots of projects in this regard. For example my solar projects.
Soon I'll be getting a PHEV and I'd like to charge it via 3 disciplines (ASAP, cheapest way by given date, solar surplus only)

That is easy enough by controlling a relay but I'd also like to control the current.
I can do that easily by using an EVSE controller and sending a variable resistance to it: https://ecoharmony.co.uk/collections/ev ... red-16-32a

I'll be designing the system to charge single phase varying from 6 - 32 amps.
For that I need to add a resistance on a circuit from the EVSE ranging from 191 to 732 ohms.
I would like to have the ability to digitally control this in steps of 1 amp (26 total) so I can use my solar power in an optimal way it is also useful to flatten the max usage my grid draw.

As far as I know there are 2 ways to achieve this:
- A big circuit with resistors in series starting a 191 omhs adding ~20 omhs per step. (big and undesirable)
- Using a digipot.

The digital potentiometer is the way to go I think but I can't find one accurate enough or in the correct range. I've looked at these:

DougieLawson
Posts: 41321
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

### Re: DIY EV smart charger

1. Stop before you kill yourself, kill a family member or burn your house down.
2. You're working with 230V -6% or +10% @ 31.8A for a 7.4kW charger. (Which still takes eight hours to charge my Kia Niro's 64kWh from flat to full). Assuming you're not looking at a 3.5kW granny charger (that runs on a 13A plug like you're boiling a kettle constantly for 20 hours).
3. Some cars (not the Niro) will charge on three-phase (~400V @ 22kW) on a home charger (you'll hit the DNO limit if you try to get over 22kW).

The charger DOES NOT control the charging. The charger provides power when the car demands it. The car is the absolute controller of the whole charging system.

https://ryanteck42.medium.com/ev-charge ... 8c449e0ecb
Any language using left-hand whitespace for syntax is ridiculous

Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

thebenchmark
Posts: 9
Joined: Sun Mar 19, 2017 3:26 am

### Re: DIY EV smart charger

I've been working with 230/400v systems for a long while. (Without any smoke)
I am perfectly aware that the car determines the charge speed. However the charger lets the car know what it has available. So I'm not interested in the car. The evse controller will even control the contactor. The only thing that needs to happen is to send a signal to the evse controller by adding resistance on a 5v circuit of the evse. Not really playing with fire there

Btw: To disable charging the pi will also have 2 safety relays that control power to the evse controller unit and the relay (relay power circuit can then be interrupted by either evse or rpi)

DougieLawson
Posts: 41321
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

### Re: DIY EV smart charger

You should take a deeper look at Ryan's project. He modified a dumb charger to become a smart charger.
Any language using left-hand whitespace for syntax is ridiculous

Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

thebenchmark
Posts: 9
Joined: Sun Mar 19, 2017 3:26 am

### Re: DIY EV smart charger

Thanks for the advice, do you happen to have a link to his project?
I couldn't find anything unfortunately.

I did find this which is very interesting! https://www.speakev.com/threads/diy-charger.132546/

DougieLawson
Posts: 41321
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

### Re: DIY EV smart charger

thebenchmark wrote:
Fri Apr 16, 2021 7:20 pm
Thanks for the advice, do you happen to have a link to his project?
Er ... https://ryanteck42.medium.com/ev-charge ... 8c449e0ecb exactly as I posted before.
Any language using left-hand whitespace for syntax is ridiculous

Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

pidd
Posts: 2101
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

### Re: DIY EV smart charger

thebenchmark wrote:
Thu Apr 15, 2021 2:37 pm
For that I need to add a resistance on a circuit from the EVSE ranging from 191 to 732 ohms.
Or apply a voltage, the required voltage is very close to (A +10)/20 where A is the specified current.

The actual calculation is V = (A + 10.0242)/19.9854

thebenchmark
Posts: 9
Joined: Sun Mar 19, 2017 3:26 am

### Re: DIY EV smart charger

pidd wrote:
Fri Apr 16, 2021 7:40 pm
thebenchmark wrote:
Thu Apr 15, 2021 2:37 pm
For that I need to add a resistance on a circuit from the EVSE ranging from 191 to 732 ohms.
Or apply a voltage, the required voltage is very close to (A +10)/20 where A is the specified current.

The actual calculation is V = (A + 10.0242)/19.9854
That is a great idea!
This solution will work great and has the required resolution it seems.
https://swharden.com/blog/2016-09-28-ge ... pberry-pi/

pidd
Posts: 2101
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

### Re: DIY EV smart charger

You will need a buffer amplifier on the output as the source impedance has to be low (we used to use the term a "stiff" supply). To maintain your accuracy I'd try to get a source impedance of 10 ohms or less so it needs to be able source and sink up to about 500mA rather than the 25mA of the MCP4901.

Hopefully someone could suggest a suitable amplifier chip, I'm out of date.