Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic battery monitoring ideas.
#11
(07-17-2019, 02:04 AM)Mikethezipper Wrote: Mr Wolf,

Glad to see you got it up and running. .............................

Mikethezipper,

Thanks

Well my cheap(actually inexpensive) MakeSkyBlue charge controllers do not have any kind of serial output. So till I step up to the plate and get a "real" charge controller, either Arduino or Rp or some derivative thereof is my option.

So just to be clear the ESP8266 was just an experimental first try. The results are encouraging and there is still a lot more work and coding to be done. Just getting the readings to post to the influx database was a challenge but the hurdle was overcome.
Also it seems a 0.1uf capacitor from the ADC pin to ground has seemed to stabilize the noise quite a bit. 
Here is the Grafana 1 second sensor update and you can see after 19:00 hrs the sample rate smoothed right out after I installed the capacitor.


I am now working on an ESP32S NodeMcu Dev board which allows me to have 6 ADC pins to my disposal. I also have hooked up an i2c BME280 and a VEML7700 LUX sensor. This board has 12bit resolution for the ADC so that should allow for more granular measurements. We will see.
As far as the chips reference voltage is concerned yea I agree but there can always be an offset (int offset=xx)

I plan to measure Voltage on all 3 of my arrays, both battery banks, and with an AD8215 "OpAmp" I can measure my 100/75mv Shunt with reasonable resolution.
I'm not done yet I already have all the Shunts in place anyway feeding the standard meters most of us have and will use a 2nd ESP32S  with the AD8215 to measure all the other shunts and dump that into influx.


As far as other readings are concerned such as watts a simple calculation can be made in the code and sent to the database or grafana can do that too.
Additionally I have a lot of other data going into my influx from IotaWatt. I also have 2 wifi sticks on my GTILs that give me voltage, wattage etc. but I have to go to their website to get that data and I am trying to get everything local in one location.
Besides its fun.

Right now I am posting 10 readings to my influx database and I must say the ESP32S board is quite fast. Either that or I wrote some lean code by accident Tongue .
The ESP8266 is very slow in comparison.

Here are the results of posting just sample data with the ESP32S
 
The gap you see is me unplugging it from home and plugging it in at work.
 

Wolf
If 18 X 650 = 2200+mAh then we have power! 
May all your Cells have an IR of 75mΩ or less Smile
Last count as of 8/7/2019
Total Number of Cells Recorded and processed                 6149
Total Cells required for PowIRwall                                   2856
Total Cells ≥2200mAh, ≥80%, ≥35mΩ, ≤75mΩ, ≥4.12V   2760
For Info Google Drive
Not your average Wolf       
            Cool
Reply
#12
OK Update on the ESP32 with all Arrays and Batteries hooked up.
The prototype is working good.
The ESP8266 is just there as a 2nd Battery 1 monitor for now.


It's looking good on the chart also.
Don't pay attention to the Amperage chart that one is just feeding fake data I haven't set that up yet.
It looks like the BME280 had a glitch so the  Lux sensor at ~10:30 AM went ballistic so never mind that reading.  Tongue Besides it's in the shed I will need to build an enclosure for it so that it can read the outside light intensity. 



Wolf
Korishan likes this post
If 18 X 650 = 2200+mAh then we have power! 
May all your Cells have an IR of 75mΩ or less Smile
Last count as of 8/7/2019
Total Number of Cells Recorded and processed                 6149
Total Cells required for PowIRwall                                   2856
Total Cells ≥2200mAh, ≥80%, ≥35mΩ, ≤75mΩ, ≥4.12V   2760
For Info Google Drive
Not your average Wolf       
            Cool
Reply
#13
Update:
The system is now complete.
1 ESP8266 running a BME280 for atmospheric info.
1 ESP32 with 1 ADS1115 16-Bit ADC  to do Voltages and 1 ESP32 with 2 ADS1115 16-Bit ADCs to do the amperages.
They are working perfectly and it gives me a complete view of the plant now.
Since they are all i2c chips I will work on incorporating the whole thing into 1 package. Great stuff these ESP32 dev boards. Never had so much frustration and fun in one go.
I still need to add the amperage coming in from the arrays but the important data is now visually available 

Wolf
Korishan likes this post
If 18 X 650 = 2200+mAh then we have power! 
May all your Cells have an IR of 75mΩ or less Smile
Last count as of 8/7/2019
Total Number of Cells Recorded and processed                 6149
Total Cells required for PowIRwall                                   2856
Total Cells ≥2200mAh, ≥80%, ≥35mΩ, ≤75mΩ, ≥4.12V   2760
For Info Google Drive
Not your average Wolf       
            Cool
Reply
#14
Wow man, impressive work!
Just curious, if you are using an external ADC, why use 3 microcontrollers instead of just the ESP8266?
In case you are feeling extra good, it'd be nice if you shared your code on github or something and linked it here for the community to.

My original BMS project was going to go down the road you described, but I ended up going with the Texas Instruments BQ chip because those chips come pre-calibrated from the factory, with built in non-linearity and temperature compensation. Plus in the end they were a similar cost as a dedicated ADC chip alone.
I've finished most of the hardware aspect of it, but I'm slowly making my way over the the SW. Since we are using arduino based micros, we can probably share with eachother our code (my code is on github - look up mikethezipper)

Are you using the ESP chip or a raspi for the grafana server? I ended up using NodeREd vs influx&grafana because it doesn't actually save the data, just stores it in ram - so it's not using up lots of read/writes on the flash memory just to stream data.
Reply
#15
(08-06-2019, 12:58 AM)Mikethezipper Wrote: Wow man, impressive work!
Just curious, if you are using an external ADC, why use 3 microcontrollers instead of just the ESP8266?
In case you are feeling extra good, it'd be nice if you shared your code on github or something and linked it here for the community to.

My original BMS project was going to go down the road you described, but I ended up going with the Texas Instruments BQ chip because those chips come pre-calibrated from the factory, with built in non-linearity and temperature compensation.  Plus in the end they were a similar cost as a dedicated ADC chip alone.
I've finished most of the hardware aspect of it, but I'm slowly making my way over the the SW. Since we are using arduino based micros, we can probably share with eachother our code (my code is on github - look up mikethezipper)

Are you using the ESP chip or a raspi for the grafana server?  I ended up using NodeREd vs influx&grafana because it doesn't actually save the data, just stores it in ram - so it's not using up lots of read/writes on the flash memory just to stream data.
Thanks Zip

Influx and grafana are hosted on ubuntu running on an old IBM bullet proof thinkpad soon to have 960gig  SSD drive.
It all started with IotaWatt posting to influx and visualizing the data with grafana.
I have almost a year of IotaWatt data and it amounts to less than 80meg so I'm not worried about resources at the moment.

I initially was using just 1 esp8266 but since it only has 1 ADC I was limited to it and also 10bit resolution.
I kept the BME 280 on it as it was working just fine.
I wasn't thinking about the i2c at this time.
You have to remember I didn't even know what an Arduino was 8 month ago. If you had asked me I would have guessed a fancy Italian car manufacturer maybe.
Along comes the ESP32 with 6 usable ADC channels and resolution was better at 12 bit.
Tried that and unfortunately readings where kind of all over the map. I was using twisted pair wire and all the right things but not really getting good results. Initial V divider was 47K and 1K to take a max of 160V to 3.3V well that was pushing the resistors wattage to the limit as my fingers discovered so I went all out to  1M and 22K and that worked.
Unfortunately the ESP32 was still too jumpy with the results. I tried averaging and that seemed to settle things down some but in the long run the readings still were not satisfactory.
I was searching for a solution.
In comes the ADS1115 16bit gain programmable ADC. i2c communication life is good. Perfect.... great resolution for 3.3V and also for 75mV for the shunts.
Got 2 of them recognized on 1 ESP32 now just hook up the wires and go.  Voltages were good and stable I was happy. OK hook the shunts up common ground on the low side 75 mV on the high side of the shunt what could go wrong?  Ha I pulled a great noob the Amp readings where all over the place until I disconnected all but 1 and it was not so good either. I thought about it and soon realised with a common ground the whole wiring and every shunt would become a shunt so I was in essence shunting the shunts. Then I remembered reading about the ADS1115 being abler to do a differential input between 2 channels. Aha the answer no need to use a common ground. So I reworked the Voltage ESP32 to do just voltage and since I have 6 or 7 ESP32s I just threw another one together
with 2 ADS1115s for the amp measurement off of the shunts. That all worked perfect. So that's how I came up with 3 microcontrollers.
Oh and by the way the ADS1115 does negative flow also so I can see if the battery is discharging which is a plus. But as I said in my post I will rework all this and put 4 ASD1115s on 1 ESP32 (compared to the ESP8266 the ESP32 is at least 10 times faster) chip and add the BME280 combine all the code and try it. But not right now.

I was looking at node red and mqtt etc. etc. till my head started to spin it was a challenge to get influx and grafana up and running let alone this thing about mosquitto and mqtt brokers ..........................?????
Up until a couple of month ago the most I coded was some batch files on a server. 
So maybe you at some point can enlighten me on those avenues.

All in all coming this far in 4 months not bad for a newbie.

BTW I did a search on github for mikethezipper and i am a follower now.

Wolf
Korishan likes this post
If 18 X 650 = 2200+mAh then we have power! 
May all your Cells have an IR of 75mΩ or less Smile
Last count as of 8/7/2019
Total Number of Cells Recorded and processed                 6149
Total Cells required for PowIRwall                                   2856
Total Cells ≥2200mAh, ≥80%, ≥35mΩ, ≤75mΩ, ≥4.12V   2760
For Info Google Drive
Not your average Wolf       
            Cool
Reply
#16
Update:

A full 24 hrs and all looks good.
The only thing I am noticing is that Array1 the voltage goes ballistic after midnight.
Then settles down in the morning.
As far as I know there is no UFO hovering over that array in the middle of the night. Tongue
Must be some kind of interference not sure what though.

Wolf
If 18 X 650 = 2200+mAh then we have power! 
May all your Cells have an IR of 75mΩ or less Smile
Last count as of 8/7/2019
Total Number of Cells Recorded and processed                 6149
Total Cells required for PowIRwall                                   2856
Total Cells ≥2200mAh, ≥80%, ≥35mΩ, ≤75mΩ, ≥4.12V   2760
For Info Google Drive
Not your average Wolf       
            Cool
Reply
#17
(08-06-2019, 11:14 AM)Wolf Wrote: The only thing I am noticing is that Array1 the voltage goes ballistic after midnight.
Then settles down in the morning.
As far as I know there is no UFO hovering over that array in the middle of the night. Tongue
Must be some kind of interference not sure what though.

Are you sure there isn't a UFO? Do you have a camera to record that Array at night to make certain? Maybe your neighbor is going out there in the middle of the night and waving a flash light on it Tongue
Proceed with caution. Knowledge is Power! Literally! Cool 
Knowledge is Power; Absolute Knowledge is Absolutely Shocking!
Certified 18650 Cell Reclamation Technician

Please come join in general chit-chat and randomness at Discord Chat (channels: general, 3d-printing, linux&coding, 18650, humor, ...)
(this chat is not directly affiliated with SecondLifeStorage; VALID email req'd)
Reply
#18
Wow Wolf, I am so impressed I'm honestly humbled. You've gotten more done in a couple months than I have in a year Tongue

Since you are using an actual hard-drive, there is no benefit to anything I mentioned previously - that was only if you are using a raspi. Many users here use raspberry pi's , but they have a serious limitation in that they are basically really crappy computers that use sd-cards for memory that have a limited write cycle life.

Your issues with Array 1 are so high in voltage and last for so long that it makes me wonder what's going on too - it's not just noise, it's legit reading at double the voltage it should even be able to put out. Good luck man! I'm super interested to watch what you've been doing. Thanks for the updates and the inspiration to get off my butt and get something done
Reply
#19
I doubt you gain much using the ESP32 in speed as such. If your software as such runs faster on the ESP32 you have coded it wrong Tongue

Yes the ESP32 is faster since it for instance have dual core but the task you perform should not be an issue. What could be is if you do alot of calculations or if you instead of running waiting for data from external sensors. That could halt the system

With that said the ESP32 is significantly better towards Wifi since it can use 1 core for that and the other for your normal tasks.

Good work and keep it up for sure!
The Arduino and ESP family is realy nifty tools to have and use. Its so easy to get data from them. The tricky part is to make sure the data gotten is accurate.

Influx is a good database for timeseries data. Just read up on how you save it because it can be done in many ways... Most of them wrong if you want to do some work on the data later on Tongue I have learned the hard way several times.
The Ultimate DIY Solar and build place
YouTube / Forum system setup / My webpage  Diy Tech & Repairs

Current: 10kW Mpp Hybrid | 4kW PIP4048 | 2x PCM60x | 83kWh LiFePo4 | 10kWh 14s 18650 |  66*260W Poly
Upcoming: 14S 18650~30kWh | Automatic trip breakers, and alot more
Reply
#20
Thanks Zip and Daromer,

I'm so glad to have joined this board and forum to discuss ideas and be able to share successes and failures.

I basically was using the same code on the ESP8266 as I was on the ESP32 and my impression was that when I was doing a serial.println
to display the results on a serial monitor it seems that the ESP32 was writing the data faster to the influx database than the ESP8266. At least the Response: 204 (write successful) would come back faster on the serial monitor.
(08-07-2019, 08:50 AM)daromer Wrote: The Arduino and ESP family is realy nifty tools to have and use. Its so easy to get data from them. The tricky part is to make sure the data gotten is accurate. 
Very true. As I was bench testing all my stuff I would make sure that the readings I was getting were accurate thorough the normal ranges that the sensors where expected to have and adjusting the calculations for that before I hooked everything up. After all we all know the expression "Garbage in Garbage out" Tongue

So that was my impression. The chips cost about the same so hey "whatever" it's not like we are spending hundreds of dollars on them. Smile

On another note yea I got three days recorded now of this anomaly happening on Array 1.
If I had this high of a voltage it would have fried my ADS1115 as my voltage dividers are set up for a max of 3.3V at 160V.
I will try another ADS1115 but it's just odd it happens around the same time every night. and it's just Array1 Huh
 

 
Quote:Korishan
Are you sure there isn't a UFO? Do you have a camera to record that Array at night to make certain?  Maybe your neighbor is going out there in the middle of the night and waving a flash light on it  Tongue

LOL no I don't have a camera on the Array but if it is my neighbor with a flashlight it's got to be a zinger of one. Must be lighting up the whole neighborhood with 10 million candle power. I wonder if he is using Li-ion or Lipos?


Wolf
Korishan likes this post
If 18 X 650 = 2200+mAh then we have power! 
May all your Cells have an IR of 75mΩ or less Smile
Last count as of 8/7/2019
Total Number of Cells Recorded and processed                 6149
Total Cells required for PowIRwall                                   2856
Total Cells ≥2200mAh, ≥80%, ≥35mΩ, ≤75mΩ, ≥4.12V   2760
For Info Google Drive
Not your average Wolf       
            Cool
Reply


Who read this thread?
100 User(s) read this thread:
AZ_Tekkie (04-12-2019, 06:56 PM), daromer (08-08-2019, 04:34 AM), Sean (08-08-2019, 12:46 AM), Majorphill (08-09-2019, 02:25 AM), Korishan (08-08-2019, 12:58 AM), PAF (08-07-2019, 03:08 PM), Franky Beuselinck (07-17-2019, 08:59 AM), jdeadman (08-08-2019, 02:09 AM), wim (08-05-2019, 06:31 PM), watts-on (08-06-2019, 11:50 AM), Hanssing (08-08-2019, 04:48 AM), tamkov (04-22-2019, 07:08 PM), Stefaan De Ridder (07-15-2019, 05:33 PM), Geek (08-08-2019, 12:44 AM), Ivo Staelens (08-07-2019, 07:40 PM), emerca (07-17-2019, 09:31 AM), Oz18650 (08-08-2019, 10:55 AM), Nikhil Mahajan (04-18-2019, 07:48 PM), Ste Collister (04-28-2019, 08:33 PM), djuro (08-06-2019, 11:16 AM), BaronVonChickenPants (07-17-2019, 05:36 AM), drchips (04-13-2019, 08:02 PM), HughF (08-09-2019, 06:01 AM), Issac (08-06-2019, 09:05 AM), Headrc (07-15-2019, 02:33 PM), kanchana (05-21-2019, 02:54 PM), rogales141 (08-27-2019, 06:48 AM), ARLISS (07-17-2019, 04:12 AM), Crimp Daddy (04-18-2019, 06:14 PM), jonyjoe505 (04-14-2019, 04:43 AM), Redpacket (07-18-2019, 11:12 AM), mldee (08-07-2019, 09:29 AM), completelycharged (08-24-2019, 03:46 PM), Ibiza (08-05-2019, 07:58 PM), Oliman (07-15-2019, 08:21 PM), SilverNodashi (04-26-2019, 04:45 PM), whisperbot (06-23-2019, 08:34 AM), choncy12 (08-07-2019, 01:11 PM), Bubba (08-07-2019, 10:31 AM), Cherry67 (08-05-2019, 07:25 PM), Walde (07-17-2019, 01:53 PM), Riplash (07-20-2019, 12:55 PM), Katarn_89 (07-27-2019, 02:51 AM), w0067814 (04-12-2019, 07:17 PM), Mikethezipper (08-08-2019, 12:36 AM), Dovespark (08-07-2019, 05:08 PM), neowolf (08-30-2019, 09:25 AM), chuckp (08-05-2019, 06:39 PM), emuland-metroman (08-07-2019, 06:23 PM), Beholder (08-08-2019, 06:13 PM), runsnbunsn (07-21-2019, 07:28 PM), sl1me (04-19-2019, 08:48 AM), Dirty Optics (08-08-2019, 03:36 AM), Wolf (08-15-2019, 06:43 PM), 5buBZMKeJZgapTGsbGzKf (07-20-2019, 06:14 PM), camthecam (04-13-2019, 09:57 PM), Generic (08-11-2019, 03:31 AM), nuckles (04-12-2019, 11:24 PM), rettore (07-17-2019, 07:33 PM), Solardad (08-08-2019, 10:58 AM), stevelectric (07-17-2019, 02:36 PM), eric.peton@laposte.net (08-05-2019, 09:23 PM), ajw22 (08-09-2019, 01:51 PM), RikH (08-06-2019, 08:23 PM), newone972 (07-17-2019, 09:13 PM), Lordsangreal (05-12-2019, 05:44 AM), wind0r (04-16-2019, 03:44 PM), hanwen127408 (08-28-2019, 03:47 PM), kevinjaye (08-30-2019, 02:40 AM), derekisastro (07-09-2019, 12:57 AM), OffGridInTheCity (08-05-2019, 06:11 PM), bertvaneyken (04-14-2019, 08:34 PM), ma3006he (08-11-2019, 01:53 AM), fleming (04-15-2019, 08:54 PM), BarryG (08-07-2019, 05:58 PM), wreckless (04-12-2019, 08:24 PM), 100kwh-hunter (08-03-2019, 03:13 PM), juanjo57 (08-07-2019, 04:06 AM), bairleafarm (04-14-2019, 08:24 AM), Scott_C (05-01-2019, 04:22 PM), ben teker (08-06-2019, 09:35 PM), BitcoinBandit (04-25-2019, 07:59 AM), A713083 (04-30-2019, 07:00 AM), MrRoyal007 (05-14-2019, 02:03 PM), billvon (07-16-2019, 06:02 PM), Karesi (06-04-2019, 12:17 AM), mackoffgrid (09-16-2019, 06:08 AM), Saiya (08-08-2019, 08:44 PM), Luis (07-31-2019, 10:26 PM), kimbo (07-16-2019, 05:14 AM), krobertson (07-20-2019, 10:28 PM), stok (07-23-2019, 12:08 PM), goran (07-08-2019, 12:47 AM), Jonisingt35r (08-27-2019, 08:21 AM), evbkz (07-20-2019, 05:23 AM), 3xtr3m3 (08-09-2019, 03:55 PM), drnickriviera (08-11-2019, 09:13 PM), jiggyjonboat (09-14-2019, 07:20 PM), Nickonet2000 (08-18-2019, 07:04 PM), Funkadelicious (08-20-2019, 10:25 AM)

Forum Jump:


Users browsing this thread: 1 Guest(s)