![]() ![]() Warning: Lithium-Ion batteries are hazardous devices. Older firmware versions may or may not work as described within this article. Please note that the documentation provided on this page always refers to the latest firmware release found on GitHub. ![]() The rationale behind this project was to upgrade the depleted battery pack and charger of an old cordless drill from Nickel-Cadmium (NiCd) to Lithium-Ion (Li-Ion) technology. The same design can be used for charging Lithium-Polymer (LiPo) batteries. It uses the Constant Current Constant Voltage (CC-CV) charging method with end-of-charge detection based on multiple criteria. The ADC should be returning a number between (0x3ff) and 0x010702 is not 370 decimal.Following is the tutorial of a DIY Lithium-Ion battery charger implemented on Arduino with several advanced features like state-of-charge estimation, EEPROM logging and command-line interface. Other puzzles from the post are the numbers. I realise that the ESP-01 does not have easy access to the ADC input one of the many reasons why I never use the ESP-1- myself. Theoretically one could just catch it as the voltage just starts on its rapid decline but that doesn't sound a good idea to me and will be very dependent on the exact battery characteristic. The regulator will prevent a reasonable battery voltage decay measurement until it is very close to exhaustion. This is never going to prove satisfactory in my opinion if using a battery with a regulator to produce the 3.3V Vdd supply. ![]() There seems to be a desire to use the ADC in a mode where it measures the internal Vdd supply (3.3V) rather than via the external ADC (TOUT) pin. I do find the rest of the original post puzzling. The poor absolute accuracy can also be a bit problematic but one can calibrate this once, e.g. By using a running average of say 16 measurements one can get 7 to 8 bit resolution which can give reasonable indication of the state of a lithium battery as it goes from 4.2V to 3.3V in its usable charge span. The internal ADC on the esp8266 is indeed poor for many adc measurements but I find it is adequate for battery monitoring where precision is less important. The datasheet for the ESP8266EX does not list the reference voltage used by the SAR ADC. Is there a way to access the memory register for the SAR ADC directly from code? The example provided does not seem to work. My goal is to measure the system voltage and correlate that with a draining battery, so that I could warn the user when it is time to charge the battery. The example code is very simple, and uses the adc_read function defined in the adc.h header: I have powered different ESP-01s from USB-UARTs, a 3.7 LiPo battery (running through an LDO to get the 3.23 V), and from raspberry pi pins (3.3V and 5V). The voltage never changes, never fluctuates. My input voltage as measured with a multimeter shows otherwise (plus the module is alive). Since the ADC is 10-bit, I am assuming the value is actually 0x010702 or 370 decimal. Problem is, the adc function reading is always 0x01010702 (4466). I can see the device stop as the voltage is decreased (as measured by an multimeter). The trimpot gives me the range 3.3V to 0. I have setup a test circuit that uses a voltage divider using a trimpot 10k and 20k resistor. It builds fine, then flashes, and monitors successfully. Specifically, I am using the adc example project from the peripherals section of the SDK installation. * Note: this is the internal system voltage measurement, not the external measurement which uses the TOUT pin. I am trying to test the internal system voltage of an ESP-01, using the ESP8266_RTOS_SDK v3.4. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |