Mikethezipper said:
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 channelsand resolution was betterat12 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 Iwent all out to 1M and 22K and that worked.
Unfortunately the ESP32 was stilltoo 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 inputbetween 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