I am trying to make a device that monitors current usage from a 12v battery. I think this can be done with a resistor (somehow?), but I have no idea if that is true or how to setup the circuit for that.
I am using a ESP-12F chip (i.e. without a breakout). Also, the current usage will be as high as 20A.
To measure current you use the resistor as a shunt. You put a low value resistor, of precisely known value, in series with the load and measure the voltage drop across the resistor. Using Ohm's law one can then calculate the current through the resistor. The formula is current = voltage divided by resistance or I = E/R. Since the resistor needs to be of very low value (0.1Ω or less, usually) the voltage is also small. Use an op-amp to amplify the voltage before measuring with the processor AD converter.
Google "current monitor with resistor arduino" for lots more.
According to the data sheet, the ZXCT1009 outputs 10mA per 1V of drop across the 0.1Ω sense resistor. It will take 10A to result in a 1V drop across a 0.1Ω resistor. Ohm"s law, V= I * R 1V = 10A * 0.1Ω
If the highest that you will measure is 10A and you want the voltage at Vout to be 4V (on a 5V ADC for some head room) Ohm's law says 4V/0.01A = 400Ω = Rout.
If you connect one end of the current sense resistor to GND and your load to the other end
you can measure the voltage drop using an analog input where the load connects to the resistor and you won't need the ZXCT1009. As already noted, you may need a 0.01 Ohm
instead of a 0.100 Ohm current sense resistor.
Chips like the ZXCT1009, INA169 (uni-directional), INA196 (bi-directional) etc. rely on the A/D of the MCU. Don't complain if a combination with an ESP8266 has a poor zero and linearity performance.
An INA219 or INA226 has a built-in 12bit or 16bit A/D, so should be much better (if you need accuracy).
Leo..