O2Micro OZ890 Based BMS Units

Thanks for the reply!
Crossbreak, you were working on a monitoring app via bluetooth or so, could the bug be corrected with that, too?
I mean the ATtiny25 (wow that is small, only 8 pins!) would communicate via SPi etc, like your app thing, right?

Don't know about current, asked rolf_w, he had made some simulations/graphs.
 
the attiny is just a device that hangs in the I2C bus directly on the BMS. this way it doesnt need any opto couplers. But it cannot drive a BT module, the 3.3V rail of the BMS is for 20mA max. The BT module sucks 30mA alone. If you want to really communicate with the BMS you can only do 2 things:

- connect an I2C programmer externally that is powerd by an insulated supply (Laptop/phone/tablet with own battery for example),
- or an optocoupler that isolates the bus. But the optocoupler must be powered from 3.3V/30mA on the BMS side from the 3.3V rail. Guess an I2C coupler suck more current :(

Otherwise you will see battery voltage on the bus if the FETs shut down with B+ still connected ;)
 
I see, how about something like this:
http://www.ebay.com/itm/400543054196
http://www.ebay.com/itm/390657918516
http://www.ebay.com/itm/181227591312

In series with a 1W zener selected for higher volt configurations?

They barely get warm at 50mA.

And optos, $2
http://www.mouser.com/ProductDetail/Avago-Technologies/ACPL-M61L-560E

Or better, isolators (same thing as opto)
2.1 mA per channel, $1 at Mouser.
http://www.digikey.com/product-detail/en/SI8421AB-D-IS/336-1755-5-ND/2170662

Edit1:
Wow, these are cheaper than I thought.
Here is some more, we would need only one low power (OZ side), but they are so cheap, could get two of these for $1
http://www.newark.com/vishay-semiconductor/il215at/optocoupler-transistor-3000vrms/dp/20H8787

The speed at which the BMS communicates should be below all these, unless poropagation delay is an issue.

Used this link and limited the mA and sorted by price/availability just to get an idea.
http://www.newark.com/optocouplers

Edit2:
how many mA would ATtiny draw for these (bug correction/constant bluetooth sending) functions?
 
these PSUs are not isolated, they have common ground. but these "nano tranfromers" with only 2.1mA should work. There are even versions for I2C that suck only 3mA. They are bi-directional for SDA but single directional fpr SCL, just what we need.
 
I was thinking on leaving the Attiny and isolators on the BMS side, and those power supplies for the bluetooth on the other side of the isolators.
All depending if the BMS could support the Atiny.

If not, then just use the isolators at the BMS and do it all on the other side.

Meaning the optos could be simple ones for just "driving" the Bluetooth module if the Attiny is hooked up to the (more complicated) I2C interface directly.

Would that work?
 
Those "nano tranfromers" (and mostly "nano capacitors") was all we had before silicon based optocouplers became available.
Some OpAmps had them built in, was fun linearizing them.

And these isolators beat optocouplers in many ways.
To this day.
 
i dont see the problem to implement I2C into an attiny. should not use too much space. an attiny 85 has 8kB :D our code for reading/writing BMS registers is already working, it has less than 8kb.

The wiring you describe is just how I wanna do it ;) still, i would want the isolators on the i2c bus directly. the BT module could be indeed placed apart from that on the ebike/charger side. No more isolation needed. the ebike AVR can be powered by a non isolated buck converter.

Or do you see any additional problem here?
 
Cool, so the Atiny does not consume too many of the precious milliamps?

I'm looking into getting a smart phone just because of this.
Would be sooo cool to monitor/record/the data coming from the OZ.

If the Attiny could be right with the BMS, it could also measure the amps (shunt of the controller maybe?).

That would be supercool!!
 
the attiny85 has differential ADC with integrated 20x opamp. you could measure currents down to 100mA with an 1mOhm shunt if you can get the full 10bit resolution. Not very accurate, but should be ok for a simple "gas gauge".
 
Amazing what they pack into these things!

So back to the power issue (couldn't find how much they consume), would that attiny85 plus the isolators be viable with the 3.3V supply from the OZ890?

What about when it goes into sleep mode and the 3.3V are turned off?
 
you can measure youself... the attiny is below 10mA, the isolators below 6mA... so together it bulls about half of what is within spec. 3.3V sleep mode is a great thing, it's just all turned off :D As soon as the BMS detects Capacitor "precharge", it will go into normal mode and start the ATtiny+isolators
 
Don't have such an ATtiny to measure it unfortunately.
Been out of that world for ages.
The specs said something around 330uA, which looked too low, so thanks for the 10mA.
This looks all great!

I read some of the application notes for the ATtiny, really amazing what this thing can do.
Envy your knowledge in handling/programming these....

Now that my OZ890 board is working, it's really fun to watch the values rise during charge and the LEDs kick in sometimes.

Another thing that crossed my mind, it would be really great if your ATtiny could "memorize" the fault if one happens.
Maybe a large cap and a backflow Schottky would give the ATiny enough time to save those flags in EEPROM?

How do you talk to your bluetooth module BTW?
Is it legacy serial or I2C?

Thanks Crossbreak!
 
its serial. The BT module is NOT on the BMS. I dont have an ATtiny on my BMS yet. I just use my i2c LCD with an arduino nano that is powered externally by 9V block battery :D the nano has just a BT module on it's serial port.
Didn go further than this yet, too many other projects ATM. I have played around a little with the attiny85 but didnt implement software i2c since did not yet find a good working library .
 
Yes, I do understand that the BT module is NOT on the BMS, it draws too much power, you mentioned that earlier.
There are some isolators which also provide (isolated) power over the barrier, up to 500mW, but as you mentioned, the OZ890 should handle the power of the ATtiny plus isolators.

Given that the bluetooth draws 30mA, plus say 10mA for the isoloators, a 1$ shipped DC/DC converter like this
http://www.ebay.com/itm/181227591312
DC-DC_40Vb.JPG

plus a 1 or 2 Watt zener h/eating the rest away should be able to handle that side.

So it all boils down to the code...

I saw your implementation of the OZ890 data visualization on youtube, very impressive!

Pray you could make some time and do your magic and get the ATtiny going.....
 
for what do you need a zener? I use the 2596HV which is fine with 55V just like the OZ890.

this is what's currently on my board:

-arduino
-lm2596hv (not in use ATM, deactivated by jumper)
-bt module
-pcf8574 for saving d-pins, a 2004 LCD
-some resistors, one diode, one big 10.000µF cap
-a lot of wire for CA-DP plug to controller, throttle, temp sensor, BMS :D
 
The LM2596HV is a chinese knock off of ti's LM2596 (same with those LM2596, they are not from ti).
The HV version is supposedly the "high voltage" version of ti's LM2596.
I could not find any datasheets for the 2596HV, but tested it and my 3 units were quite unstable at over 47/49V.
So it's good that you use a very large cap.
I think they simply sort out those which can stand a higher voltage and label them as HV.
But with a 18V zener they are really good, and with 3.3V@50mA a 400mW zener is all it takes.
Pricewise it is better, too, the zener is cheaper.
I put it right onto the pictured dc dc converter pictured above.

Could the arduino be used instead of the ATtiny?
I mean if you got the code running, even if it costs a little more, wouldn't that be an option?

Are you using a particular bluetooth module or are they all the same?

Thanks Crossbreak!
edit forgot to mention that even the logo of (former) National Semiconductor is totllay off on these knock offs
 
thanks a lot for this info, i'll try the zener! I'll use a different converter on my next board, one that can stand 100V, but only 100mA....that's sufficient.

you could use an arduino maybe, but i'm not sure about power consumption. anyway, an attiny is easy to program by using an FTDI adapter through Arduino IDE. You could even use serial (soft serial) for debugging like when using a real arduino board. Just google, the net is full of guy who use attinys

I use a random BT module off ebay labeled "lctech"), sadly I got one without "state key" so I have no idea how to change the baudrate :x a friend has a very similar that has this key, it was easy to change baudrate to 115200, 9600 is so slow...very time consuming debugging :cry:
 
So I googled arduino and found out that it is a board (23 actually).
I thought it is a board had a special "arduino" processor.
Doh!

The reason why I asked about using an arduino was because you mentioned that you couldn't find a good working library for the ATtiny.
And you have it running on the arduino.

Found the bluetooth, it should be a host mode unit, right?
Thanks for pointing out the baudrate thing.

There seems to be simpler version without a memory chip, maybe that's what you've got?
http://www.lctech-inc.com/Hardware/Detail.aspx?id=6a847d51-2095-446f-8eac-20b14d9c22a5

All the others seem to be able to change (and retain) the baudrate.
http://www.lctech-inc.com/Hardware/Default.aspx?Id=d5080436-f245-4c71-8f7b-bd5a826bc23c

Thanks!
 
crossbreak said:
I use a random BT module off ebay labeled "lctech"), sadly I got one without "state key" so I have no idea how to change the baudrate :x a friend has a very similar that has this key, it was easy to change baudrate to 115200, 9600 is so slow...very time consuming debugging :cry:

Very interesting, found out that there seem to be one major chip/hardware but in different versions.
They do have the same hardware but different firmware.
And the firmware can be changed it seems.

http://mcuoneclipse.com/2013/06/19/using-the-hc-06-bluetooth-module/
http://byron76.blogspot.com/

Hope this works for you, good luck1
 
Would it be possible to not only monitor but also reprogram the SmartBMS via the bluetooth/uController/I2C interface??

That would make life so much easier!
 
Seems not all data is written to the EEPROM.

Programed OZ890 with "BMS_battery_factory_EEPROM_Setting_12s.eep" (with the OZ890 debug tool, used "read from file" and "write to EEPROM").
Then read back the configuration from EEPROM and saved it as "BMS_battery_factory_EEPROM_Setting_12s-readback.eep"

Here are the differences of the original the file read back

First line is the original "BMS_battery_factory_EEPROM_Setting_12s.eep"
Second is the readback "BMS_battery_factory_EEPROM_Setting_12s-readback.eep"

Internal Temperature Offset,0x0002,167,0x0116,Register 02h - Internal Temperature Offset Register
Internal Temperature Offset,0x0002,0,0x0116,Register 02h - Internal Temperature Offset Register

OSC Trimming,0x0022,1,0x0196,Register 22h - OSC Trimming Register
OSC Trimming,0x0022,0,0x0196,Register 22h - OSC Trimming Register

Bandgap Temperature Trim,0x0024,48,0x0196,Register 24h - Mapped Reserved2 Register
Bandgap Temperature Trim,0x0024,0,0x0196,Register 24h - Mapped Reserved2 Register

Banggap Trimming,0x0025,149,0x0196,Register 25h - Banggap Trimming Register
Banggap Trimming,0x0025,0,0x0196,Register 25h - Banggap Trimming Register

Tried to use the "Pro" page to access the registers, couldn't figure it out/didn't work.
 
this is interesting.... never tried that. too many things to do tomorrow, but i will try that next weekend as well. lets see if we can manipulate these using arduino.


programming the smart bms via bluetooth would be possible. but i would not try that. USB is better IMO. BTW you need a "device module" not a host one.
 
BTW, this all is done with OZ890 Debug Tool version 0.87, if you have a newer version PLEASE let us know.

I recommend to check the "Enable Packet Check" under options, maybe what me an Circuit experienced had to do with an error in communication.
That could happen very well as SCL and SDA are not terminated correctly on the SmartBMS side.

Anyhow, there seems a way to manipulate those Offset/Trim registers, I just don't understand the mechanism.

But first things first, here is what I found out.

The "Pro" setting only works if you enter the password from #67 into the "Passwd" menue first (though it is for a block erase it seems, but I didn't touch that).
Only after that was I able to get some readings from the "Pro" menue.

F.I. I put in "Hex Address 0x63" and clicked on "Read" and it gave me back "Hex Data 0x5". And differnt things for other registers.
So writing works probably, too.

So there seems a way to manipulate the registers (both EEPROM and Operation Registers), but I don't know how.

Then there is "EEPROM Protected Data Modification Mechanism" on page 45 which I think might have happened to me and Circuit.

This needs brains like you guys to find out.

Also, does anybody have the elusive CowBoy software referred to here?

Maybe all this works with that?

Crossbreak, thanks for the info, will order a bluetooth so I'm prepared when you do your magic.

Sadly and much more pressing than the bluetooth thing is that the batteries cannot be used for now because of the hig temperature issue mentioned, at least until somebody finds a cure for that.

Thanks!
 
Hi i´m brainfuckr, me and crossbreak are working together on this project.

Since I´ve written the code for the bms reading/writing via arduino, i don´t think you are getting packet errors. I never used PEC and my readings always corresponded to the ones made with the crossbreaks adapter from bms battery.
The smart bms does eeprom mapping to the operation register for some registers controlling the internal engine and authenication control. So there is some duplicate data floating around which can confuse sometimes.
The operation register has a lof of read only registers, but needs to be used to alter settings, even into the eeprom (read or write).

If you want to write you should fist check wheter you are on operation or eeprom register, but i guess its the 1st one.

If you want to set the internal temperature offset register, which is on eepregister 2h you should look into the datasheet and understand the eeprom access logic and maybe try to set the factory name first too see if it worked.
Note that you should really be sure of what youre doing, otherwise you may damage the board/battery/yourself.

You can find the latest smart bms tool download at bms battery.

Btw i got a JY-MCU V 1.05 bt module with STATE key and succeeded in changing baud rate and name, when we find time we want to try enabling AT mode with crossbreas module.
 
Back
Top