PV diversion / starting emon

So I have a small solar setup. Nothing to power my house or anything (yet). I have some DIY powerwall batteries that my panels charge up. I don’t have much pulling from those batteries at the moment. So a fair amount of time, my batteries are charged and my solar charge controller just says “no more sun needed, thanks!!” and that power is wasted.

Sooo, I am thinking of tipping my toes in to some power diversion. So here is what i have currently.

Nothing special. Small solar panel, a LandStar 10A charge controller and a 4s80p li-ion battery pack. The pi is currently just hooked up via the rs485 port to get the solar data to push to grafana.

My thoughts on what I would like to do are, stop monitoring the charge controller directly, put a voltage and current sensor or shunt in between the panel and the charge controller and be able to monitor the power there.

Then have some sort of relay setup to change where the power goes. In this case, I am thinking a small 12v heating element.

So to do this. I am going to need to monitor the voltage of the battery via the pi either through the charge controller or directly to the battery. Once it’s “full” I would cut this over to the heating element. Then at whatever voltage I feel necessary switch it back.

Now, down to my actual question. I know I can do all of this pretty easily via an arduino. However, custom writing more code, though i am not opposed to it, seems like re-inventing the wheel here.

I have worked with the emoncms before, but have not gotten much in to the hardware side of OEM. So are there recommendations on going this route? I do want to start monitoring house power as well as my PV power ect. I figured maybe this is a decent starting point. I would prefer to go the DIY route as I already have bins and bins of parts and controllers ect.

Any thoughts or recommendations would be much appreciated! Thanks!

Hello @CrankyCoder, looks like a nice project! Given that you have the data on the pi through an rs485 connection and are keen to avoid custom code, have you thought of using something like nodered? Nodered can be used to setup rules for controlling things in relation to input levels etc.

I would likely go for the custom code route myself but that’s not to say it’s the right way.

You might be interested in @danbates’s work on DC monitoring here too, although it sounds like you have the monitoring covered DCduo Board Update - #8 by danbates

I have openhab running all my other automation. So I could use that. I just didn’t know if OEM already had that kind of functionality. If not, then I can very easily utilize my openhab setup to do it :slight_smile:

Thanks for the feedback :slight_smile:

1 Like

I think there’s gradually more and more examples of control using OEM. I’ve only ever set-up openHAB to check it out, so can’t really comment, defo looks like it’d do the trick on the network side of things.
My plan with the DC project is to create support for an I2C GPIO expander board. I’ve ordered some bits to play with, they’re the same chips used in LCD modules.
GPIO expander → Logic Level MOSFET → Automotive Relay
is the plan.
Also, I’m going to find a DAC with which to take 8 bits of the GPIO expander, to suggest a single channel of PWM control along side the few relays. Thinking about it, I’ll have a little search for an integrated 8-bit PWM controller now :slight_smile:

1 Like

What kind of controllers do you have? Could be not too far off connecting the RPi to relays, using openHAB and a python script to do the control? Or can openHAB control the GPIO of the RPi without the need for an added script?

I have a bunch of raspberry pis. More arduino’s than I can count. I have attiny85’s for super small stuff. I use the mysensors project for alot of my home automation for wireless. So I could easily build a small board with a handfull of relays and just put a pro mini on it with the mysensors stuff and be able to control it with openhab or anything else. I use a mysensors-mqtt gateway so it just can just send mqtt packets and mysensors gateway would just send it out via the RF.

Would you recommend just doing a DIY solution like that instead of trying to get OEM to do it, and just use OEM for the monitoring?

Thanks for the response. Been checking out that board of yours. Pretty sweet!

Thanks!
Sounds like you’ve got some hardware!
Just reading the datasheet on the attiny85, looks like the ideal little beasty for my PWM controller.

I’ve got several more PCB’s in the post for emonDC. Shall I let you know when they arrive and we work something out? It’s just that you seem to need the hardware side, like you say, and perhaps the emonDC can function here?
I’m also ordering a bunch of small ‘breakout’ PCBs I knocked up for Allegro ACS7** current monitors. Perhaps something a bit simpler and modular could work too?

I assume that because it’s a 12v heating element you’ve mentioned, that the solar system voltage is 12v?
10amp charge controller…
Just confirming for the safety aspect :slight_smile:
…the emonDC is up to 64V.
The configuration of ground/earth matters also, I’m guessing with this setup it shan’t be tricky but it’s worth making sure.

1 Like

Sorry for the delay. Yes, at the moment my solar is 12v. I am however looking to switch over to 24v. My charge controller can handle it no problem, and it’s easy for my lithium ion battery configuration to be in the 24v range. So maybe I should just go with a 24v element :slight_smile:

With the DCDuo board, that’s almost an out of the box way to monitor both my solar line and the battery? (aka both sides of my charge controller) Unless I am misreading it :slight_smile:

Yes! I’d say it’s as out of the box as it gets. I have more to work on software-side, it’s coming along nicely, it’s not ‘fast’ progress :wink:

This situation is exactly what it’s for, generation/battery systems. Solar/battery in particular I’ve aimed at.

I’ve also dubbed it a battery monitor, again, software work to be done before I can justify the claim.

At present the software has all the features of emonESP, it’s the basis of the software I’ve built on top.

24v, no problemo. :slight_smile:

I tested an I2C GPIO expander earlier, a small module with a PCF8574 on it. I found a nice simple Arduino compatible library for it too.
Integrating control with emonDCduo should be quite easy.

Let me know if you’d like to buy a DCduo development board.