Solar timer project to charge an EV

I want to build a circuit that basically allows me to charge my EV ONLY when the sun is out. The idea is to maximize the use of my rooftop solar panels for EV charging and avoid paying for grid power.
I originally thought I could use a commercial product, but turns out everything is "dusk till dawn" (ie photocell turns on lights when it is dark) not "dawn till dusk"
I then thought I could use a simple photoelectric relay which are cheap, but none of them can handle my power needs (220v 16A, the relays are all 10A or less).
So I'm thinking maybe I need to use an arduino and a photocell to drive a more powerful relay (25A using 3-30 control voltage).
First, am I overthinking this - maybe someone knows of a commercial product I haven't seen yet?
Secondly, can I get the arduino to put out enough voltage on an analog pin to trigger the relay?
Thanks in advance.
BTW - I could easily do this with a 'smart' timer control, but I'd rather do something that doesn't require a 24/7 internet connection...

No, and the question indicates that you are dangerously uninformed.

This is not a hobby project. You need either a certified commercial solution or to hire a qualified, licensed electrician to design, build and install the interface. Choose a local who knows and obeys the applicable building codes and regulations.

2 Likes

When you say rooftop solar I assume that is on your house. If that is true, just use the existing system to do the charging. Much safer. If you only want to do that during daylight hours then a normal timer is fine just set it to the average daylight.
FYI, those of us who are into solar only plan on 4 hrs a day, six if we are very optimistic.
Your approach might save $20, but it will cost you your car and house if you are not extremely knowledgeable and careful.

2 Likes

Not at all! I have had a Zappi charger for several years that does exactly what you want. It was the first on the market to do that, at the time, but I expect many charger models have that feature now.

If you were thinking you could build something like that using Arduino, well, it's too important from a safely viewpoint to attempt to build something yourself. You must buy a suitable, certified product and have it professionally installed.

@jremington apologies, I seem to have replied to your post when I meant to reply to @geoffreybaker !

2 Likes

https://www.amazon.com/gp/aw/d/B0CTWPP7GB

Interesting responses.

I have built a whole slew of devices for a large woodworking shop that use arduino-like chips and relays to control 110, 220 and 3 phase machines. It is neither difficult nor dangerous. Tip - unplug the machine first, and turn off the correct breaker. Second tip; always use the right size relay. Third tip: always enclose the relay in a metal box, they are known to blow occasionally, as they shunt loads.

For that project, I used esp8266 d1_mini clones to control the relays, and ran it all on a raspberry pi network, using HomeAssistant and Esphome software, and flashing each chip. The esp8266 chips, using one pin and the 5v pin, easily control relays of almost any size.
I could do that tomorrow with this project, using a 220v 25A relay - but as I said before, I don't want to be dependent on a continuous internet connection.

The advantage of doing it with a photocell and an arduino is a) no internet connection, b) no timing logic, just on.off based on existing light.

Here is a relay I used many times (I was building automated blast gate systems that sense the current of a machine and open a blast gate and turn on a dust collector). HiLetgo 2pcs SSR-25DA 25A 250V Solid State Relay Module: Amazon.com: Industrial & Scientific

Now please explain how, with the right arduino code, I can't wire this relay to the Arduino voltage out (either 3.3 or 5 will do, but I used 5 to be certain with the d1_minis) and one other pin.

That would work except as pointed out, I need 220v 16A (preferably 20A for a bit of latitude).
There is a simple 'smart switch' that will control 25A but it requires an internet connection - here: Otcboimo 30A Hight Power WiFi Wireless Smart Switch, DIY Module for Smart Home Automation, ewelink APP Remote Control, Timer, Compatible with Alexa & Google Home: Amazon.com: Tools & Home Improvement

Thanks, that would work - and there are some other actual EV chargers with timers, but they are expensive, as is the zappi. This is why I wanted to find a simple inexpensive solution.

The solar system supplies house voltage during the day, so yes, I can manually make sure that I am charging it in daylight hours, but it would be nice to have a timer that made sure I didn't forget and leave it charging overnight, paying expensive grid rates...

True, if you know exactly what you are doing. Many first timers posting on this forum don't have a clue.

And I stand by my comment in response #2.

I'll repeat, I have built a wide range of similar controllers for large machines using the same power draws, using even simpler chips than an Arduino.
I can easily build this using a d1_mini clone (an ESP8266 chip) a photocell, and a relay. It differs in no way from what I have already done.
I may prefer to do that, because while the d1_mini needs an internet connection to program it, it does not really need it for operation; so long as it has a USB power supply, when it receives a readable signal from the photocell it will automatically trigger the relay. (Its program is stored in simple 'yaml' script files) But because it is a wifi chip, I suspect it will spend a lot of its time trying to find a network, which may eventually cause it to crash, so I want to research other options first.
An arduino doesn't need that at all, and can just as easily control the relay and respond to the correct voltage from a photocell.

The link you disapproved of was an example. I put "220" in the search and will paste the first link, and look no further. Not because "it doesn't exist" but because I don't care.

Again, won't work as I need 16A not 15. It would help if you actually had read the post first.
And please, if you don't care, don't respond.
I believe I've been through this with you before... did that work for you then?
Programmable timer switches aren't very good for sunrise/sunset situations anyway as you must change them pretty much weekly to account for the change. And yes, there are ones in the 25 & 30 amp range, but still not what I want to achieve with this.

Same as a D1 Mini, and I have never used a yaml with any of my few dozen boards of every make and model.

What about an RTC like a Chronodot? Maybe even build into the EEPROM a correction for daylight hours based on the date. Use a logic level relay to activate a higher power contactor for the 230VAC charging circuit. Maybe think of some optocouplers for safety. You could also use the photocell to test for actual sunlight during the RTC-controlled window.

Yaml can easily configure these chips, probably the simplest approach. At least, I've found it easier to use.
Right now, I'm researching whether it is possible to turn wifi on and off on the d1 mini chip. It looks promising (it has been a RF for years).
If that is now possible, I can simply program the yaml via the serial port of the computer and then not worry about the chip wasting resources, it should keep doing what it needs to do from then on...
A RTC is interesting, it should do the job but would require a fair amount of programming to follow sunset and sunrise. But a photocell needs nothing at all, and has the advantage that one could tune it well enough so that on a cloudy day if the solar isn't outputting enough power, the car wouldn't get power from the circuit.

No...

I've never stored my D1 mini code in yaml files...

I don't think that will happen. But if you are concerned, switch off the D1 mini's WiFi.

D1 mini, if programmed with the Arduino IDE, is, in effect, an 'Arduino', even if it doesn't have an Arduino logo on it.

Sorry, PaulRB, you are correct. It is easily programmable via the serial port of the home automation hub. I misspoke - I always send the yaml file via the serial port to the chip to begin with.
My issue is that I don't want the d1_mini wifi chip endlessly hunting for a network that isn't there. (It will be outside in the carport, and the signal is not good).
I have found, with great pleasure, that it is in fact possible to turn off the wifi on the d1_chip by simply omitting the wifi and ota sections of the yaml file during installation.
Now I know that I can do that (it was a RF for years but Esphome finally implemented it a year or so ago) I will be able to proceed with this project using the d1_mini if I choose.
However, I no longer am running an HA network at my home (I did that for my place of work) so it might still be easier to do this via arduino than with a d1_mini; I have both on hand, but don't have a HA hub at my home any more.

Turning off WiFi is simple and saves a lot of power. I have been a programmer since 1959 and a pro since about 67. The first time I heard of YAML was just a few years ago. If it works for you, then use it. It does not require much programming to adjust the sun up/down, literally a few lines of code, except for the DST issue if we still have it by then.
The problem with the photocell-only solution is that the board needs to be on, thus wasting power. Using an RTC to turn the board on or off on some sort of schedule, then checking for the sun, will use less power. There is a way to turn the board 100% off, and the RTC, which is coin cell powered for many years, can turn the board back on.
A few ways to skin the cat, it's an interesting project.

There almost always are!
I'm still leaning towards arduino as I no longer operate an HA hub at home. I could always program it at work, but then if I wanted to change the program, I have to go back to work :frowning:

Sounds like you have been programming your D1 minis in a completely different way than I'm familiar with.

I program them over USB cable using the Arduino IDE. Just like an Arduino, with Arduino/C++ code.

Seems a little pointless using a D1 mini if you are not going to use it's WiFi, but it will work as an Arduino, albeit with not many available pins!