Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Justin's DIY battery

Featured Replies

  • Author
21 minutes ago, Gnome said:

Ah ok gotcha.  Still generally you won't see anything mains related without isolation, apart from the no-isolation/shock problem, it can cause fire quite easily if you go out of range.  The operating range of your circuit is very narrow I assume (ie. very close to exactly right AC voltage required).

At least I can't think of any products I've bought that uses DC without isolation. (expect perhaps an indicator LED with a resistor in series)

The basic PSU on the main board is a pretty solid unit.  It does include a polyfuse, but it is not really necessary, as the resistances are so high that even a dead short on any of the LV components can't raise the current high enough to trip it.

 

  • Replies 86
  • Views 22.7k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • JustinSchoeman
    JustinSchoeman

    Well, I finally twisted Jaco's arm into a non-blue install, and the results are beautiful... With the whole house as a dummy load, I also got a chance to properly test the battery and assorted bi

  • JustinSchoeman
    JustinSchoeman

    An evening's work, and the inverter is happy to think the Arduino isa Pylon battery... Now to get the two parts talking to each other...  

  • JustinSchoeman
    JustinSchoeman

    Thanks for all the tips guys.  Mostly incorporated and seems to work quite well. Here is a preview for anybody who wants to review it for me  : // HIGH VOLTAGE LOGIC if(bat_maxv > BAT_

Posted Images

24 minutes ago, Gnome said:

At least I can't think of any products I've bought that uses DC without isolation. (expect perhaps an indicator LED with a resistor in series)

I've seen many of those. All of them fully enclosed in some kind of flame-resistant plastic with nothing exposed so that it doesn't matter if there is no isolation. Everything from daylight switches to the V9261F-based al-cheapo plug-in energy meter. Capacitive dropper, rectifier bridge, some sort of regulation (zener, linear regulator), and then the goodies.

13 minutes ago, JustinSchoeman said:

The basic PSU on the main board is a pretty solid unit.  It does include a polyfuse, but it is not really necessary, as the resistances are so high that even a dead short on any of the LV components can't raise the current high enough to trip it.

The biggest concern isn't so much input resistance (which I assume is close to the MΩ range?).  It is the fact that the components don't fail safe.  IE> if they fail, they fail short.

Whereas transformer(s), Y class capacitors and light sources (ie. Opto) fail open (ie. safe).

Even resistors have voltage ratings.  Once exceeded, the resistor will fail short, regardless what its resistance rating was.  Ditto for diodes (I assume you used 1kV rated diodes because they are super cheap).

These failures are more common than people think.  A number of cheap-o USB chargers with no isolation were sold in China and electrocuted some people.

Again fire hazard is the biggest risk for you, assuming there is no way the thing can touch metal.  So I would just have a good way to prevent it burning the place up.

9 minutes ago, plonkster said:

I've seen many of those. All of them fully enclosed in some kind of flame-resistant plastic with nothing exposed so that it doesn't matter if there is no isolation. Everything from daylight switches to the V9261F-based al-cheapo plug-in energy meter. Capacitive dropper, rectifier bridge, some sort of regulation (zener, linear regulator), and then the goodies.

To your point, I googled V9261F and found this: https://mysku.ru/blog/aliexpress/59870.html

To get something like that legal, you probably need quite a bit of testing.  Similar to multimeter CAT ratings.  Most "reputable" voltage/current measurement equipment I've seen seem to favor current transformers rather than a shunt & direct voltage measurement like that.

But to be fair, you can get much more accurate data using a shunt & direct measurement.  It is probably just much more expensive to get through EU & US testing procedures.

Edited by Gnome

21 minutes ago, Gnome said:

To get something like that legal, you probably need quite a bit of testing.  Similar to multimeter CAT ratings.

I think the only thing you need to do is make sure nothing is exposed and that the plastic won't sustain combustion. Nobody cares beyond that point. Besides, the matter of legality assumes someone is going to police it... 🙂

Inside a DB-board, with an insurance company, there I suppose you have a good point.

Edit: Oh, and of course, you need to put a CE mark on there. No idea what it is for, but you put that on there to indicate you thought of safety... some time in the last decade.

Edited by plonkster

  • Author
46 minutes ago, Gnome said:

Even resistors have voltage ratings.  Once exceeded, the resistor will fail short, regardless what its resistance rating was.  Ditto for diodes (I assume you used 1kV rated diodes because they are super cheap

Again - I have not touched the PSU board - I am using the existing PSU of an existing SANS approved geyser timer.  The PSU is poly fuse protected, and has such a low maximum current that it could never pose a fire hazard, even if you replaced my circuit board with a wire from Vcc to GND.

3 hours ago, JustinSchoeman said:

Again - I have not touched the PSU board - I am using the existing PSU of an existing SANS approved geyser timer.  The PSU is poly fuse protected, and has such a low maximum current that it could never pose a fire hazard, even if you replaced my circuit board with a wire from Vcc to GND.

Oooh I thought you designed it

  • Author

Code is on github.  Still needs lots of cleanups, but some bits and pieces may be useful to others (and an extra set of eyes may help catch bugs ;) ) :

https://github.com/justinschoeman/dalybms

If anybody is going to play with this, the note in the first line is important.  Need to replace stock arduino bootloader with a recent optiboot. Otherwise the hardware watchdog causes a boot loop...

Edited by JustinSchoeman

  • 2 weeks later...
  • Author

Well, I finally twisted Jaco's arm into a non-blue install, and the results are beautiful...

With the whole house as a dummy load, I also got a chance to properly test the battery and assorted bits.

Load peaked at 11kW before the geyser controller managed to turn the geyser off, and then stabilised at around 8kW, with 195A draw from the batteries.  After around 10 minutes, batteries, terminals and connecting plates were all still at room temperature.  The wires connecting to the inverter were however a few degrees warmer.  Glad I did not go smaller than the 70mm^2 I eventually settled on. (I have 2x 95mm^2 wires in parallel for joining the banks - and these wires also stayed cool.)

All in all, it has turned out to be a successful experiment so far.

Been off grid for 15 hours so far, and hope to stay that way pretty much indefinitely.

install.jpg

bat.jpg

sunsynk.jpg

  • 2 months later...

@JustinSchoeman Congratulations good job.

I have Venus Victron installer on Raspberry pi with Original Display and I want to add for my 4S battery, in the future it will be 16S for my house.

I would like to send me information and pinout of the connections to my private email, I have tried to install in code in Arduino mega 2560, but it has not worked for me

I have an arduino mega with MCP2515 and I want to connect the serial port or rs485 to my arduino mega serial1 and send it via can bus to venus.

In a few days I will receive my BMS 4S UART port.

I have this conections, and can bus to Raspberry pi witj venus

my idea is to connect the BMS Daly to serial port 1

SPI Pins <=> Arduino Uno  <=> Arduino Mega 2560

SCK      <=>       13     <=>         52

MISO     <=>       12     <=>         50

MOSI     <=>       11     <=>         51

CS       <=>       10     <=>         53

   

Capture.png

This demo VEcan work in mega2560, need add your code


#include <mcp_can.h>
#include <SPI.h>

//variables for VE can
uint16_t chargevoltage = 49100; //max charge voltage in mv
uint16_t chargecurrent = 30000; //max charge current in ma
uint16_t disvoltage = 42000; // max discharge voltage in mv
uint16_t discurrent = 30000; // max discharge current in ma
uint16_t SOH = 100; // SOH place holder

unsigned char mes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
unsigned char bmsname[8] = {'S', 'I', 'M', 'P', '-', 'B', 'M', 'S'};
unsigned char bmsmanu[8] = {'T', 'O', 'M', ' ', 'D', 'E', ' ', 'B'};

MCP_CAN CAN(53); //set CS pin for can controlelr

int SOC =80;

float PackVoltage = 46.7;
float AvgTemperature = 20.5;
uint16_t currentact = 0;

void setup() {

  Serial.begin(115200);         //puerto CAN BUS

  if (CAN.begin(MCP_ANY, CAN_250KBPS, MCP_8MHZ) == CAN_OK) Serial.print("El BUS CAN se ha iniciado correctamente!!\r\n");
  else Serial.print("Error en el inicio del BUS CAN!!\r\n");
  CAN.setMode(MCP_NORMAL);
}

void loop() {
  // put your main code here, to run repeatedly:
  VEcan();
  delay(200);
}


void VEcan() //communication with Victron system over CAN
{
  mes[0] = lowByte(chargevoltage / 100);
  mes[1] = highByte(chargevoltage / 100);
  mes[2] = lowByte(chargecurrent / 100);
  mes[3] = highByte(chargecurrent / 100);
  mes[4] = lowByte(discurrent / 100);
  mes[5] = highByte(discurrent / 100);
  mes[6] = lowByte(disvoltage / 100);
  mes[7] = highByte(disvoltage / 100);

  CAN.sendMsgBuf(0x351, 0, 8, mes);
Serial.println(" ");
for (int i = 0; i<8; i++)
{
  Serial.print(mes[i]);
  Serial.print(" , ");
}

  mes[0] = lowByte(SOC);
  mes[1] = highByte(SOC);
  mes[2] = lowByte(SOH);
  mes[3] = highByte(SOH);
  mes[4] = lowByte(SOC * 10);
  mes[5] = highByte(SOC * 10);
  mes[6] = 0;
  mes[7] = 0;

  CAN.sendMsgBuf(0x355, 0, 8, mes);
Serial.println(" ");
for (int i = 0; i<8; i++)
{
  Serial.print(mes[i]);
  Serial.print(" , ");
}

  mes[0] = lowByte(uint16_t(PackVoltage * 100));
  mes[1] = highByte(uint16_t(PackVoltage * 100));
  mes[2] = lowByte(uint16_t(currentact / 100));
  mes[3] = highByte(uint16_t(currentact / 100));
  mes[4] = lowByte(uint16_t(AvgTemperature * 10));
  mes[5] = highByte(uint16_t(AvgTemperature * 10));

  CAN.sendMsgBuf(0x356, 0, 8, mes);
Serial.println(" ");
for (int i = 0; i<8; i++)
{
  Serial.print(mes[i]);
  Serial.print(" , ");
}

  mes[0] = 0;
  mes[1] = 0;
  mes[2] = 0;
  mes[3] = 0;
  mes[4] = 0;
  mes[5] = 0;
  mes[6] = 0;
  mes[7] = 0;

  CAN.sendMsgBuf(0x35A, 0, 8, mes);

Serial.println(" ");
for (int i = 0; i<8; i++)
{
  Serial.print(mes[i]);
  Serial.print(" , ");
}

delay(5);
  CAN.sendMsgBuf(0x370, 0, 8, bmsname);

  Serial.println(" ");
for (int i = 0; i<8; i++)
{
  Serial.print(bmsname[i]);
  Serial.print(" , ");
}
delay(5);
  CAN.sendMsgBuf(0x35E, 0, 8, bmsmanu); 
Serial.println(" ");
for (int i = 0; i<8; i++)
{
  Serial.print(bmsmanu[i]);
  Serial.print(" , ");
}

}

 

Edited by Jose Ibz

  • 2 weeks later...
On 2020/09/01 at 11:31 PM, JustinSchoeman said:

Code is on github.  Still needs lots of cleanups, but some bits and pieces may be useful to others (and an extra set of eyes may help catch bugs ;) ) :

https://github.com/justinschoeman/dalybms

If anybody is going to play with this, the note in the first line is important.  Need to replace stock arduino bootloader with a recent optiboot. Otherwise the hardware watchdog causes a boot loop...

Hi Justin

AWESOME WORK!!

I would like to play with this. Problem is I have no idea where to start. 

I have just finished my DIY battery, similar to yours, 16s3p 120AH 2nd Life cells. I would like to be able to communicate with my Deye 8kw inverter. Where does one start? 

Regards

  • 2 weeks later...
5 minutes ago, JustinSchoeman said:

You should be able to use my Arduino project pretty much as-is. Grab your favorite Arduino + a CAN shield (MCP2515 based for direct compatibility) + a RS485 shield.

Thank you... I am a complete noob at this sort of thing, but I figured i’d give it a shot, and the Arduino and other bits are on the way from China... 

I am also working with a mate on a python/raspberry pi project to try see if that will work. So far we have managed to establish comms between the BMS and the Pi. Next step is to Establish comms with the inverter, and  then mimic another battery much like you did. 

  • 5 months later...
On 2021/01/01 at 7:39 PM, Schallas said:

I am also working with a mate on a python/raspberry pi project to try see if that will work. So far we have managed to establish comms between the BMS and the Pi. Next step is to Establish comms with the inverter, and  then mimic another battery much like you did. 

@Schallas Sorry to revive this old thread, but did you ever get the Daly working over RS485 to a Raspberry PI? I'm interested to know how you connected this up and any Python you wrote to achieve this ;)

Thanks!

On 2021/06/18 at 5:39 PM, Lindsay said:

@Schallas Sorry to revive this old thread, but did you ever get the Daly working over RS485 to a Raspberry PI? I'm interested to know how you connected this up and any Python you wrote to achieve this ;)

Thanks!

Hi Lindsay

We did... Its not 100% yet, but it is working most of the time. 

The serial/uart comms to the Raspberry Pi works fine, but like @JustinSchoeman also mentioned, it spits out dodgy data every now and then. From the Raspberry Pi we had to add a CANHAT to the RPI, and then we went the CANBUS method. The code is a bit messy, I am not a programmer by trade so you can imagine where this is going. I have odd bits and pieces in there to control my pool pump ect... 

You can check it out here: https://github.com/tomatensaus/bms

Regards

Awesome, this looks great.

I've ordered a RS485/CAN PI hat from Micro Robotics, maybe the same as what you have, it passes through all the pins. Useful as I also have some relays etc that I need to operate from the PI (one of which, in summer, switches on a submersible pool pump to heat water on my roof depending on the temperature difference). 

My inverter sometimes spits out dodgy data or hangs/timeouts when I try access it's comms via usb. So I'm used to having to discard data (or move on if I don't get anything back) and then try again later :P 

Thanks again!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.