The main reason for not directly incorporating this into the solar system is cost. I would need to purchase a solar-aware charger like the zappi, which is $750 and have the solar company involved in the install, which could cost me double that.
My projected expenses for a photocell and an esp32 chip, a 220v relay, a USB power supply, and a couple of electrical boxes and outlets - maybe $50.
Not really that odd, I think...
Although I do like the idea of a system that will always be drawing directly from the solar because it's monitoring the actual solar output, it's a fairly easy thing to simply adjust the photocell to activate the relay when the lux value exceeds a certain value, and set that value by observing the real time electrical output of the solar array, which I can do at any time by using the monitoring software they provide. The cell and the solar should be in very close sync that way.
Well, I would place the sensor near the roof area. But it doesn't have to be exact - I will simply adjust the potentiometer to a level that triggers the relay WHEN the solar array begins to generate enough power. This can be determined by an actual read of the solar power output. So if it takes X lux for the solar panels to generate 2000wh, then I would set the potentiometer to switch output to high on DO at that light level.
Doesnt have to be perfect.
But the main thing is to avoid flipping the relay constantly, so a 30 minute delay should take care of that.
Thanks, too early to tell yet. Haven't gotten the bits and pieces yet! But the wokwi sim seems to be working correctly (although with only 1 second delay)
I'll breadboard it when I get the parts and see how it goes.
That is accomplished with hysteresis. If above 100 lux then relay on, if below 90 lux then relay off. So once it goes above 100 it must drop below 90 to go off, that way it can fluctuate 10 lux with out the relay going off again.
However you won't be able to do this with the digital DO output, you need to read the analog output AO
I missed this question, sorry.
The photocell will read the light constantly. When the amount of light is enough to trigger a high reading on DO, the code will note it and then wait and repeat. After X minutes, if it still reads high, it will turn the relay on.
If the light level drops, it waits X minutes and then turns the relay off.
The X in X minutes has yet to be determined, but I'm going to start with a 30 minute delay. This should avoid constant flipping of the relay. Even on a gray day if the level fluctuates up and down, it won't flip very often.
I could set it as high as an hour, or as low as 5 minutes, testing will help me figure that out.
My plan is to prototype and test, then build the actual circuit, wire it up, and have it turn a 220v LED on and off and just see how that works.
(I might have to have it on wifi so I can watch the serial output initially, but I don't want a system that is dependent on any internet connection).
If it all looks good, I'll start charging the EV with it. The EV charger itself has over&under voltage and spike protection built in.
One of the reasons I went with DO is that the wokwi LDR analog output seemed very buggy. It has a slider to allow you to simulate light levels but it didn't seem to work with the analog. When set to digital, it happily gives 0 or 4095.
I can certainly play with analog once I get the bits and breadboard it.
Most utilities (in the US, at least) deal with residential solar in a way that makes what you are trying to do a fun but pointless exercise.
For example, my utility uses monthly net metering. That means that at the end of every month, if I have consumed more than I produced in a month, they charge me for the difference.
And if I have produced more than I consumed in a month, they pay me for the difference.
In either scenario, it doesn't matter if I charge my EV in the dark of night or only when the sun shines. The utility acts like a battery that stores my over-production on sunny days, for use when the sun isn't shining... (and that "battery" gets shorted out at the end of every month ).
(My utility pays me for over-production at the avoided cost rate, which as about 25% of the amount they charge me, so it doesn't make sense to design a system that will over-produce in the summer months. If we had annual metering, then it would make sense...)
If a utility used minute-by-minute net metering and if they pay for over-production at a reduced rate, then charging my EV when the system would otherwise be overproducing (i.e. when the sun is shining and my household load is low) would make sense. But I've never heard of a utility that uses minute-by-minute metering.