Project request

Bobby783
Posts: 4
Joined: Wed Oct 14, 2020 9:33 pm

Project request

Postby Bobby783 » Wed Oct 14, 2020 9:45 pm

Hi all. I am very new to the world of the esp32. Is this forum OK to request help with a project? I have a large battery power bank with 7 cells. Each cell voltage is between 3 and 4.5v. I have a charge controller that readball 7 voltages and balances the 7cells. I would like a device that monitors the 7 voltages and sends them by BT and or WiFi to a GUI on a phone do I can monitor the voltages. Even better would be to get an alert when a cell voltage is high or low.
Thanks

ESP_Sprite
Posts: 8999
Joined: Thu Nov 26, 2015 4:08 am

Re: Project request

Postby ESP_Sprite » Thu Oct 15, 2020 2:13 am

Sounds doable. Does your charge controller have some kind of interface (serial, i2c, ...) allowing you to read out the voltages?

Bobby783
Posts: 4
Joined: Wed Oct 14, 2020 9:33 pm

Re: Project request

Postby Bobby783 » Thu Oct 15, 2020 4:29 pm

The cell balance controller has a serial interface with a cable coming from each cell. The separate cells are easily accessible so it would be no problem for the ESP32 to pick up the 7 voltages.

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Project request

Postby PeterR » Thu Oct 15, 2020 5:06 pm

Sounds exactly what an ESP was born to do!

If you don't get voltage direct from the controller then something like:
https://www.olimex.com/Products/IoT/ESP ... e-hardware
https://www.ebay.co.uk/itm/16-bit-ADC-A ... SwXeJYJrUV
and a large handfull of dupont wires will get you going.

The ADC is Ok (you will need 2) but you might find better/cheaper or something with an existing ESP driver. Hard to say unless you state accuracy. Accuracy, resolution, update rate etc are where you end up spending money. If you are low volume then spending a bit more $ for something with driver support is usually the best call.
& I also believe that IDF CAN should be fixed.

Bobby783
Posts: 4
Joined: Wed Oct 14, 2020 9:33 pm

Re: Project request

Postby Bobby783 » Thu Oct 15, 2020 6:31 pm

Cost is the lowest of my priorities. While accuracy is not critical why not be fairly accurate, maybe within .1 of a volt. Frequency of reading is important maybe even 5 minutes. The power bank has 7 cells in series. The cells are accessible so a wire can be taken off each cell to the development board.

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Project request

Postby PeterR » Fri Oct 16, 2020 10:21 am

With 7 readings every 5 minute and a resolution of approximately 5V/0.1V (say 64 or 6 bits) then most ADCs will do your job.
It then becomes a matter of software convinience e.g who has the best open source worked example along with a hardware module.

The ADC I suggested is 16 bits @around 1KHz and covers your input range.
The ESP could do the job on its own but you would need to scale the input. The ESP measurement does not go to 4.5V. Putting a divider in would allow you to take 3V..4.5V to (say) 1.5V.. 2.25V. A divider is not a great solution because of leakage & accuracy etc but is a simple 'get you started' option and capable of achieving better than 0.1V (I assume that your battery cell has low voltage shutdown protection). Use large value & high precision resistors.
An off board ADC can give you the correct input range but then you would have to find a software driver etc.

Using ESP's ADC has you using ESP examples & lots of ppl on forum will be able to help. Finding a development board which allows you 7 of the 8 ADC1 might be a challenge. You might have to snip off a peripheral or two. If you drop WIFI then a lot of boards will give you >=7 channels from ADC1 & ADC2.
It is a spreadsheet 'which functions and which pins do I need' checking excercise though as pins are often multi function.

EDIT: To be clear; using ADC2 might stop you using Wifi & some ADC2 pins are strapping & best left alone until you are more confident. Ideally then you use ADC1 only. The engineering process might sound complicated but is straight forward. Start with a spreadsheet row for each pin. Using the technical manual (or the summary pin allocation picture) then allocate each function you need to a pin. Another column perhaps for development board free pins (or stuff you can flip/clip off). At some point you will find that the development board does not give you the pin you want, so look for another board or look at flipping an IC. A good Google hunt may well find a 7 channel Wifi demo & then you are golden....
& I also believe that IDF CAN should be fixed.

Bobby783
Posts: 4
Joined: Wed Oct 14, 2020 9:33 pm

Re: Project request

Postby Bobby783 » Mon Oct 19, 2020 9:52 am

Thanks Peter

Im a complete newbie to this. I have a load of development kit and a lot of enthusiasm.

I have several esp32-VROOM Modules and understand that I need 2 ADCs as you suggested.

Is there a guide anywhere on how to put all this together and code it?

Thanks

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Project request

Postby PeterR » Tue Oct 20, 2020 9:05 am

I did not see anything immediately. Google is your friend but you have a specific problem.
Besides it would spoil all the fun if you copied!
https://microcontrollerslab.com/adc-esp ... e-example/ covers most of what you need.
You're main problem is which ADC channels are free.
Just create the spreadsheet I suggested and enter board usage using the board's schematic. If the pin is already connected to a peripheral (or not connected to a pin post) then you cannot use it (unless you can clip)!
Don't let the TLAs etc blind you! The datasheet will tell you which pins can be ADC, which are used for Wifi etc. The board schematic will tell you what has already been used. Its then a game of sudoku but one in which there may not be an answer for your board.
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: Google [Bot] and 85 guests