I have small project using ESP32 devkit V1 and I will use a flow meter that have a operating voltage of 3.5V and a turbidity sensor that have a 5v operating voltage. It is okay to use a 9v battery or what can you suggest type of battery to power this project? I prefer an external battery because I'm planning to mount it in a plastic blue container of water And also I'm planning to use it send data to Web server like an monitoring system.
I recommend using a 3.7V Li-ion battery with a 5V boost converter and run everything from 5V. However, the ESP32 I/Os are 3.3V so you will need to use some type of voltage level converters on the flow meter and turbidity meter outputs. A simple resistive voltage divider should work. 2.2K and 3.9K ohms would be good.
You have choosen for a board that is not designed for battery power. There are plenty of ESP32 offerings with battery connection and even with built-in chargers,
but your board is not one of them.
The easy way out is to connect the USB lead to a cellphone powerbank and be done with it.
Leo..
A cellphone powerbank is basically a 3.7volt LiPo battery with charger, battery management (protection), 5volt boost converter and USB socket in a neat case.
No other parts needed. You already have the USB lead.
You could make that yourself, likely for a higher price, but why.
A simple 5Ah model could run your board for 36 hours. 10Ah for 72hours, etc.
Leo..
I use the cheapest USB powerbanks I can find. My logic is that the cheap ones won’t have minimum power limit circuitry that could make them not work with arduino. If the current is too low, some of them won’t turn on.
Which is a problem when powering an Uno/Nano etc.
But that likely won't happen with a big-board ESP32, that already draws 100mA doing nothing.
As long as you don't do something silly as using sleep modes.
Sleep modes would be better with a board designed for battery power.
Leo..