Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read 12V battery charge
#1
Hello,
I am powering the board with a solar panel connected to a charge controller and a 12V battery. I have installed the ESPHome system on the board connected to Home Assistant, and it is working perfectly.

I would like to read the battery charge level using the analog sensor A1, but I know that this sensor reads a maximum of 5V, so the 12V from the battery (13V when fully charged) needs to be reduced. For this, I tried using a voltage divider circuit with two resistors, one 200KOhm and one 100KOhm. I connected the GND and A1 terminals of the analog sensors across the 100KOhm resistor, with the GND terminal going to the negative terminal of the battery.

+12V (Battery)
      |
      |
    [R1]  200kOhm
      |
      +------ A1
      |
    [R2]  100kOhm
      |
      |
    GND (Battery -)

The configuration in ESPHome is:

Code:
sensor:
  - platform: adc
    pin: 36
    name: 'Battery Charge - Voltage'
    id: battery_charge_voltage
    accuracy_decimals: 5
    device_class: "voltage"
    state_class: "measurement"
    unit_of_measurement: "V"
    update_interval: 5s
    filters:
    - multiply: 24.6

This configuration gives me readings of values below 0, which I had to multiply by 24.6 to get battery voltage values close to what I read using a voltmeter connected to the battery terminals.

Additionally, the values read are not stable, while the voltmeter provides a rather stable value.

Can you tell me if I am making any mistakes in the configuration or in the circuit? Is there a simpler way to perform this reading?

Thank you.

Darsh
Reply


Messages In This Thread
Read 12V battery charge - by darsh - 11-25-2024, 11:03 AM
RE: Read 12V battery charge - by admin - 11-25-2024, 11:44 AM
RE: Read 12V battery charge - by darsh - 11-25-2024, 11:57 AM
RE: Read 12V battery charge - by JULIO - 11-25-2024, 03:31 PM
RE: Read 12V battery charge - by darsh - 11-26-2024, 05:47 AM
RE: Read 12V battery charge - by admin - 11-26-2024, 12:13 AM
RE: Read 12V battery charge - by darsh - 12-01-2024, 01:55 PM
RE: Read 12V battery charge - by admin - 12-01-2024, 11:39 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)