Start a new topic

Off grid inverter control of EVSE

 I live in an off grid house and have a hybrid hydro/solar charging system. The solar produces little in the winter and the hydro little in the summer. They are connected to a 12kwh battery bank ( lead acid so only 6kwh useable) . I have a chevy volt that I plug into the house at 12 amps (110v)  and it drains the battery until the state of charge gets to 75%, then i unplug it. On the hydro only I can get 30km per day into the car... which would otherwise be wasted ... if I am attentive to plugging it in and unplugging it at very specific intervals. On solar it can produce enough to charge it nearly completely in perfect conditions and if my car is not at work with me. I want to control the charging with the relay output that is present on either the charge controller or the inverter of the off grid system ( which can be programmed to turn on or off at a specific voltage or battery state of charge). Is there a good place to interface the open evse with the 12v relay control present on the inverter/or cc. I have thought of a few:

At the panel: The 12v relay output could turn on or off a relay right at the panel ... this would turn on and off the branch circuit that the open evse would be plugged into. Is it good to cycle an open evse on and off by essentially unplugging it under load. This sort of is like turning the power off on your computer by pulling the plug. It is the easiest though as the inverter relay control is right beside the panel

In the EVSE :A secondary transistor between the transistor and power relay inside the EVSE controlled via a bluetooth or wifi link( or wire) that overrides the power being sent to the vehicle. It would .... or should be a softer disconnect method and the evse would remain powered up . Would the evse throw an error code?

Ground the Pilot: A transistor or relay that connects the pilot to ground inside the evse that was connected to the relay control on the evse would cause the evse to register an error and turn the relays off I think.

Any thoughts on this. Or other methods that may be easier that I have not thought of. I am looking for a soft method of controlling the on off of the evse charging with a 12 volt signal from an off grid inverter.

There is a lot of exciting progress on this front... OpenEVSE is working very closely with Open Energy Project. Using OpenEVSE + an EmonPi with MQTT and NodeRed you can setup a very smart system.

Check our this blog.

I just asked a related question. My idea is to add a small relay to open the pilot rather than grounding the pilot. I think this is equivalent to unplugging the car (from a signal standpoint) but I'm not that knowledgable about SAE j1772, so I asked.


I thought the OpenEVCS was provisioned for WiFi monitoring and control. If so, you can monitor the Hydro and Solar power systems using little computers that report back to a central computer that in turn makes decisions and commands the OpenEVCS. A brute-force approach would use a Raspberry Pi Zero W ($10.00) with a $13.00 peripheral card a$5.00 SDmicro card,  and a $5.00 power supply at the Solar Power system. This is the part that accepts the 12V signal. The use of WiFi conveys the signal to the OpenEVCS with no need to hack into to CP wire. If you do not already have a central automation computer, that little Pi is quite capable of handling that job in addition to the trivial 12V monitoring.

I admit it's a strange new world when full-up Linux computers with radios are actually cheaper than relays and wire.


I have a rasberry pie and arduino. I also have a battery monitor that has a relay output that can be turned on and off based on the house' battery state of charge.I could use all or some of these provisions.  You could also add or splice off of the current shunt to send info to a rasberry pie/arduino that has a programmed response sent to the evse. In reference to the comment above I guess I am not sure what wifi monitoring and control means. Does that currently mean that it is control from a web app or smartphone app. I want to avoid apps. I try to avoid looking at my computer and phone as you can easily get so wrapped up in them as everything has app monitoring these days (or can the app run on the linux rasberry pie). If wi fi monitoring and control means that I can easily integrate a rasberry pi or arduino to control and speak to the evse then the open evse is for me. If I have to rewrite the entire evse program to connect to the arduino/rasberry pi then I think the control of the relay directly via the arduino /ras pie is probably more likely possible for me. I have a reasonable level of programming knowledge and have a decent understanding of electronics... as well as access to people who are much more knowledgeable than myself in regards to programming. I still have not bought an evse . Do I want an open evse and use arduino / ras pi to connect to its wi fi monitoring and control or can i just use any old dumb evse and give it the smarts I need with integration of a rasberry pi/ arduino and just turn it on and off with the added smarts. Still I am not sure where the best place to turn charging on and off would be without setting off one of the alarms on the car or causing an error on the evse.


 As far as I can tell from a quick look at the code, the OpenEVCS is essentially an Arduino, and its external interface is a serial port running a nice simple CLI. Appaarently, when you plug in the WiFi adapter, it connects to this serial port and implements a TCP-to-serial interface. If this (extremely cursory) analysis is true, you can either buy the WiFi adapter and implement a trivial socket-based program on any computer on your intranet, or you can wire a little computer that has a serial port directly to the serial port in place of the WiFi adapter. In either case, you are completely free of the baggage of apps, development platforms, bloated libraries, and all that other garbage that is so trendy these days, unless you choose to use them.

OpenEVSE is controlled over standard 5v TTL Serial, so you could send it commands with an Arduino, Raspberry Pi/PC/MAC with USB TTL adapter or WiFi. WiFi you could send commands with a simple URL or MQTT. No need for an App or Webservice.

The commands are simple and well documented so you have a lot of options...

I would like to control the charge rate of the OpenEVSE using an Arduino. I do not do wifi but would prefer to wire it using whatever equipment is required. Please could someone point me to the "simple well documented" commands. I do not know emonpi or nodered. I would like to integrate the charging system with my offgrid solar to charge my car so I need a dynamic means of varying the charge rate to match the energy I have available from my solar system. My existing Arduino system can create a turn on/ increase / decrease / turn off signal of some kind but how to get it to the OpenEVSE puzzles me.

Any help with hardware or software that would be required I am grateful for. I have done a bit of work with RS232 interfacing my diversion control with the Midnite Solar Classic charge controller but do not pretend to be an expert. The location of information that could teach me what I ned to know would also be very helpful.



I have found this document.

Serial Communications with OpenEVSE

I can make this work however I want to go from my Arduino to the OpenEVSE. I do not want to use a PC.

This what I imagine :

Arduino - TTL - OpenEVSE

Will that work?

Distance may be a factor also. I need to go about 20' of wire length.

Thanks for any replies.


OpenEVSE uses the same microprocessor as the Arduino Uno both support TTL at 5v so all you need is a little copper.

OpenEVSE TX to Arduino RX

OpenEVSE RX to Arduino TX

OpenEVSE GND to Arduino Ground.

The default baud is 115200. you should be okay at 20' using CAT5/6 wire. If not you could use RS232 to TTL converters on each end.

On the Arduino you can send $SC xx to set the current. To stop charging $FS will put the station to sleep $FE will enable charging.

Hi Christopher,

Thanks for the reply. I have ordered the OpenEVSE kit from you. This will let me get the serial communication working and debugged (assuming I can) before I get the car and need to charge it. Here in Canada it is about a 6 - 8 month wait for a Bolt at this time.

I use a serial without blocking system in my diversion control  as it has 2 megas that exchange data with each other. I found the system I use here:

I would think that the $SC xx are chars?



I have a working system using the RAPI command based communications to the OE via an arduino uno board.  The system monitors the PV solar production and commands the OE to set the appropriate current.  It is open loop except for monitoring the battery bank voltage and then "sleeps" the OE for a predetermined time period.  All needed boards, sensors cables are readily available on ebay.  

Biggest downside is that the charging system is AC based (level II - 240 VAC).  I'd sure like to get something similar with DC "quick charging".

Hi Mark,

Thanks for your reply.Here is a link to the Midnite Solar forum topic that shows the process and code for the diversion control I developed.

Any additonal information that you would share or "open source" your code will be appreciated. Knowing what hardware you use would be extremely useful. It looks like you are doing exactly what I want to do except I likely would not sleep the OE but instead turn it on and off using the RAPI commands. My email is : I don't see any way to PM you on this forum.

I have been learning coding and Arduino as I developed the diversion control for my house but do not pretend to be an expert. I ordered the OpenEVSE charger and found the tester that I have also ordered. I like to learn but part of that is not making mistakes if I can learn from others.

Thanks again for your post.


Read your Midnite forum posts - very similar process for me in the arduino/OE development as I don't have an electronics background and did not know what an arduino was when I started!  As a result, my IDE coding is "copy"/"paste", and do my best to patch.  I can, however, describe the functional steps:

1.  A current sensor (50 amp Hall effect) measures the current from the Midnite CC to the 48v battery bank

2.  A voltage sensor (a typical 12v arduino sensor with a new resistor soldered to the board) to monitor the 48v batter bank voltage

3.  A LE bluetooth shield to communicate commands with my iphone - sort of an emergency shutdown via RAPI.

4.  The TX/RX communications link from the arduino to the OE (I use the OE power supply for the arduino also).

5.  The current measurement is translated to the OE ampere setting (this is open loop - the battery bank is large enough to stabilize)

6.  The OE ampere signal is sent via the RAPI command

6.  The voltage measurement is tabularized with the current measurement for an estimated battery bank SOC and if the SOC is below a threshold, the OE is put to "sleep"for a period of time.  This is a safety feature to prevent too low battery bank discharge when I cannot monitor the charge cycle.

7.   An app on my iphone is used to send sleep, reset, start, etc. if I deem necessary.  Otherwise all is "automatic".

8.  The system is started daily (and shutdown daily) to extract as much energy from my PV system to the Leaf's charger as possible.  This use of my battery bank in this method somewhat defeats the purpose of the Midnite CC as (by design) I keep the battery bank out of "float" - basically "bulk charging" to push as much energy through the CC as possible.  I have a small 48v smart charger to do this during night time.

9.  I use any (cheap) 220 vac UPS as the inverter - currently an APC SMT3000HV unit as it can monitor all DC/AC voltages, battery condition, amperes, wattages, etc, etc (around the inverter).  

I have fully tested the system with "dummy" loads and all works as expected.  The hall effect current sensor appears to need a better stabilization routine - I've got it loaded, but not tested.  The system is 100 miles from my home (a rural environment), so sometime this summer, I'll do the actual Leaf testing - requires a planned trip with half way recharge!

That's about it.  I can give you better descriptions of any functional routines, but would NOT recommend you copy any of my actual coding as I'm sure there are at least ten ways to do each functional routine much better. 

A thanks to Chris for helping me through the OE/RAPI interfaces.


Hi Mark,

Thank you for your reply. What I am uncertain about is the TTL serial communication and the coding of the RAPI commands. I will work with Chris also to get through what I cannot figure out for the OE/RAPI interface. Anything you could send me on that portion only I would appreciate. 

If I am just sending TTL serial then I need a data type. I am guessing it is chars. Is that correct?

My diversion control gives me an excess KW amount so I intend to turn the chrger on when there is enough excess and turn it off when there is not enough. As the diversion increases during the solar day I will just bump up the car load in order to hold KW to the HWT at a certain level. Essentially I will divert to the car to control my diversion rate to the HWT. This means that I do not have to measure actual amps. The Midnite Whiz Bang Jr is a very accurate means of measuring current flow to the batteries. By calculating variation between the charge controller amps and WBJr amps one can get a idea of actual system current flow.

It looks like I may be able to get a Bolt tomorrow!!!!!!! Very unexpected. It will be the only Bolt in Manitoba. I will use the Bolt on board level 1 charging which is limited to 8 or 12A  @ 120V. I have logic working in my diversion control already that toggles a suitable relay based on power available.

Thanks again


Login or Signup to post a comment