DIY Lithium Battery Balancer and monitoring (BMS)

Hey Guys;
Took awhile to get all the parts in. I have put 2 boards together. I have flashed the attiny. When I add power to the modules I get a Green light for about 5 seconds. It goes dark for about 5 seconds. Then it comes back on and stays on.
I am using a wemos d1 mini as the module controller. I have flashed with a USBasp. I used the settings described a the top of the Arduino code for the wemos. The wemos took the code I am able to connect through wifi.
My problem is that the controller does not recognize any modules.
I have made plenty of mistakes along the way:

  1. Wired up the Module2Controller backwards.
  2. Had the wrong IC on the module 1201ARZ instead of 1250ARZ.

Any ideas on what could be wrong?
I think I have read that when a connection to module is made that you get a Green Blinking light. I have not had this.
Also, I am curious about the attiny Reset mentioned by Beardman.

Bob

The solid green light indicates that it’s in a factory reset state and has not been provisioned, which is a positive step. The flashing is that it’s in a panic state and can’t communicate with the controller.

When you say you’ve flashed it using the settings, have you also set the fuses/speed etc? You do this by setting everything as needed and then choosing burn bootloader, it’s the last option in the tools menu. You need to do this as the speed on the ATTiny’s is set at 1MHz by default, uploading the code won’t set the speed. Once you’ve done this you can then go into the web interface and provision the module.

Will try. Thanks Colin. I am also an influxDB/Grafana guy, so what you are doing is awsome for me if I can get it all working.

1 Like

No success.

Check the basics - it looks like the modules are working correctly based on the LED pattern you get, so:

  • Make sure only 1 module is connected to the i2c bus for the initial provisioning!
  • Make sure you have pullup resistors on the NodeMCU/Wemos
  • Make sure you haven’t mixed the i2c data and clock signals/wires
  • Check you have the correct pins on the wemos for i2c
  • Keep the i2c cables as short as possible (perhaps try twisted cable if needed)

dropped you a direct message on here if you want to chat over google hangouts.

Hey Colin;

Just for clarification, attached are some photos of what my module and controller looks like. I have added pin positions. In the controller picture, I do not have pull-up resistors, this is a shield I made without them (some information says that the wemos d1 mini has built in pull-up resisitors.

Bob

(upload://5tenYdvALsRnPQKY4odS6vqxRuk.png)

controller

Okay, disconnect the module from the i2c cable and then test with a multimeter between ground and the clock and data lines - both should be 5V if not, you need pull up resistors!

i’m using a wemos d1 mini and still required pullup

I am using the shield that has 5KRs on D1 and D2.

Reading on the wemos side of the adum1250arz I have 3.3V on all pins.

Reading on the module side of the adum1250arz I have 2.48V on all pins. Which matches the voltage on capacitor C2 (don’t know why it is not 3.3V).

The wemos still does not recognize the module. Is there a Hz speed for communication that needs to agree between the attiny and the wemos?

I’d recommend using the controller test program which stuart wrote. use that and look at the serial output, when you do an X and search does it show any modules and are you able to provision it? if you can if you do an R for reading (i think) does it list 4 consistent values?

Re the cables have you made sure that it’s linking to the correct pins so when you look at the two plugs they are identical.

Re my earlier comment about speeds and burning the bootloader, did you do that step?

Also double check you have the adum chip around the correct way!

Do you get 3.3v on the data line with NO module connected?

Do you think it would be possible to use the wemos oled shield to display the cell voltages?

I spent yesterday building a new module (being as careful as possible). It may be just me, but whether I bake a module on a hot plate or solder each component, I have to do a good bit of ‘fixing’ of solder joints throuh my multimeter using continuity testing and voltage checks (I am learning alot about electronics).

  1. I have been using the controller test program for troubleshooting.
  2. No modules answer on ‘P’ cmd. No results on ‘X’ scan.
  3. I have checked, and re-checked the alignment of the pins from wemos to module (gnd2gnd, scl2scl,sda2sda,vcc2vcc).
  4. I have done the bootloader for the module. I have noticed that the green light now activates quicker when power applied.
  5. I have NOT done the avrdude speed settings. I have been a little nervous about doing the command line switches. I guess I need to move forward with this.

I have removed the USBasp programmer from the attiny85 process. I am now using the arduino with an attiny shield.

Hey Stuart;
I am using a screen shot of Adam Welchs youtube video for this. See Image.

Without the speed setting it won’t work. You can set the speeds by burning bootloader as I mentioned earlier in the thread. The code is designed for an 8mhz chip and your running it in a 1 MHz chip so all the timings are off.

You can mask this by modifying the clock stretch as I’d mentioned above also but it is purely masking the problem

Colin

I ran the following on the attiny per the arduino code:

.\bin\avrdude -p attiny85 -C etc\avrdude.conf -c avrisp -P COM5 -b 19200 -B2 -e -Uefuse:w:0xff:m -Uhfuse:w:0xdf:m -Ulfuse:w:0xe2:m:

It ran without complaint. and finished with done and thankyou.

Running the controller test .io - Still get: i2c Provision: No module

If you look further back in the thread regarding clock strech, try those changes out of interest. When i had issues with the clock speed i was able to change that setting and i was able to mask the issue somewhat for the initial comms at least. it’s also on my youtube channel. Colin Hickey - YouTube

Hey Colin;

I tried setting clock stretch to 1500 and 4500, still nothing. I am running the controller test.io I have tried on two different Wemos D1 minis. And a couple of different modules (my module building skills are not the best).

@Bob_Brundage do you have a multimeter with a logic probe function on it, if you do try probing the i2c data pins on the module - do you get a signal/data flowing?

Try both sides of the ADUM chip to ensure thats working okay?