As mentioned here I've always wanted to create an all-in-one energy controller to clean up the mess in my basement. It is based on the popular BeagleBone Black or Green, so it's called a "cape".
Hardware-wise it is mainly communication stuff. The task of the thing is to control various energy conversion equipment such as
- PV inverters
- Batteries (or BMSes to be precise)
- CCS
- Relays
It also talks to web services such as spot market price providers, data loggers and of course has infinite connectivity over Wifi or Ethernet.
I pretty much copied the hardware that I currently use so the interfaces are
- 2x CAN
- 1x PLC for CCS charging, including CP signalling
- 2 relay drivers
- Input for push button with LED (button just shorts out LED current
I might add RS485 as well as I have only used up 10 of 12 screw terminals.
RS485 is a good idea for an industrial AC energy meter, or do you have a plan to route those over something like Home Assistant?
Re: Energy Controller including CCS interface
Posted: Sat Nov 01, 2025 8:30 am
by johu
tom91 wrote: ↑Fri Oct 31, 2025 3:32 pm
RS485 is a good idea for an industrial AC energy meter, or do you have a plan to route those over something like Home Assistant?
Yes and also for simulating an energy meter e.g. for Huawei inverters that have no other means of controlling their feed-in power.
First cut done, only RS485 missing
SPI flash can be connected to the SPI bus for initial programming by the BeagleBone itself
Re: Energy Controller including CCS interface
Posted: Sat Nov 01, 2025 3:32 pm
by johu
Before ordering I wanted to make sure that I can talk to the QCA with the linux kernel.
It is a bit of a palaver.
Here's the howto running QCA7000 on BeagleBone via SPI
git clone https://github.com/RobertCNelson/ti-linux-kernel-dev.git
cd ti-linux-kernel-dev/
git checkout 5.10.168-ti-r71
./build_kernel.sh
obviously you need to checkout the version matching your kernel in the 3rd command
The script will now endlessly download stuff (I think the standard linux kernel) and patch it. Then it will open the configuration menu. You need to set
Device Drivers -> Network Device Support -> Ethernet Driver Support -> [*] Qualcomm Devices -> <M> Qualcomm Atheros QCA7000 SPI support
So once you find Qualcomm Devices you select them with the space key. Then the various devices show up and you select ....QCA7000 SPI and press M.
Then navigate to the Save button and press it, then Exit by selecting "Exit" until the menu exits
Then the build process automatically starts.
Now in the "deploy" directory you will find 5.10.168-ti-r71-modules.tar.gz. Open it and navigate to
/*
* Copyright (C) 2019 Tomas Arturo Herrera Castro <taherrera@uc.cl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Written as part of my master's thesis at PUC Chile,
* to run the BeagleBone as an OpenThread Border Router w/o an NCP.
*
* https://www.sltech.cl
*
* Compiled using: make ./src/arm/BB-SPI0-QCASPI-00A0.dtbo
*
* Tested on BeagleBone Black Rev. C + REB233-XPRO. Linux beaglebone 4.14.71-ti-r80.
*
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
fragment@0 {
target-path="/";
__overlay__ {
chosen {
overlays {
BB-SPI0-QCASPI-00A0 = __TIMESTAMP__;
};
};
};
};
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
fragment@1 {
target = <&ocp>;
__overlay__ {
P9_17_pinmux { status = "disabled"; }; /* P9_17 (A16) spi0_cs0.spi0_cs0 */
P9_18_pinmux { status = "disabled"; }; /* P9_18 (B16) spi0_d1.spi0_d1 */
P9_21_pinmux { status = "disabled"; }; /* P9_21 (B17) spi0_d0.spi0_d0 */
P9_22_pinmux { status = "disabled"; }; /* P9_22 (A17) spi0_sclk.spi0_sclk */
P9_15_pinmux { status = "disabled"; }; /* irq P9_15 (R13) gpmc_a0.gpio1[16] */
};
};
fragment@2 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_qca_pins: bb_qca_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_A0, PIN_INPUT_PULLDOWN, MUX_MODE7) /* irq P9_15 (R13) gpmc_a0.gpio1[16] */
>;
};
spi0_qca_s0: spi0_qca_s0 {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE0) /* P9_22 (A17) spi0_sclk.spi0_sclk */
AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_INPUT, MUX_MODE0) /* P9_21 (B17) spi0_d0.spi0_d0 */
AM33XX_PADCONF(AM335X_PIN_SPI0_D1, PIN_INPUT, MUX_MODE0) /* P9_18 (B16) spi0_d1.spi0_d1 */
AM33XX_PADCONF(AM335X_PIN_SPI0_CS0, PIN_INPUT, MUX_MODE0) /* P9_17 (A16) spi0_cs0.spi0_cs0 */
>;
};
};
};
fragment@3 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_qca_s0>;
eth1: qcaspi@0 {
compatible = "qca,qca7000";
pinctrl-names = "default";
pinctrl-0 = <&bb_qca_pins>;
spi-max-frequency = <12000000>;
reg = <0>;
interrupt-parent = <&gpio1>;
interrupts = <16 IRQ_TYPE_EDGE_RISING>; /* gpio1[16] active high */
};
};
};
};
The interrupt line of the QCA chip is connected to P9_15 and the other pins are connected to P9 as well:
SPI0_CS:17 -> CS
SPI0_D1:18 -> MOSI
SPI0_D0:21 -> MISO
SPI0_CLK:22 -> CLK
Now compile the device trees and copy the new file where it is expected with
Super interesting subject ! Could this be used to do bi-directional charging from solar / to house ?
Re: Energy Controller including CCS interface
Posted: Tue Nov 11, 2025 4:56 pm
by uhi22
This is exactly the topic. However, this is just the control box, it needs an additional power device like a hybrid solar inverter.
Re: Energy Controller including CCS interface
Posted: Wed Nov 12, 2025 5:57 pm
by johu
And it's on the table
Almost worked out of the box, some resistors were not fitted and there ist a minor mistake in the pin mapping of the boost converter that makes +-12V for CP PWM.
With that fixed we have PWM
and the QCA chip is detected and communicates
Currently no firmware on the flash, I'm trying to figure out whether I can flash it via plctools without messing with the solder jumpers. If anyone knows where to find a firmware image for the QCA7005 or how to extract it from uhis binary, let me know https://github.com/uhi22/Ioniq28Investi ... _33_79.bin
Re: Energy Controller including CCS interface
Posted: Wed Nov 12, 2025 10:26 pm
by johu
Flashed the image directly today, works well with the solder jumpers.
First command results in 3 files from the "file system" of the flash. We merge them back together.
Then we splice 64k from the beginning of the file which brings us to the firmware "partition" and repeat the same trick. Same with the PIB file which we modify for EVSE use.
I've also added the precharge supply back in. I connected a 10uF 400V elcap and a 1M resistor to the output. This gives it a pretty deterministic voltage ramp which I think is also slow enough (0-400V in 6s) so that the vehicle will just report precharge completed.
Will start selling it on the shop soon. Hows interest?
Re: Energy Controller including CCS interface
Posted: Wed Nov 19, 2025 5:37 pm
by PoloLbricolo
I'll be interested, quite curious if my old Tesla will let me draw power out of it.
Re: Energy Controller including CCS interface
Posted: Wed Nov 26, 2025 6:53 pm
by johu
PoloLbricolo wrote: ↑Wed Nov 19, 2025 5:37 pm
I'll be interested, quite curious if my old Tesla will let me draw power out of it.
What would be the "minimum viable product"?
- Just the cape
- Cape + preprogrammed BeagleBone
Re: Energy Controller including CCS interface
Posted: Thu Nov 27, 2025 8:43 pm
by johu
Early forum release:
Also available in German
Re: Energy Controller including CCS interface
Posted: Fri Nov 28, 2025 9:39 am
by tom91
Love how this project combines a whole bunch of open source projects into one.
Would it be possible for you to draw a simple overview diagram of how the energy flows work?
I am not 100% sure how you move the power in and out of the Car and the stationary battery.
Re: Energy Controller including CCS interface
Posted: Fri Nov 28, 2025 11:25 am
by johu
Thanks. Would love to base it on something fancy like HomeAssistent but have 0 experience with these platforms. At least now it's very slim.
Tried to make a diagram. You can see that no energy can be exchanged between stationary and car battery. Perhaps you could connect the stationary to a free PV input if you really wanted that option. Not sure if inverters with 2 battery inputs allow exchanging energy between the two?
Re: Energy Controller including CCS interface
Posted: Fri Nov 28, 2025 11:52 am
by tom91
Thank you for the clarifying diagram.
Ah so you are doing a change over between the two. Which is fine really, unless you are looking to do "cheap" EV charging, but could always just use the AC charging for that.
Of course you could look at a DC-DC stage to link the vehicle via CCS to the battery bank.
I am currently working on Battery Intergrated Chargers with multiple power modules AC/DC and DC/DC. Im sure one could get second hand modules or "abuse" a Hybrid PV inverter some more. Key issues with PV inverters is the referencing they do as they are not galvanically isolated so you have a to be extra careful.
Re: Energy Controller including CCS interface
Posted: Mon Dec 01, 2025 2:55 pm
by johu
Did some minor changes for V2
It has a 7-20V 28V power supply now and a comparator for PWM generation.
Removed the Flash SPI for now as it can be programmed from the host.
Re: Energy Controller including CCS interface
Posted: Mon Dec 01, 2025 5:40 pm
by tom91
johu wrote: ↑Mon Dec 01, 2025 2:55 pm
7-20V power supply now
Can you not go to 30V make it 24V compatible? Lots of industrial gear is 24V.
Does it have reverse polarity protection?
Re: Energy Controller including CCS interface
Posted: Mon Dec 01, 2025 7:15 pm
by johu
In fact it's the TPS54302 also used on Foccci, so takes 28V. Yes D11 protects against reverse polarity.
Re: Energy Controller including CCS interface
Posted: Tue Dec 02, 2025 7:20 pm
by mike200088
Hello johu,
is it possible to get the KiCad designe files of your "cape" board?
Thx in advance.
BR
Mike
Re: Energy Controller including CCS interface
Posted: Tue Dec 02, 2025 9:11 pm
by johu
A very blunt question. As always the design will first be published on Patreon. I might decide to go fully open source later on
Re: Energy Controller including CCS interface
Posted: Tue Dec 16, 2025 11:27 pm
by FlexyZ
Hi Johannes,
When are you releasing the CAPE board?
So when you have the car DC connected to the inverter, you are sending some special CAN bus commands to inverter to trick it to see an BYD battery? - just so I understand it
Thanks
Felix
Re: Energy Controller including CCS interface
Posted: Wed Dec 17, 2025 7:15 am
by FlexyZ
I am also curious what kind of device is the precharge supply?